Files
dsrc/sku.0/sys.server/compiled/game/script/item/special/fannypack.script
T

47 lines
1.2 KiB
Plaintext

/**********************************************************************
* Copyright (c)2000-2002 Sony Online Entertainment Inc.
* All Rights Reserved
*
* Title: player_dot
* Description: Script is attached to a fannypack to ensure backpacks are removed
* @author $Author:$
* @version $Revision:$
**********************************************************************/
/***** INCLUDES ********************************************************/
include library.utils;
trigger OnTransferred(obj_id sourceContainer, obj_id destContainer, obj_id transferer)
{
//equipped
if(isIdValid(destContainer) && isPlayer(destContainer))
performUnequipBackSlotContainer(destContainer);
//unequipped
if(isIdValid(sourceContainer) && isPlayer(sourceContainer))
performUnequipBackSlotContainer(sourceContainer);
return SCRIPT_CONTINUE;
}
void performUnequipBackSlotContainer(obj_id player)
{
if(isIdValid(player))
{
obj_id backpack =getObjectInSlot(player, "back");
if(!isIdValid(backpack))
return;
int type = getGameObjectType( backpack );
if(isGameObjectTypeOf(type, GOT_misc_container_wearable))
{
obj_id inv = utils.getInventoryContainer(player);
putInOverloaded(backpack, inv);
}
}
return;
}