generated from Jaysyn/ModuleTemplate
30 lines
1.0 KiB
Plaintext
30 lines
1.0 KiB
Plaintext
// OnEnter - for ARENA_ENTRY_TRIGGER
|
|
// By Deva Bryson Winblood
|
|
void main()
|
|
{
|
|
object oPC=GetEnteringObject();
|
|
object oOb=GetNearestObjectByTag("ARENA_EventMaster",oPC,1);
|
|
int nState=GetLocalInt(oOb,"nState");
|
|
object oCon=GetLocalObject(oOb,"oContestant");
|
|
if (oCon!=oPC&&GetIsPC(oPC)==TRUE)
|
|
{ // teleport out
|
|
AssignCommand(oPC,ClearAllActions(TRUE));
|
|
AssignCommand(oPC,JumpToObject(oOb));
|
|
SendMessageToPC(oPC,"Only the specified contestant is allowed in the arena.");
|
|
} // teleport out
|
|
else if (oCon==oPC)
|
|
{ // contestant
|
|
if (nState==0)
|
|
{ // entered arena
|
|
SetLocalInt(oOb,"nState",1);
|
|
ExecuteScript("arena_placebar",OBJECT_SELF);
|
|
ExecuteScript("arena_mainscript",OBJECT_SELF);
|
|
} // entered arena
|
|
else if (nState==7)
|
|
{ // victorious PC entered
|
|
SetLocalInt(oOb,"nState",-1);
|
|
SendMessageToPC(oPC,"Speak to the arena master again to collect your winnings.");
|
|
} // victorious PC entered
|
|
} // contestant
|
|
}
|