mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
47 lines
1.2 KiB
Plaintext
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;
|
|
} |