mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
65 lines
1.1 KiB
Plaintext
65 lines
1.1 KiB
Plaintext
include library.trial;
|
|
include library.utils;
|
|
|
|
trigger OnAttach()
|
|
{
|
|
if(!hasObjVar(self, "item.set.tokens_held"))
|
|
{
|
|
trial.initializeBox(self);
|
|
}
|
|
else
|
|
{
|
|
trial.verifyBox(self);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
if(!hasObjVar(self, "item.set.tokens_held"))
|
|
{
|
|
trial.initializeBox(self);
|
|
}
|
|
else
|
|
{
|
|
trial.verifyBox(self);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnGetAttributes(obj_id player, string[] names, string[] attribs)
|
|
{
|
|
int free = getFirstFreeIndex(names);
|
|
if (free == -1)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if(!hasObjVar(self, "item.set.tokens_held"))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
int[] tokenTypes = getIntArrayObjVar(self, "item.set.tokens_held");
|
|
|
|
if(tokenTypes.length == trial.NUM_HEROIC_TOKEN_TYPES)
|
|
{
|
|
for(int i = 0; i < tokenTypes.length; i++)
|
|
{
|
|
names[free] = utils.packStringId(new string_id ("static_item_n", trial.HEROIC_TOKENS[i]));
|
|
attribs[free++] ="" + tokenTypes[i];
|
|
}
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnDestroy()
|
|
{
|
|
obj_id whoDat = getTopMostContainer(self);
|
|
sendSystemMessage(whoDat, new string_id("spam", "can_not_destroy"));
|
|
|
|
return SCRIPT_OVERRIDE;
|
|
} |