void main() { object oMe=OBJECT_SELF; object oMod=GetModule(); object oWP=GetNearestObjectByTag("GONG_SPAWN",oMe,1); int nCount=GetLocalInt(oMod,"nPeliosTrialOne"); object oPC=GetLastUsedBy(); object oCreature; string sRes; object oDoor=GetObjectByTag("TrialOneDoor"); AssignCommand(oPC,ActionAttack(oMe,TRUE)); DelayCommand(1.5,PlaySound("as_cv_gongring3")); if (GetLocalInt(oMe,"nUsed")!=TRUE) { // first usage SetLocalInt(oMe,"nUsed",TRUE); nCount++; SetLocalInt(oMod,"nPeliosTrialOne",nCount); if (nCount==3) { // open the Door SetLocked(oDoor,FALSE); SetPlotFlag(oDoor,FALSE); DestroyObject(oDoor); } // open the Door if (nCount==1) sRes="slaadred001"; else if (nCount==2) sRes="slaadbl001"; else sRes="slaadgrn001"; oCreature=CreateObject(OBJECT_TYPE_CREATURE,sRes,GetLocation(oWP),TRUE); } // first usage }