#include "X0_I0_TRANSFORM" #include "jw_inc_spells" void main() { int nIdx=Random(5); // this is the tag of the object to be replaced: string sTarget="jw_transf_obj"; string sString; object oPC=GetEnteringObject(); if ((GetLocalInt(OBJECT_SELF,"triggered")!=TRUE)&&(GetIsObjectValid(oPC))&&(GetIsPC(oPC))) { //SpeakString("PC entered"); switch (nIdx) { case 0: sString="jw_guardian2_si"; break; case 1: sString="jw_guardian_si"; break; case 2: sString="jw_doom_si"; break; case 3: sString="jw_guardiand_si"; break; case 4: sString="jw_shocker"; break; } //SpeakString("chosen "+sString); // create our mob JWTriggerObjectTransform(sString,VFX_IMP_DISPEL,sTarget); // say we are no longer trapped SetLocalInt(OBJECT_SELF,"triggered",TRUE); } else { //SpeakString("Something wrong"); } }