Exploding Enemy
Dragonfolk2000
Member Posts: 388
I've got an enemy that needs to explode when they take any amount of fire damage. This explosion needs to damage all creatures (friend and foe alike) but only about 1d6 or 2d6 fire damage and allow for a reflex save for half. I've managed to make enemies explode with SPELL_FIREBALL and with SPELL_GRENADE_FIRE but it usually either only damages the enemy or the PC, never the other nearby enemies. Ideally the player will lob an alchemist fire into a group of these explodey enemies and they start a chain reaction and explode the whole group. An irresponsible player and their allies might be too close though.
Right now I've got this in both the OnDamaged and OnDeath scripts. #include "x0_i0_corpses" is earlier in the script.
Right now I've got this in both the OnDamaged and OnDeath scripts. #include "x0_i0_corpses" is earlier in the script.
int hasExploded = GetLocalInt(OBJECT_SELF,"hasExploded"); if(GetDamageDealtByType(DAMAGE_TYPE_FIRE) >= 1 && hasExploded != 1) { SendMessageToPC(GetFirstPC(),"Fire"); ExplodeObject(OBJECT_SELF, SPELL_FIREBALL); }
0
Comments