DMH-Online

Dungeon Masters Helper · Est. 2005

Creatures Scripts

NWN Script: exploding_chickens.htm

Author Sticky: Post Working Scripts Here
Sembiance Posted: Sunday, 23 June 05:49AM
Script: ChickenDeath

Description:
Exploding Chickens.
When you shoot a chicken, it blows up.
It then goes through all the chickens around it and it has a chance to blow any of those up too.
It also has the chance of setting a 'delayed reaction' explosion on another chicken.
Boom boom boom!

To see it in action: http://www.cosmicrealms.com/ChickenArena.zip


NWScript:
//Script: chikendeath
void main()
{
    location lSource= GetLocation( OBJECT_SELF );
    ApplyEffectAtLocation( DURATION_TYPE_INSTANT, EffectVisualEffect( VFX_FNF_FIREBALL), lSource);
    object oObject = GetFirstObjectInShape( SHAPE_SPHERE, 30.0, lSource);
    while( oObject != OBJECT_INVALID && d12()!=1)
    {
        if(GetTag(oObject)!="NW_CHICKEN")
        {
            if(GetIsPC(oObject)==FALSE)
                ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(1, DAMAGE_TYPE_FIRE), oObject);
            oObject = GetNextObjectInShape( SHAPE_SPHERE, 30.0, lSource);
            continue;
        }
        if(GetLocalInt(oObject, "DeadChicken")==1)
        {
            oObject = GetNextObjectInShape( SHAPE_SPHERE, 30.0, lSource);
            continue;
        }
        if(Random(50)==47)
        {
            SetLocalInt( oObject, "DeadChicken", 1);
            ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(d6(2), DAMAGE_TYPE_FIRE), oObject);
            oObject = GetNextObjectInShape( SHAPE_SPHERE, 30.0, lSource);
            continue;
        }
        if(d6()==1)
        {
             SetLocalInt( oObject, "DeadChicken", 1);
             AssignCommand( oObject, DelayCommand(IntToFloat(Random(20)+3), ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDamage(d6(2), DAMAGE_TYPE_FIRE), OBJECT_SELF)));
             oObject = GetNextObjectInShape( SHAPE_SPHERE, 30.0, lSource);
             continue;
        }
        oObject = GetNextObjectInShape( SHAPE_SPHERE, 30.0, lSource);
    }
}
⌂ 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