//:://///////////////////////////////////////////////// //:: Default: On Spawn In //:: NW_C2_DEFAULT9 //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Determines the course of action to be taken after having just been spawned in */ //:://////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Oct 25, 2001 ///::////////////////////////////////////////////// #include "jw_treasure_gene" #include "NW_I0_GENERIC" #include "jw_privates_inc" void generate(); void main() { ExecuteScript("prc_npc_spawn", OBJECT_SELF); // OPTIONAL BEHAVIORS (Comment In or Out to Activate ) **************************************************************************** //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION); //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); // This causes the creature to say a special greeting in their conversation file // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired // greeting in order to designate it. As the creature is actually saying this to // himself, don't attach any player responses to the greeting. SetStartLocation(); if (GetHitDice(OBJECT_SELF)>4) { SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET); SetListenPattern(OBJECT_SELF, "I_AM_HEALING", 123); //listen out for this phrase SetListening(OBJECT_SELF,TRUE); } // This will set the listening pattern on the NPC to attack when allies call //SetSpawnInCondition(NW_FLAG_STEALTH); // If the NPC has stealth and they are a rogue go into stealth mode //SetSpawnInCondition(NW_FLAG_SEARCH); // If the NPC has Search go into Search Mode //SetSpawnInCondition(NW_FLAG_SET_WARNINGS); // This will set the NPC to give a warning to non-enemies before attacking //SetSpawnInCondition(NW_FLAG_SLEEP); //Creatures that spawn in during the night will be asleep. //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING); //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION); //SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS); //SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS); //This will play Ambient Animations until the NPC sees an enemy or is cleared. //NOTE that these animations will play automatically for Encounter Creatures. // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME. //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN); // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.) //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE); // OPTIONAL BEHAVIOR (Flee to a way point and do not return.) //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE); // OPTIONAL BEHAVIOR (Teleport to safety and do not return.) ///SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN); // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.) // CUSTOM USER DEFINED EVENTS /* The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD. Like the On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors. The user defined events user 1000 - 1010 */ //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1001 //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1002 //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1005 //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1006 //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1008 //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003 //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1004 //SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007 // DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***************************************************************************************** SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to. WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0) // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after // combat. MakeTreasure(); //* Use this to create a small amount of treasure on the creature //generate(); } void generate() { int nIdx; string sItem; object oObject; int nRandom; for(nIdx=1;nIdx<=1;nIdx++) { nRandom=(Random(43)+1); switch(nRandom) { case 1: sItem="jw_war_halberd"; break; case 2: sItem="jw_dwarven_ring"; break; case 3: sItem="jw_mystra_ring"; break; case 4: sItem="jw_book2_binding"; break; case 5: sItem="jw_undead_urn"; break; case 6: sItem="jw_gladiator_glo"; break; case 7: sItem="jw_token_gond"; break; case 8: sItem="jw_token_lath"; break; case 9: sItem="jw_token_shar"; break; case 10: sItem="jw_token_shaun"; break; case 11: sItem="jw_bright_small"; break; case 12: sItem="jw_spell_small2"; break; case 13: sItem="jw_spell_large2"; break; case 14: sItem="jw_watch_helmet"; break; case 15: sItem="jw_helm_battle1"; break; case 16: sItem="jw_belt_scale"; break; case 17: sItem="jw_gaunt_hin3"; break; case 18: sItem="jw_gaunt_death3"; break; case 19: sItem="jw_gaunt_yel3"; break; case 20: sItem="jw_am_will5"; break; case 21: sItem="jw_am_prot1"; break; case 22: sItem="jw_ring_pow1"; break; case 23: sItem="jw_ring_elem"; break; case 24: sItem="jw_ring_inv"; break; case 25: sItem="jw_ring_wild"; break; case 26: sItem="jw_axe_nether"; break; case 27: sItem="jw_great_vermin"; break; case 28: sItem="jw_club_ang"; break; case 29: sItem="jw_flail_heir"; break; case 30: sItem="jw_daxe_death"; break; case 31: sItem="jw_plate_storm"; break; case 32: sItem="jw_kama_hid"; break; case 33: sItem="jw_kama_peas"; break; case 34: sItem="jw_staff_pow"; break; case 35: sItem="jw_wand_para"; break; case 36: sItem="jw_wand_sum"; break; case 37: sItem="jw_wand_heav"; break; case 38: sItem="jw_bow_elv"; break; case 39: sItem="jw_sbow_loath"; break; case 40: sItem="jw_dart_acc"; break; case 41: sItem="jw_tower_corm"; break; case 42: sItem="jw_plate_storm"; break; case 43: sItem="jw_staff_entry"; break; } oObject=CreateItemOnObject(sItem,OBJECT_SELF); } }