DMH-Online

Dungeon Masters Helper · Est. 2005

Creatures Scripts

NWN Script: vampire_coffin.htm

Author: Darkvenge
Author Website: n/a
Script Name: Open Coffin / Spawn Vampire
Description: A PC opens a coffin and out pops a vampire. This will only happen once so PC's don't continuously spawn vampires as they open/damage the coffin.
Instructions on Use: Put script in the OnDamaged and OnOpen events of a coffin.  Also, make sure to use the blueprint res/ref of the creature you wish to spawn.

NOTE:  Some people are successful by using the creature TAG and not blueprint res/ref.

Script 1 (OnDamaged & OnOpen):

////////////////////////////////////////////////////////////
/////////////Open Coffin - Spawn Vampire ///////////////////
////////////////////(Only Once)/////////////////////////////
////////////////////////////////////////////////////////////
//////////////By: Tom Ploskina Jr.//////////////////////////
////////////////////////////////////////////////////////////
/*      This script spawns a vampire by its ////////////////
/       blueprint upon opening a coffin.  It ///////////////
/       then sets a local variable to make /////////////////
/       sure that only 1 vampire will spawn ////////////////
/       when the coffin is opened.//////////////////////////
///////////////////////////////////////////////////////// */

void main()
{
//If PC has not opened coffin keep going...
if(!(GetLocalInt(GetLastOpenedBy(), "nCoffinStatus") == 1))
{
    //Okay, the PC is about to open coffin, let's give them a 1
    SetLocalInt(GetLastOpenedBy(), "nCoffinStatus", 1);
    //Spawn the creature with the blueprint of ct_vamp at stated location
    location CoffinIsHere = GetLocation(OBJECT_SELF);
    CreateObject(OBJECT_TYPE_CREATURE, "ct_cvamp", CoffinIsHere);
    }
    else
    {
        //Let's do something if they've already opened the coffin
        SpeakString("The coffin appears to be empty");
        }
}
⌂ 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