DMH-Online

Dungeon Masters Helper · Est. 2005

Creatures Scripts

NWN Script: summon_mob.htm

Author Sticky: Post Working Scripts Here
Eboneye Posted: Monday, 08 July 02:39PM
This is a function to create a dramatic spawn-in (summoning) of a monster at a specific location marked by a waypoint. It also demonstrates how to target visual FX on a specific location.

NWScript:
//:://////////////////////////////////////////////////
//:: Summon Creature Trap Script
//::
//:: This is a fancy / dramatic effect to gate in a monster as a result
//:: of some PC action.  The most typical usage would be used in the 
//:: OnTriggered event of a trap. It could also be used in the OnEnter 
//:: event of a generic trigger if it is your desire to always summon 
//:: a creature when the PC passes through a location. 
//:: 
//:: To function the script requires a way point be placed to determine
//:: the summoning location.  If you wish to summon custom creatures they
//:: will also need to be placed on the pallet and their blueprint IDs
//:: noted.
//:: 
//::  $author$: Will Greenway
//:: $version$: 1.0
//:: $updated$: 07/06/2002
//:://////////////////////////////////////////////////
void summoncreature(string TEMPNAME, string LOC_TAG);
void summoncreature(string TEMPNAME, string LOC_TAG) {
    location summonlocation = GetLocation(GetWaypointByTag(LOC_TAG));
    //::///
    //:: This FX simulates flame striking down onto the spawn location
    //::///
    effect StrikeEffect = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE,FALSE);
    //::///
    //:: This FX simulates the summoning ring appearing around the summoning location
    //::///
    effect SummonEffect = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3,FALSE);
    //::///
    //:: Wait after the trap is triggered.
    //::///
    ActionWait(2.0);
    //::///
    //:: Play summoning sound
    //::///
    PlaySound("sff_summund");
    //::///
    //:: Fire strike at location
    //::///
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT,StrikeEffect,summonlocation,1.5);
    //::///
    //:: Summon effect at spawn location
    //::///
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT,SummonEffect,summonlocation,4.0);
    //::///
    //:: Spawn in the creature here
    //::///
    CreateObject(OBJECT_TYPE_CREATURE,TEMPNAME,summonlocation,TRUE);
}
void main()
{
    //:://
    //:: Set the name of the creature blueprint ID you wish to create
    //:: The blueprint ID name can be found under the advanced properties of each creature
    //:: If you wish to assign inventory you will have to create a custom creature which
    //:: will have a unique ID ending in a 3 digit number 00x, put that entire identifier in the
    //:: quotes.  For example sake I have a the base template name of a doom knight.
    //:://
    string CR_TEMPNAME = "nw_doomkghtboss";
    //::///
    //:: Set the location where creature will spawn 
    //:: You must create a way point in your map where the critter will
    //:: appear.  Make the waypoint tags match up in the waypoint and in this script.
    //:: As an example I put "SPAWN_LOC" in the waypoint tag.
    //::///
    string WAYTAG = "SPAWN_LOC";
    //::///
    //:: Call the summon function
    //::///
    summoncreature(CR_TEMPNAME, WAYTAG);
    //::///
    //:: NOTE: It would be just as easy to call this function like this:
    //::       summoncreature("nw_doomkghtboss","SPAWN_LOC");
    //::
    //:://// 
    
}
⌂ 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