DMH-Online

Dungeon Masters Helper · Est. 2005

Creatures Scripts

NWN Script: creature_proc.htm

Author Sticky: Post Working Scripts Here
Ziggi Posted: Thursday, 27 June 02:20AM
Creature Proc
by ziggi

Creature will cast a fireball ( you can change this to other spells) every few rounds(this can also be adjusted by adjusting the counter values).

apply to your creatures onHeartbeat.

I am a scripting noob so there maybe easier ways to do this but this is what I came up with so here you go.

NWScript:
int iCounter = GetLocalInt(OBJECT_SELF, "m_iCounter"); //counter set to zero
    object oTarget = GetLastAttacker();
    if(iCounter <= 2)
    {
        iCounter = iCounter + 1;   //add one to counter until it reaches 3
    }
    else  //runs when counter = 3
    {
        ClearAllActions();
        ActionDoCommand(ActionSpeakString( "Die!" ));
        ActionDoCommand(ActionCastSpellAtObject(SPELL_FIREBALL, oTarget, METAMAGIC_NONE, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));
        iCounter = 0; //set counter back to zero
    }
    //save the local int
    SetLocalInt(OBJECT_SELF, "m_iCounter", iCounter);
⌂ 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