void main() { object oAtog = OBJECT_SELF; location lAtog = GetLocation(OBJECT_SELF); object oMod = GetModule(); int iDeath = GetLocalInt(oMod,"Atog_Death"); int iNum, i; object oBag; switch (iDeath) { case 0 : SpeakString("I will RETURN !"); SetLocalInt(oMod,"Atog_Death",1); for (i = 0; i<2 ;i++) { CreateObject(OBJECT_TYPE_CREATURE,"atogtheplanar",lAtog,TRUE); } break; case 1 : iNum = GetLocalInt(oMod,"Atog_Death_Num"); if (!iNum) { iNum ++; SetLocalInt(oMod,"Atog_Death_Num",iNum); } else { DeleteLocalInt(oMod,"Atog_Death_Num"); SetLocalInt(oMod,"Atog_Death",2); for (i = 0; i<4 ;i++) { CreateObject(OBJECT_TYPE_CREATURE,"atogtheplanar",lAtog,TRUE); } } SpeakString("I will RETURN !"); break; case 2 : iNum = GetLocalInt(oMod,"Atog_Death_Num"); if(iNum >= 3) { DeleteLocalInt(oMod,"Atog_Death_Num"); // DeleteLocalInt(oMod,"Atog_Death"); SpeakString("Noooo Atog can't be defeated !!! Aaarrghh ..."); CreateObject(OBJECT_TYPE_PLACEABLE,"sol_1",lAtog); oBag = CreateObject(OBJECT_TYPE_PLACEABLE,"divinereward",lAtog); CreateItemOnObject("planarphaser",oBag); CreateItemOnObject("atogskin",oBag); CreateItemOnObject("banktoken1000000",oBag); CreateItemOnObject("banktoken1000000",oBag); CreateItemOnObject("banktoken1000000",oBag); ExecuteScript("x2_def_ondeath", OBJECT_SELF); } else { iNum ++; SetLocalInt(oMod,"Atog_Death_Num",iNum); } break; default : DeleteLocalInt(oMod,"Atog_Death"); break; } ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DEATH), oAtog); }