mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
39 lines
1009 B
Plaintext
39 lines
1009 B
Plaintext
/**
|
|
* Copyright (c)2000-2002 Sony Online Entertainment Inc.
|
|
* All Rights Reserved
|
|
*
|
|
* Title: add_only.script
|
|
* Description: script for containers that do not lose items
|
|
* @author $Author:$
|
|
* @version $Revision:$
|
|
*/
|
|
|
|
/***** INCLUDES ********************************************************/
|
|
|
|
/***** CONSTANTS *******************************************************/
|
|
|
|
const string SCRIPT_ME = "item.container.add_only";
|
|
|
|
const string_id SID_REMOVE_ONLY_CONTAINER = new string_id("error_message", "add_only");
|
|
|
|
/***** TRIGGER *********************************************************/
|
|
trigger OnAttach()
|
|
{
|
|
if ( (getContainerType(self) == 0) || (isPlayer(self)) )
|
|
{
|
|
detachScript(self, SCRIPT_ME);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAboutToLoseItem(obj_id srcContainer, obj_id transferer, obj_id item)
|
|
{
|
|
if ( isPlayer(transferer) )
|
|
{
|
|
sendSystemMessage(transferer, SID_REMOVE_ONLY_CONTAINER);
|
|
return SCRIPT_OVERRIDE;
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
} |