DMH-Online

Dungeon Masters Helper · Est. 2005

Creatures Scripts

NWN Script: explode_ondeath.htm

Author Sticky: Post Working Scripts Here
Calidarien Posted: Monday, 24 June 10:43PM
Samhaine: thanks! Here is an updated version of my explode on death script because I felt bad that there wasn't a saving throw, and then I also added a delay for a chance to run away as well.

1. Script Name: cal_explode
2. What It Does: Caller explodes after a delay and damages nearby objects for 2d6 fire damage (Reflex save DC 15 for half)
3. Notes: My current use for this script is an OnDeath call that makes it annoying to be standing next to creatures you kill
4. The Script Itself:

NWScript:
//Script: cal_explode
//Author: Albert Shih (Calidarien)
//Version: v0.9, 2002-06-24
//Usage: Caller explodes after a delay and damages nearby objects for 2d6 fire
//  damage (Reflex save DC 15 for half)
//Notes:
// v0.9: Added a Reflex save and defined the explosion as a separate function
//       for delaying purposes
//
void ExplodeAtLocation(location lTarget, int nDamage, int nSaveDC = 15, float fRadius = 2.) {
  ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_FIREBALL), lTarget);
  object oObject = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
  do {
    int nDamageAfterSave = GetReflexAdjustedDamage(nDamage/2, oObject, nSaveDC)+nDamage/2;
    ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(nDamageAfterSave, DAMAGE_TYPE_FIRE), oObject);
   } while ((oObject = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget)) != OBJECT_INVALID);
}
void main()
{
  location lSource = GetLocation(OBJECT_SELF);
  DelayCommand(3., ExplodeAtLocation(lSource, d6(2)));
}
⌂ All Scripts ← PreviousNext → 👁 Category List

All Creatures Scripts

📄 apply_spell_effect 📄 aurak_draconian 📄 baaz_draconian 📄 boss_spawner 📄 change_light_spawn_pt_on_death 📄 clone_mob 📄 collect_loot 📄 create_unique_objectIDs 📄 creature_proc 📄 explode_ondeath 📄 explode_ondeath_002 📄 explode_ondeath_003 📄 exploding_chickens 📄 fire_death 📄 inverse_mob 📄 iron_statue 📄 lich 📄 lootable_corpse 📄 lootable_corpse_002 📄 lootable_corpse_002a 📄 lootable_corpse_oo2 📄 mob_respawn 📄 mob_respawn_002 📄 multi_creature_spawn 📄 night_time 📄 random_death_effect 📄 random_drops 📄 random_drops_002 📄 random_drops_003 📄 random_enc_onrest 📄 random_hps 📄 sivac_draconian 📄 spawn 📄 spawn_on_hearbeat 📄 summon_last_hostile 📄 summon_mob 📄 trolls 📄 trolls_002 📄 vampire_coffin 📄 werewolf