EVENT_COUNT = 5120;
...
MANA_AMOUNT = 57;
...
SAVE_EVENT_STATE = 4036;
...
function bool checkEventCondition( attacker , itemId)
{
return OwnItemCount(attacker, itemId) == EVENT_COUNT;
}
...
function eventRequest( attacker, operationId, type)
{
GiveItem1(attacker, operationId, type);
}
...
function EventHandler ATTACKED( attacker )
{
local string event_npc;
...
event_npc = "Piglet";
...
if (attacker.name == event_npc && checkEventCondition(attacker, MANA_AMOUNT))
{
eventRequest(attacker, SAVE_EVENT_STATE, 1);
}
...
}