//:://///////////////////////////////////////////// //:: Name corpse_def_spawn //:: FileName //:: //::////////////////////////////////////////////// /* Exemple of a default spawn script for use of the lootable corpses. Created from NW_C2_DEFAULT9. */ //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 21/04/2003 //:: Modified On: 25/02/2004 //::////////////////////////////////////////////// #include "x0_i0_anims" // #include "x0_i0_walkway" - in x0_i0_anims #include "x0_i0_treasure" #include "x2_inc_switches" #include "corpse_lib" void main() { string script = GetLocalString(OBJECT_SELF,CorpseSpawnScript); if(script == "") { script = "nw_c2_default9"; } SetSpawnInCondition(NW_FLAG_DEATH_EVENT); ExecuteScript(script,OBJECT_SELF); if(!GetIsCorpseCopying()) //As the creature may be created several times this test is necessary. { int decayUse = GetUseDecay(); float decayDelay = GetDecayDealy(); int stepDecay = GetLocalInt(OBJECT_SELF,CorpseThreeStepDecay); if(decayUse) { if(decayDelay > 0.0) { SetDecay(decayUse,decayDelay,OBJECT_SELF,stepDecay); } else { SetDecay(decayUse,60.0,OBJECT_SELF,stepDecay); } } else if(decayDelay > 0.0) { SetDecay(TRUE,decayDelay,OBJECT_SELF,stepDecay); } SetLocalInt_Corpse(OBJECT_SELF, "X2_L_NOTREASURE",TRUE); if(GetLocalInt(OBJECT_SELF,CorpseSpawnedDead)) { ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(FALSE,FALSE),OBJECT_SELF); } } SetIsCorpseCopying(FALSE); }