Table of contents

TABLE OF CONTENTS I

GLOBAL ACTION 3

GLOBAL ARTIFICIAL INTELLEGENCE 32

GLOBAL GROUP 55

GLOBAL PLACEABLES 59

GLOBAL REPORTS 61

GRAPHICAL USER INTERACE 64

i NWN2 STOCK SCRIPTS VOL I MAIN SCRIPTS (ABRIDGED)

PRESENTED BY GAMEMASTER X & THE KNIGHTS OF THE CHARRED TABLE

WWW.KALIFORNICA.COM

[email protected]

ii FOREWORD

HI, GAMEMASTER X HERE. I WAS PEEKING UP THE GAMES SKIRT AND LOOKING AT ALL ITS PRIVATE PARTS AND IT OCCURRED TO ME IT WOULD BE NICE TO HAVE ALL THE STOCK SCRIPTS IN AN E-BOOK FORMAT. WHAT YOU HAVE HERE IS VOL 1 OF A THREE PART SERIES OF 2 STOCK SCRIPTS (THE ONES THAT INSTALL WITH THE GAME).

VOL 1 CONCENTRATES ON MAIN SCRIPTS OR THOSE SCRIPTS NOT SPECIFIC TO SPELLS OR A SPECIFIC AREA. MY INTENTION IS FOR THE FINAL SERIES TO BE LAID OUT AS FOLLOWS.

VOL I MAIN SCRIPTS

VOL II SPELL SCRIPTS

VOL III AREA SCRIPTS

VOL IV 2DA

Global Action

// ga_alignment /* This changes the player's alignment nActType = From a scale from +3 (Saintly/Paragon) to -3 (Fiendish/Anarchic), how much the act affects alignment bLawChaosAxis = 0 means adjust Good/Evil axis, 1 means adjust Law/Chaos axis */

// ga_attack /* This script makes the sAttacker attack the PC. It should be placed on an [END DIALOG] node.

Parameters: string sAttacker = Tag of attacker whom will attack the PC. Default is OWNER. */

// ga_attack_target

iii /* This script makes the sAttacker attack the sTarget. It should be placed on an [END DIALOG] node.

Parameters: string sAttacker = Tag of attacker. Default is OWNER. string sTarget = Tag of Target. Default is PC. */

// ga_blackout // // wrapper function for FadeToBlackParty() to instantly make screen black. Useful for the // first node of conversations.

// CGaw & BMa 2/13/06 - Created.

#include "ginc_cutscene" void main() { object oPC = (GetPCSpeaker()==OBJECT_INVALID?OBJECT_SELF:GetPCSpeaker());

FadeToBlackParty(oPC, 1, 0.0); }

// ga_camera_facing_point _party /* Point the cameras of all PCs' in the Speaker's party to target sTarget. Camera will be fDistance meters away from the PC, and pitched at fPitch degrees.

-fDistance can be between 1 and 25. At least 5 is advisable in most cases. 0 = use distance of current camera value

-fPitch can be between 1 and 89. 89 is nearly parallel to the ground. 1 is almost directly overhead. 60-70 is usually a reasonable default. 0 = use pitch of current camera value

- nTransitionType can be 0 or between 1 and 100. The higher the

4 number, the faster the transition. 0 = snap to new facing, no transition.

*/

// ga_clear_comp() /* Removes all roster members from the PC party. Removed roster members are not despawned. */

// ga_compshift /* This is the companion shift script that adjusts a companion's reaction to the PC nCompanion = This is the integer value of the companion in question nChange = This is the amount their reaction is adjusted nOverride = If this isn't equal to 0, the companions reaction is set to this amount. Use with caution. */

// ga_conversation_self /* start a conversation file with yourself.

Parameters: string sConversation = Conversation file to start. */

// ga_create_obj(string sObjectType, string sTemplate, string sLocationTag, int bUseAppearAnimation, string sNewTag, float fDelay) /* Wrapper for CreateObject() with optional delay.

5

Parameters: string sObjectType = Object type. The following are allowed: - CREATURE P - PLACEABLE I - ITEM W - WAYPOINT S - STORE string sTemplate = Name of the template to create. string sLocationTag = Tag of the waypoint at which to create the object. int bUseAppearAnimation = If =1, object will use appear animation. string sNewTag = Optional new tag for created object. float fDelay = Delay, in seconds, before creating the object. */

// ga_cutscene_move // // Move and delay the advancing of the conversation for a maximum of nMilliseconds. // Conversation will also advance if the move completes.

// ga_date_advance /* Advance date by amount indicated

nYear - Number of years to advance. nMonth - Number of months to advance. nDay - Number of days to advance. */

// ga_date_set /* Advance date by amount indicated

nYear - Specific year to set calendar to from 1340 to 32001. nMonth - Specific month to set

6 calendar from 1 to 12. nDay - Specific day to set calendar to from 1 to 28. */

// ga_death /* This script makes objects appear dead sTag = The tag(s) of the object(s) to make dead. You can pass multiple tags, seperated by commas (NO SPACES) to make multiple objects dead (ie. "Object1,Object2,Object3") iInstance = The instance of the object(s) to make dead. Pass -1 to make all instances dead. */

// ga_destroy /* This script destroys objects sTag = The tag(s) of the object(s) to destroy. You can pass multiple tags, seperated by commas (NO SPACES) to destroy multiple objects (ie. "Object1,Object2,Object3") NOTE: There may eventually be a function to eat white space (See Mantis 3296), but for now do not put spaces in the string. iInstance = The instance of the object to destroy. Pass -1 to destroy all instances. Pass 0 to destroy the first instance. fDelay = The delay before destroying the object(s)

*/

// ga_destroy_item /* This takes an item from a player

7 sItemTag = This is the string name of the item's tag nQuantity = The number of items to destroy. -1 is all of the Player's items of that tag. nPCFaction = Take from the whole PC faction */

//ga_destroy_party_hen chmen /* Destroy all henchmen in the entire party */

// ga_disable_scripts /* saves and clears the event handlers */

// ga_donothing.nss /* Do nothing, really. */

// ga_door_close /* This closes a door sTag = The tag of the door to close nLock = Set to 1 if you want to lock the door after it closes */

// ga_door_open /* This opens a door sTag = The tag of the door to open */

// ga_effect /* Does an effect on the specified target. This function takes 5 params: string sEffect - one of the below effects string sParams - comma delimited list of needed params string sDuration - I - Instant

8 (default), P - Permanent, or T, - Temporary w/ specified duration ex: temporay 30 seconds would be "T,30.0f" int iVisualEffect - -1=no visual, 0 = standard visual, or supply your own from visualeffects.2da (will be applied as an instant) string sTarget - Uses the standard GetTarget() function - default is the PC Speaker

*** Effects and Paramaters *** AbilityIncrease - nAbility , nModifyBy -- Abilities: Str=0, Dex=1, Con=2, Int=3, Wis=4, Cha=5 AbilityDecrease - nAbility, nModifyBy Blindness - no params Damage - nDamageAmount, nDamageType, nDamagePower -- Types: Bludgeon=1, acid=16, fire=256, etc.; Powers: Normal=0, PlusThree=3, etc. Death - no params Disease - nDiseaseType -- (0-16) see DISEASE_* constants in nwscript.nss Heal - nDamageToHeal Paralyze - no params Poison - nPoisonType -- (0-43) see POISON_* constants in nwscript.nss Raise - no params Visual - nVisualEffectId -- see visualeffects.2da for param options

Example 1: This action script will heal the PC Speaker 100hp in a conversation ga_effect ("Heal", "100", "", 0, "")

Example 2: This action script will permanently give the PC Speaker in a conversation increased strength (+2) ga_effect ("AbilityIncrease", "0,2", "P", 0, "")

*/

// ga_enable_scripts /* restores the saved event handlers */

9

// ga_end_game( string sEndMovie ) void main( string sEndMovie ) { EndGame( sEndMovie ); }

// ga_face_target(string sFacer, string sTarget, int bLockOrientation) /* This script commands sFacer to face sTarget.

Parameters: string sFacer = Tag of object that will do the facing. Default is OWNER string sTarget = Tag of object that sFacer will orient towards. int bLockOrientation = If =1, dialog manager will stop adjusting sFacer's facing for the active dialog. */

// ga_faction_join /* This script makes sTarget join a new faction. sTarget - The target who's faction will change (see Target's note). sTargetFaction - Either one of the 4 standard factions $COMMONER, $DEFENDER, $HOSTILE, $MERCHANT or a target who's faction is to be joined (must be a creature) */

// ga_faction_rep /* This script makes sTarget be viewed differently by a faction. sTarget - The target who will be viewed differently (see Target's note). sTargetFaction - Either one of the 4 standard factions $COMMONER, $DEFENDER, $HOSTILE, $MERCHANT or a target who belongs to the faction (may or may not need to be a creature) sChange - the amount to change the faction reputation by. (May later be ammended to allow setting).

*/

// ga_fade_from_black // // wrapper function for FadeToBlackParty() to fade all party members from black. If the screen // had previously faded into a specific color, FadeToBlackParty() will fade back from that color. // // fSpeed controls how quickly, in seconds, the screen will fade to black. Setting this to 0 will // result in an instant fade from black. Standard value is 1.0.

10 // // bColor allows users to specify what color the screen should fade back from. Basic colorlist: // 0 = black

// ga_fade_to_black // // wrapper function for FadeToBlackParty() to fade all party members to black. // // fSpeed controls how quickly, in seconds, the screen will fade to black. Setting this to 0 will // result in an instant fade to black. // // fFailsafe indicates the maximum lenght of time, in seconds, that the screen will remain black // before automatically fading back in. Leave at 0.0 to use the default value of 15 seconds.

// nColor allows users to specify what color the screen should fade into. Basic colorlist: // 0 = black, 16777215 = white. Hex Values for colors may be found in NWN2_Colors.2da, though // they must be converted to decimal form before use.

// ga_floating_str_ref /* Do floaty str ref text on PC speaker */

// ga_floating_text /* Do floaty text on PC speaker */

// ga_force_exit /* Wrapper for ForceExit, which makes a creature "exit" by moving it to a location and then removing it. Params: sCreatureTag - tag of the exiting creature sWPTag - tag of the waypoint (or object) to move to. bRun - 0 = walk; 1 = run

When the creature reaches the specified loaction he will be destroyed, or in the case of roster members, despawned. Note: This is inteded to always work, and will remove flags such as plot and not- destroyable from the creature before attempting to destroy it.

*/

// ga_gint_max

11 /* This script changes a global int variable's value

Parameters: string sVariable = Name of variable to change string sChange = VALUE (EFFECT) "5" (Set to 5) "=-2" (Set to -2) "+3" (Add 3) "+" (Add 1) "++" (Add 1) "-4" (Subtract 4) "-" (Subtract 1) "--" (Subtract 1) int iMin = Minimum Value int iRule = Special case rule if both the original value and the new calculated value are above the maximum, apply the following rule: 0 - make no change to the original value 1 - set to maximum value 2 - use least of either the original or the changed value. */

// ga_gint_min /* This script changes a global int variable's value

Parameters: string sVariable = Name of variable to change string sChange = VALUE (EFFECT) "5" (Set to 5) "=-2" (Set to -2) "+3" (Add 3) "+" (Add 1) "++" (Add 1) "-4" (Subtract 4) "-" (Subtract 1) "--" (Subtract 1) int iMin = Minimum Value int iRule = Special case rule if both the original value and the new calculated value are below the minimum, apply the following rule: 0 - make no change to the original value 1 - set to minimum value 2 - use larget of either the original or the changed value. */

// ga_give_feat /* This gives a feat to a creature, player or players. sTarg = The creature to give the feat to. If blank, assign to PC nFeat = The number of the feat. See nwscript.nss for a list of feats. bCheckReq = Check if the creature meets the feat's prerequisites before adding. bAllPCs = If set to 1 it gives the feat to all the PCs (MP only).

12 */

// ga_give_gold /* This gives the player some gold nGP = The amount of gold coins given to the PC nAllPCs = If set to 1 it gives gold to all the PCs (MP only) */

// ga_give_inventory /* This script takes items from sGiver's inventory and gives it to sReceiver.

Parameters: string sGiver = Tag of object giving items. Default is OWNER. string sReceiver = Tag of object receiving items. Default is PC. int iInventoryContents = Which items to donate: 0 = All inventory items, equipped items and gold. (Giver must be creature) 1 = All inventory items only. 2 = All equipped items only. (Giver must be creature) */

// ga_give_item( string sTemplate, int nQuantity, int bAllPCs ) /* Creates item on PC(s)

Parameters: string sTemplate = Item blueprint ResRef int nQuantity = Stack size for item (default: 1) int bAllPCs = If =1 create item on all player characters (MP) */

// ga_give_item_global_int /* This gives the player a number of items. The number is defined by a global int sItemRR = This is the string name of the item's ResRef sGlobalNum = The string of the global integer that contains the number of items to give nAllPCs = If set to 1 it gives the item to all PCs (MP only) */

// ga_give_partial_quest_xp // // Give everyone experience for completing a quest. The experience goes to // ALL PCs in the party. Distinguished from ga_give_quest_xp in that you can specify the percentage // of the quest experience you want to give out, so, say if you have a 4-part quest, you could // award 25% of the experience for completing each portion. There is a cap in place so you can't // accidentally award more than 100% overall.

13 // ga_give_quest_xp // // Give everyone experience for completing a quest. The experience goes to // ALL PCs in the party.

// ga_give_xp /* This gives the player some experience nXP = The amount of experience given to the PC nAllPCs = If set to 1 it gives XP to all the PCs (MP only) */

// ga_global_float /* This script changes a global float variable's value

Parameters: string sVariable = Name of variable to change string sChange = VALUE (EFFECT) "5.1" (Set to 5.1) "=-2.3" (Set to -2.3) "+3.0" (Add 3.0) "+" (Add 1.0) "++" (Add 1.0) "-4.9" (Subtract 4.9) "-" (Subtract 1.0) "--" (Subtract 1.0) */

// ga_global_int /* This script changes a global int variable's value

Parameters: string sVariable = Name of variable to change string sChange = VALUE (EFFECT) "5" (Set to 5) "=-2" (Set to -2) "+3" (Add 3) "+" (Add 1) "++" (Add 1) "-4" (Subtract 4) "-" (Subtract 1) "--" (Subtract 1) */

// ga_global_string /* This script changes a local string variable's value sScript = This is the name of the variable being changed sChange = This is what the local string is set to. */

14 // ga_heal_pc /* This command heals the PC (and potentially their party) nHealPercent = This is the % damage the PC will be healed, 0 = 100% by default nFullParty = This is a boolean, by default it is FALSE and only the PC will be healed, 1 is full party */ //:://///////////////////////////////////////////////////////////////////////// //:: //:: ga_henchman_add //:: //:: Adds a target creature to your party as a henchman (not a companion). //::

//:://///////////////////////////////////////////////////////////////////////// //:: //:: ga_henchman_remove //:: //:: Removes a target creature from your party (must be a henchman, not a companion). //::

//:://///////////////////////////////////////////////////////////////////////// //:: //:: ga_henchman_replace //:: //:: Repalces a target henchman from your party with another (henchmen are not companions). //:: //:://///////////////////////////////////////////////////////////////////////// //:: //:: ga_henchman_setmax //:: //:: Sets the maximum number of allowed Henchmen (henchmen are not companions). //::

// ga_journal(string sCategoryTag, int nEntryID, int bAllPartyMembers, int bAllPlayers, int bAllowOverrideHigher) /* Wrapper to add an entry to PCSpeaker's journal.

Parameters: string sCategoryTag = The tag of the Journal category (case sensitive). int nEntryID = The ID of the Journal entry. int bAllPartyMembers = If =1, the entry is added to the journal of all of oCreature's Party. (Default: =1) int bAllPlayers = If =1, the entry will show up in the journal of all PCs in the module. (Default: =0) int bAllowOverrideHigher = If =1, override restriction that nState must be > current Journal Entry. (Default: =0) */

15 // ga_jump(string sDestination, string sTarget, float fDelay) /* Jump an object to a waypoint or another object.

Parameters: string sDestination = Tag of waypoint or object to jump to. string sTarget = Tag of object to jump. Default is OWNER float fDelay = Delay before JumpToObject() */

// ga_jump_faction(string sTagOfMember, string sTagOfWayPoint, int iFormation, string sFormationParams) /* Jump faction into formation at sTagOfWayPoint.

Parameters: string sTagOfMember = Tag of member in faction to jump. string sTagOfWayPoint = Tag of waypoint. int iFormation = DOES NOTHING. string sFormationParams = DOES NOTHING. */

// ga_jump_players(string sDestTag, int bWholeParty, int bOnlyThisArea) /* Jumps the PC party to a waypoint or object.

Parameters: string sDestTag = Tag of waypoint or object to jump to. int bWholeParty = DOES NOTHING IN CAMPAIGN. If =0 then jump the PC only, else jump the PC's party. int bOnlyThisArea = DOES NOTHING */

// ga_load_mod // // Loads a module, including any data that may have been affected by the player during previous // visits. (As opposed to ga_start_mod, which gives you a brand-new copy of the module.)

// sModule is the filename of the module, minus the .mod extension. // sWaypoint is the tag of the waypoint from which the player will begin the module. // If no waypoint is supplied, the module's default start location is used instead.

// ga_local_float(string sVariable, string, sChange,

16 string sTarget ) /* This script changes a local float variable's value

Parameters: string sVariable = Name of variable to change string sChange = VALUE (EFFECT) "5.1" (Set to 5.1) "=-2.3" (Set to -2.3) "+3.0" (Add 3.0) "+" (Add 1.0) "++" (Add 1.0) "-4.9" (Subtract 4.9) "-" (Subtract 1.0) "--" (Subtract 1.0) string sTarget = Target tag or identifier. If blank then use OBJECT_SELF */

// ga_local_int(string sVariable, string sChange, string sTarget) /* This script changes a local int variable's value

Parameters: string sVariable = Name of variable to change string sChange = VALUE (EFFECT) "5" (Set to 5) "=-2" (Set to -2) "+3" (Add 3) "+" (Add 1) "++" (Add 1) "-4" (Subtract 4) "-" (Subtract 1) "--" (Subtract 1) string sTarget = Target tag or identifier. If blank then use OBJECT_SELF */

// ga_local_string(string sVariable, string sValue, string sTarget) /* This script changes a Target's local string variable's value.

Parameters: string sVariable = The name of the variable. string sValue = The new value for the variable. string sTarget = The target's tag or identifier, if blank use OWNER */ //:://///////////////////////////////////////////////////////////////////////// //:: //:: ga_lock.nss //:: //:: Change the lock status of a door. If bLock is false, the door will //:: be unlocked. //::

17

// ga_move /* This moves someone to a waypoint. sWP = Lists the waypoint the object is moving to. nRun = Defaults to walk, set to 1 for running sTagOverride = If this is null, then OWNER runs the script. Otherwise the string is the tag name of who will run it */

// ga_move_exit /* This makes the object go to the exit (default nwc_exit) and then vanish nExitNumber = nwc_exit#N nRun = TRUE if you want the character to run there sWaypoint = go to waypoint nwc_#S then disappear sObject = if you don't want the OWNER to move, use the tag string here */

// ga_music_play /* Play battle music in current area */

// ga_music_battle_restore /* Restore background music in current area. Restore with ga_music_restore. */

// ga_music_battle_save /* Save background music in current area. Restore with ga_music_restore. */

// ga_music_battle_set /* Set battle music in current area to track nTrack

As of 8/23/06, this was the track indexing. The latest can be found in ambientmusic.2da.

0. NO MUSIC

From NWN1: ------1. rural day 2. rural day 2 3. rural night 4. forest day 5. forest day 2

18 6. forest night 7. generic dungeon 1 8. sewer 9. mines 1 10. mines 2 11. crypt 1 12. crypt 2 13. evil dungeon 1 14. evil dungeon 2 15. slums day 16. slums night 17. docks day 18. docks night 19. city wealthy 20. city market 21. city night 22. tavern 1 23. tavern 2 24. tavern 3 25. rich house 26. store 27. good temple 28. temple evil 29. nwn1 theme 30. nwn chapter 1 theme 31. nwn chapter 2 theme 32. nwn chapter 3 theme 33. nwn chapter 4 theme 34. rural battle 1 35. forest battle 1 36. forest battle 2 37. dungeon battle 1 38. dungeon battle 2 39. dungeon battle 3 (stinger) 40. city battle 1 41. city battle 2 42. city battle 3 43. city boss battle 44. forest boss battle 45. lizard boss battle 46. dragon boss battle 47. aribeth boss battle 48. end boss battle 49. good temple 2 50. castle 51. aribeth good theme 52. aribeth evil theme 53. arren gend theme 54. maugrim theme 55. morag theme 56. tavern 4

From NWN1 Expansion 1 ------57. desert battle 58. desert day 59. winter day

19 60. winter battle 61. desert night

From NWN1 Expansion 2 ------62. x2 Theme 63. waterdeep theme 64. undermountain theme 65. rebel camp 66. fire plane 67. queen (?) theme 68. frozen hell 69. dracolich 70. small battle 71. medium battle 72. large battle 73. hell battle 74. boss battle 1 75. boss battle 2

From NWN2 ------95. west harbor theme 96. githyanki theme 97. githyanki battle 98. west harbor blown up 99. swamp 100. docks battle 101. docks battle looped 102. dungeon 103. neverwinter theme 104. neverwinter interior 105. west harbor attack 106. back alley 107. king of shadows combat 108. king of shadows theme 109. village 110. sunken flagon 111. crossroad keep theme 112. illefarn ruins theme 113. murder 114. ammon jerro theme 115. back alley battle

*/

// ga_music_battle_stop /* Stop battle music in current area */

// ga_music_play /* Play background music in current area

20 */

// ga_music_restore /* restore background music in current area */

// ga_music_save /* Save background music in current area. Restore with ga_music_restore. */

// ga_music_set /* Set background music in current area to track nTrack

nTime will have the following effects:

nTime = 0: Change both Day and Night tracks nTime = 1: Change Day track only nTime = 2: Change Night track only

As of 8/23/06, this was the track indexing. The latest can be found in ambientmusic.2da.

0. NO MUSIC

From NWN1: ------1. rural day 2. rural day 2 3. rural night 4. forest day 5. forest day 2 6. forest night 7. generic dungeon 1 8. sewer 9. mines 1 10. mines 2 11. crypt 1 12. crypt 2 13. evil dungeon 1 14. evil dungeon 2 15. slums day 16. slums night 17. docks day 18. docks night 19. city wealthy 20. city market 21. city night 22. tavern 1 23. tavern 2 24. tavern 3 25. rich house

21 26. store 27. good temple 28. temple evil 29. nwn1 theme 30. nwn chapter 1 theme 31. nwn chapter 2 theme 32. nwn chapter 3 theme 33. nwn chapter 4 theme 34. rural battle 1 35. forest battle 1 36. forest battle 2 37. dungeon battle 1 38. dungeon battle 2 39. dungeon battle 3 (stinger) 40. city battle 1 41. city battle 2 42. city battle 3 43. city boss battle 44. forest boss battle 45. lizard boss battle 46. dragon boss battle 47. aribeth boss battle 48. end boss battle 49. good temple 2 50. castle 51. aribeth good theme 52. aribeth evil theme 53. arren gend theme 54. maugrim theme 55. morag theme 56. tavern 4

From NWN1 Expansion 1 ------57. desert battle 58. desert day 59. winter day 60. winter battle 61. desert night

From NWN1 Expansion 2 ------62. x2 Theme 63. waterdeep theme 64. undermountain theme 65. rebel camp 66. fire plane 67. queen (?) theme 68. frozen hell 69. dracolich 70. small battle 71. medium battle 72. large battle 73. hell battle 74. boss battle 1 75. boss battle 2

22 From NWN2 ------95. west harbor theme 96. githyanki theme 97. githyanki battle 98. west harbor blown up 99. swamp 100. docks battle 101. docks battle looped 102. dungeon 103. neverwinter theme 104. neverwinter interior 105. west harbor attack 106. back alley 107. king of shadows combat 108. king of shadows theme 109. village 110. sunken flagon 111. crossroad keep theme 112. illefarn ruins theme 113. murder 114. ammon jerro theme 115. back alley battle

*/

// ga_music_stop /* Stop background music in current area */

// ga_object_events_clear /* saves off the event handlers as local vars and clears the event handlers for the object can't be used on areas or modules */

// ga_object_events_restore /* restore saved off event handlers from local vars and clear the local vars can't be used on areas or modules */

// ga_open_store /* Opens store with tag sTag for the PC Speaker. nMarkUp/nMarkDown are a percentage value that modifies the base price for an item. Function also adds or subtracts numbers to the markup and markdown values depending on the result of the appraise skill check. */

23 //:://///////////////////////////////////////////////////////////////////////// //:: //:: ga_party_add.nss //:: //:: Attempt to add Roster Member to the PC's party. Fails if Roster Member //:: is already a member of a party, or if party size limit has been reached. //::

// ga_party_face_target(string sFacer, string sTarget, int bLockOrientation) /* This script commands the party to face sTarget.

Parameters: string sFactionMember = the tag of any member of the party faction will do. Can also be a GetTarget() constant. string sTarget = Tag of object that the party will orient towards. int bLockOrientation = If =1, dialog manager will stop adjusting sFacer's facing for the active dialog. */

// ga_party_freeze() /* Freeze PC party for cutscene. Temporarily save NW_ASC_MODE_STAND_GROUND state. Use ga_party_unfreeze() to restore NW_ASC_MODE_STAND_GROUND state. */ //:://///////////////////////////////////////////////////////////////////////// //:: //:: ga_party_size.nss //:: //:: Set number of Roster NPC slots available in the Party Selection GUI //::

// ga_party_unfreeze() /* Unfreeze PC party at end of cutscene. Restore NW_ASC_MODE_STAND_GROUND state. Use ga_party_freeze() to save NW_ASC_MODE_STAND_GROUND state. */

// ga_play_sound // // Play sound file sSound on object with tag sTarget. // Note: Advise using this on creatures only. //:://///////////////////////////////////////////////////////////////////////// //:: //:: ga_play_voice_chat( int nVoiceChat, string sTag ) //:: //:: This is basically just a wrapper for PlayVoiceChat.

24

// ga_reequip_all_items /* re-equips all "remembered" items. */

// ga_remember_equipped /* This script marks the equipped items so that they can later be restored.

Parameters: string sCreature = Tag of object giving items. Default is PC. (Must be creature) */

// ga_remove_comp(string sHenchmanTag) /* This script removes a henchman from the party.

Parameters: string sTarget = Tag of the henchman to remove. If blank, remove dialog OWNER. If NPC is not a henchman of the PC, do nothing. */

// ga_remove_feat /* This removes a feat from a creature, player or players. sTarg = The creature to remove the feat from. If blank, remove from PC nFeat = The number of the feat. See nwscript.nss for a list of feats. bAllPCs = If set to 1 it removes the feat to from the PCs (MP only). */

// ga_replace_comp(string sCompToRemove, string sCompToAdd) // // replace companion with tag sCompToRemove with companion with tag sCompToAdd

// ga_reputation /* This adjusts the reputation of the calling player nActLevel = How noble or ignoble was the act from +4 (Idolized) to -4 (Vilified) nRepOver = This overides the reputation to the given value (DANGER!) */

// ga_reset_level( string sCreature, int bUseXPMods ) /* Resets creature to PCs average experience level using its current level-up package. Creature is also force rested ( full heal, spells refreshed ).

Parameters: string sCreature = Tag of creature

25 int bUseXPMods = If TRUE, XP modifiers will be applied before the experience is awarded */

// ga_reset_level_by_xp( string sCreature, int nXP, int bUseXPMods ) /* Resets creature to level 0, awards nXP experience and auto-levels to the highest level allowed based on its current level-up package.

Parameters: string sCreature = Tag of creature int nXP = Experience to award int bUseXPMods = If TRUE, XP modifiers will be applied before the experience is awarded */

// ga_restore_equipped /* This script restores the equipped items that were previously marked with ga_remember_equipped.

Parameters: string sCreature = Tag of object giving items. Default is PC. (Must be creature) */

// ga_roster_campaignnpc /* //RWT-OEI 09/29/05 //This function flags a Roster Member as being a Campaign NPC //Campaign NPCs are NPCs that are saved to the roster to make them //persist across modules, but will not appear on the Roster Member //Select Screen on clients as NPCs available for adding to the party. //Note that scripts can still add and remove Campaign NPCs to the party, //but the client will never be able to add them via the UI //Returns false if it was unable to find the Roster Member to set them //as a campaign NPC */

// ga_roster_despawn_all( int bExcludeParty ) /* Despawn all roster members, option to exclude members in PC party */

26 // ga_roster_party_remove_all( int bDespawnNPC, int bIgnoreSelectable ) /* Remove all selectable roster members from oPC's party

Parameters: int bDespawnNPC = If 1, despawn after removing from party int bIgnoreSelectable = If 1, also remove non-Selectable roster members */

// ga_roster_selectable /*

//RWT-OEI 09/14/05 //Sets the roster member as being selectable or not. Roster members //that are not selectable cannot be changed via the Party Selection //GUI on the client side, but can still be added/removed from a //party via script. Note that if a roster member is set as non-selectable //while they are currently in a party, they will remain in the party //and cannot be removed via the Party Selection GUI. //Returns FALSE if it was unable to locate the roster member int SetIsRosterMemberSelectable( string sRosterName, int bSelectable ); */

// ga_scripthidden // // Show or Hide an NPC, using its ScriptHiddenProperty. // // sTag is the tag of the object to hide. The script will affect the nearest object of that tag. // If there is none in the current area, it will affect whatever's returned by GetObjectByTag().

// ga_set_animation_condition(int nFlag, int bState, string sTarget) /*

Sets Animation Condition flag. See below for list of flags. Some flags should probably not be altered by this script.

*/

// ga_set_associate_state(int nFlag, int bState, string sTarget) /*

Sets Associate State flag. See below for list of flags. Some flags should probably not be altered by this script.

27

*/

// ga_set_gflag /* Set GlobalFlagName as a global int w/ value 1. */

// ga_set_wwp_controller /* Changes the waypoint set specified creature will walk. This overrides whatever the creature's tag is. sWalkWayPointsTag is the tag of the creature the waypoints are designed for, i.e. no prefix or suffix Note that walkwaypoints is interrupted by being in a conversation. Creature must use a script set that supports WWP to work long-term. */

// ga_setbumpstate

// Set the bumpable flag for sTarget.

// ga_setimmortal(string sTarget, int bImmortal) /* SetImmortal on target creature to bImmortal.

Parameters: string sTarget = tag of target creature, if blank use OWNER int bImmortal = 0 for FALSE, else for TRUE */

// ga_setplotflag(string sTarget, int bPlotFlag) /* SetPlotFlag on target object to bPlotFlag.

Parameters: string sTarget = tag of target object, if blank use OWNER int bPlotFlag = 0 for FALSE, else for TRUE */

// ga_setrecipes /* sets up all the recipes for creating magic items this can be run at any time prior to a PC using them in game. (module load might be good)

Reference Info: see lexicon for constants: Home > Reference > Constants > SPELL_* Home > Reference > Constants > ITEM_PROPERTY_* specific constants available for most item properties:

28 Home > Reference > Constants > IP_CONST_ABILITY_* ... IP_CONST_WEIGHTINCREASE_* */

// ga_sound_object_play(string sTarget) /* plays a sound object, which may comprise many sound resources

Parameters: string sTarget = tag of the sound object

*/

// ga_sound_object_set_position(string sTarget, string sPositionTag, float fXoffset, float fYoffset, float fZoffset) /* Sets the position of a sound object. Sound Object will play at the tag of the object specified. A vector offset can be specified to fine tune the placement. A vector offset can be set relative to the origin of the area by leaving sPositionTag blank.

Parameters: string sTarget = tag of the sound object string sPositionTag = tag of an object to use as the position. not required. float fXoffset, float fYoffset, float fZoffset = vector offest to the sPositionTag. */

// ga_sound_object_set_volume(string sTarget, int iVolume) /* Sets the volume of a placed sound object

Parameters: string sTarget = tag of the sound object int iVolue = An integer value between 0 and 127 */

// ga_sound_object_stop(string sTarget) /* Stops a sound object from playing

Parameters: string sTarget = tag of the sound object

*/

// ga_start_convo /* This script starts a new conversation. Handy when you want to jump directly from one conversation to another.

29 Parameters: string sTarget = Target who will start convo with the PC string sConversation = Params are all from ActionStartConversation() int bPrivateConversation int bPlayHello int bIgnoreStartDistance int bDisableCutsceneBars */

// ga_start_mod(string sModuleName) /* Starts a new module

Parameters: string sModuleName = The file name of the module to start.

Act 1 Modules: 1000_Neverwinter_A1 1100_West_Harbor 1200_Highcliff 1300_Old_Owl_Well 1400_Neverwinter_Wood 1600_Githyanki_Caves */

// ga_take_gold /* This takes gold from a player nGold = The amount of gold to take nAllPCs = If set to 1 it takes gold from all PCs (MP only) */

// ga_take_item /* This takes an item from a player sItemTag = This is the string name of the item's tag nQuantity = The number of items (default is 1). -1 is all of the Player's items of that tag. nAllPCs = If set to 1 it gives the item to all PCs (MP only) */

// ga_talkto(string sTarget) /* Set "TalkedTo" flag that you have talked to the target.

Parameters: string sTarget = Tag of the NPC. If blank, use OBJECT_SELF. */

// ga_time_advance /* Advance time by amount indicated

Time can only be advanced forwards; attempting to set the time backwards will result in the day advancing and

30 then the time being set to that specified.

nHour - The number of hours to advance. nMinute - The number of Minutes to advance. nSecond - The number of Seconds to advance. nMillisecond - The number of Milliseconds to advance. */

// ga_time_set /* Set time to to value indicated.

Time can only be advanced forwards; attempting to set the time backwards will result in the day advancing and then the time being set to that specified.

nHour - The new hour value, from 0 to 23. nMinute - The new minute value from 0 to 1 (or 0 to a higher value if the module properties for time were changed). nSecond - The new second value, from 0 to 59. nMillisecond - The new millisecond value, from 0 to 999.

*/// ga_unequip_hands /* unequip hands, and mark items so they can be restored

31 Global Artificial Intellegence

// gb_attack_caster_ai // // Attack casters first. Then ranged. Then melee.

// gb_attack_melee_ai // // Attack melee first, then casters, then ranged.

//:: gai_blockedcount_b //:: //:: Tallies how many times we've been blocked.

//:: gai_counterspell_dcr //:: //:: Determine Combat Round for the Spell Queue AI. //:: //:: Spell Queue AI's will cast spells form an ordered list attached to them. //:: To Attach a list, use the function ******, the conversation script ******, //:: or manually using these variables (must be done pre-spawn) *******.

//:: gai_damagetracker_b //:: //:: Tracks those who have hurt me, much like my lists of names from high school. //:: from ginc_ai, used by the "attack who damaged me most" AI type

//:: gai_finitepursuit_dcr //:: //:: Determine Combat Round for the Finite "Break-Off" Pursuit AI. //:: //:: Spell Queue AI's will cast spells form an ordered list attached to them. //:: To Attach a list, use the function ******, the conversation script ******, //:: or manually using these variables (must be done pre-spawn) *******.

//:: gai_ignore_dcr //:: //:: Determine Combat Round for the Spell Queue AI. //:: //:: Spell Queue AI's will cast spells form an ordered list attached to them. //:: To Attach a list, use the function ******, the conversation script ******, //:: or manually using these variables (must be done pre-spawn) *******.

32

//:: gai_preference_dcr //:: //:: Determine Combat Round for the Class Priority AI. //:: //:: Spell Queue AI's will cast spells form an ordered list attached to them. //:: To Attach a list, use the function ******, the conversation script ******, //:: or manually using these variables (must be done pre-spawn) *******.

//:: gai_template_finitepursuit //:: //:: Used to ensure a creature will not stray far because of combat.

//:: gai_template_groupattack //:: //:: Has the members of a group all attack one enemy at a time.

//:: gai_template_mostdamagedby //:: //:: Attack whomever has dealt the most damage to me.

//:: gai_template_protector //:: //:: I follow a guy around and hurt people who try to harm him.

//:: gai_template_runnningalarm //:: //:: A "Call for reinforcements" guy, this creature will run for help and use silent shouts to attract help.

//:: gai_runningalarm_dcr //:: //:: Determine Combat Round for the Running Alarm AI. //:: //:: Spell Queue AI's will cast spells form an ordered list attached to them. //:: To Attach a list, use the function ******, the conversation script ******, //:: or manually using these variables (must be done pre-spawn) *******.

//:: gai_template_spellqueue //:: //:: Used to Set up a spell queue on a creature.

//:: gai_damagetracker_b //:: //:: Tracks those who have hurt me, much like my lists of names from high school. //:: from ginc_ai, used by the "attack who damaged me most" AI type

33 //:: gai_template_aipref //:: //:: I prefer to attack creatures with certain AI's over other creatures.

//:: gai_template_classpriority //:: //:: Has a creature prefer to attack weaker characters of the ones that are nearby. //:: gai_template_attackweakest //:: //:: Has a creature attack the weakest character nearby.

//:: gai_template_classpriority //:: //:: Used to Tell a creature to fight certain classes before others.

//:: gai_template_counterspell //:: //:: A loveable, portable anti-mage. Full of counterspells and debuff's

//:: gai_template_coward //:: //:: I am a frightened, frightened little boy.

//:: gai_template_damageswitch //:: //:: SpawnScript that will alter a creature's behavior based on how hurt they are.

//:: gai_template_defensivetank //:: //:: Try my best to take the brunt of the damage for friendlies. Also, healing, evade, parry.

//:: gai_template_donothing //:: //:: Do nothing during combat.

//:: gai_template_fightnrun //:: //:: Attack! When I'm low on health, Run away! If close to death, Attack again!

34 Global Being (Creature)

// gb_comp_attack.nss /* Companion OnAttacked handler

Based off Associate OnAttacked (NW_CH_AC5) */

// gb_comp_block /* companion On Block */

// gb_comp_combat.nss /* Companion OnEndCombatRound handler

Based off Associate End of Combat End (NW_CH_AC3) */

// gb_comp_conv.nss /* Companion OnConversation handler Based on henchmen/associate OnDialogue handler (X0_CH_HEN_CONV) */

// gb_comp_damage.nss /* Companion OnDamaged handler

Based off Associate OnDamaged (NW_CH_AC6) */

// gb_comp_death /* OnDeath handler to queue KnockOut script for companions */

// gb_comp_distrb /* companion On Disturbed */

// gb_comp_heart /* companion heartbeat */// ginc_companions.nss

// gb_comp_percep.nss

35 /* Companion OnPerception handler

Based off Associate OnDamaged (X0_CH_HEN_PERCEP) */

// gb_comp_rest /* companion On Rest */

// gb_comp_spawn /* companion On Spawn */

// gb_comp_spell.nss /* Companion OnSpellCastAt handler

Based off Henchmen On Spell Cast At (NW_CH_ACB) */

// gb_comp_userdef /* companion On User Defined */

// gb_dm_co /* Default OnConversation event handler for NPCs. // gb_dm_sp //::////////////////////////////////////////////////// //:: NW_C2_DEFAULT9 /* * Default OnSpawn handler with XP1 revisions. * This corresponds to and produces the same results * as the default OnSpawn handler in the OC. * * This can be used to customize creature behavior in three main ways: * * - Uncomment the existing lines of code to activate certain * common desired behaviors from the moment when the creature * spawns in. * * - Uncomment the user-defined event signals to cause the * creature to fire events that you can then handle with * a custom OnUserDefined event handler script. * * - Add new code _at the end_ to alter the initial * behavior in a more customized way. */

36

// gb_do_nothing /* creature do-nothing script */

// gb_endcmbt_sp /* Standard spawn script that fires User Defined Event 1003 in the OnCombatRoundEnd */

// gb_follow_hb /* creature will follow another creature stored as local obj "Leader"

*/

// gb_heartbeat_sp /* standard spawn script that fires User Defined Event 1001 in the OnHeartbeat */

// gb_player_ud /* user defined events template */

// gb_ranged_sp // // Set the creature's ranged combat flag

// EPF 1/26/06 //::////////////////////////////////////////////////// //:: NW_C2_DEFAULT9 /* * Default OnSpawn handler with XP1 revisions. * This corresponds to and produces the same results * as the default OnSpawn handler in the OC. * * This can be used to customize creature behavior in three main ways: * * - Uncomment the existing lines of code to activate certain * common desired behaviors from the moment when the creature * spawns in. * * - Uncomment the user-defined event signals to cause the * creature to fire events that you can then handle with * a custom OnUserDefined event handler script. * * - Add new code _at the end_ to alter the initial * behavior in a more customized way. */

37

// gb_spawn_dead_sp /* This spawns in a creature dead */

// gb_stealthy_sp

// Sets a character's stealthy combat flag.

// EPF 1/26/06 //::////////////////////////////////////////////////// //:: NW_C2_DEFAULT9 /* * Default OnSpawn handler with XP1 revisions. * This corresponds to and produces the same results * as the default OnSpawn handler in the OC. * * This can be used to customize creature behavior in three main ways: * * - Uncomment the existing lines of code to activate certain * common desired behaviors from the moment when the creature * spawns in. * * - Uncomment the user-defined event signals to cause the * creature to fire events that you can then handle with * a custom OnUserDefined event handler script. * * - Add new code _at the end_ to alter the initial * behavior in a more customized way. */

// gb_surrender_sp

//::////////////////////////////////////////////////// //:: NW_C2_DEFAULT9 /* * Default OnSpawn handler with XP1 revisions. * This corresponds to and produces the same results * as the default OnSpawn handler in the OC. * * This can be used to customize creature behavior in three main ways: * * - Uncomment the existing lines of code to activate certain * common desired behaviors from the moment when the creature * spawns in. * * - Uncomment the user-defined event signals to cause the * creature to fire events that you can then handle with * a custom OnUserDefined event handler script. * * - Add new code _at the end_ to alter the initial

38 * behavior in a more customized way. */

// gb_wanderer_sp /* Standard spawn script that causes creature to use mobile ambient animations. */

39 Global Conditional

// gc_align_chaotic.nss /* Check if player's alignment is Chaotic */

// gc_align_evil.nss /* Check if player's alignment is Evil */

// gc_align_good.nss /* Check if player's alignment is Good */

// gc_align_lawful.nss /* Check if player's alignment is Lawful */

// gc_alignment /* This checks if player's alignment is greater than or equal to nCheck.

Parameters: int nCheck = Checks if alignment of player is greater than defines. On a scale of 3 (Saintly) to -3 (Fiendish) Or equivalently, 3 (Really, really lawful), to -3 (incredibly chaotic)

So the standard "Is the PC good?" check would use a value of 0 for nCheck. Same for "Is the PC evil," but you'd use a NOT with this script call -- as in "Is the PC NOT good?"

int bLawChaosAxis = 0 means check Good/Evil axis, 1 means check Law/Chaos axis */

// gc_area // // True if creature with tag sTarget is in area with tag sArea. Can use parameter constants like $OBJECT_SELF as defined in ginc_param_const. // Empty string for sTarget defaults to OBJECT_SELF.

// gc_background // // Check background trait for the PC. Background constants are as follows:

// BACKGROUND_NONE = 0; // BACKGROUND_BULLY = 1;

40 // BACKGROUND_COMPLEX = 2; // BACKGROUND_DEVOUT = 3; // BACKGROUND_FARMER = 4; // BACKGROUND_LADYSMAN = 5; // BACKGROUND_THEFLIRT = 6; // BACKGROUND_MILITIA = 7; // BACKGROUND_NATURALLEADER = 8; // BACKGROUND_TALETELLER = 9; // BACKGROUND_TROUBLEMAKER = 10; // BACKGROUND_WILDCHILD = 11; // BACKGROUND_WIZARDSAPPRENTICE = 12;

// gc_check_class(int nClass) /* This script checks to see if the player (PC_Speaker) has any levels of a certain class nClass = The integer of which class to check for (list boxes will be done later) */

// gc_check_class_level /* This script checks to see if the player (PC_Speaker) has at least X levels of a certain class nClass = The integer of which class to check for (list boxes will be done later) */

// gc_check_classpr /* This script checks to see if the player (PC_Speaker) has any levels of a certain prestige class nClass = The integer of which class to check for (list boxes will be done later) */

// gc_check_cls_lvl (int nClass, int nLevel) /* This script checks to see if the player (PC_Speaker) has a specific number of levels of a certain class nClass = The integer of which class to check for (list boxes will be done later) nLevel = The integer of how many levels or greater the character must have. */

// gc_check_gold /* This script checks to see if the PC has more than a certain amount of gold nGold = The amount of gold you want to make sure the player has nMP = If in MP - set this to 1 if you want to make sure all players have enough gold */

41 // gc_check_item /* This script checks to see if the PC has an item in their inventory sItem = The tag name you want to check to see if the PC has bCheckParty = TRUE if you want to check the entire party for possession of the item */

// gc_check_level /* This script checks to see if the PC's level is equal to or greater than a value nLevel = The tag name you want to check to see if the PC has nMP = If in MP - set this to 1 if you want to make sure all players are the appropriate level */

// gc_check_quest /* This script checks the quest states for a PC sQuest = This is the quest number that will be checked. "<" and ">" can be used. nMP = If in MP - set this to 1 if you want to make sure all players meet the quest test. */

// gc_check_race // /* TRUE if creature with tag sTarget is of race sRace. Here are the options for sRace: aberration animal beast construct dragon dwarf elemental fey goblinoid giant gnome halfelf halforc human humanoid (encompasses goblinoid, monstrous, , reptilian) magical_beast monstrous orc ooze outsider

42 reptilian shapechanger undead vermin */

// gc_check_race_pc // // returns TRUE if the PC speaker's race corresponds with the race specified. // race can be specified in two ways: by number or by string. The number // is still entered as a string, sRace.

// Here are the arguments you can use: // // sRace Alternative // ------// dwarf 1 // elf 2 // gnome 3 // halfelf 4 // halfling 5 // halforc 6 // human 7 // outsider 8 // // so gc_check_race_pc("dwarf") and gc_check_race_pc("1") will do the same thing.

// You can also check subraces using this function: // (Note: Shield Dwarves, Moon Elves, Lightfoot , and Rock Gnomes are the common varieties of their // respective races.) // (Note: half-elf, half-orc, and human are considered both races and subraces. The subrace versions should // be prepended with "sr-" as written below, if you intend to check subrace rather than the race.) // // sRace Alternative // ------// shielddwarf 11 // moonelf 12 // rockgnome 13 // sr-halfelf 14 // lightfoothalf 15 // sr-halforc 16 // sr-human 17 // golddwarf 18 // duergar 19 // 20 // sunelf 21 // woodelf 23 // svirfneblin 24 // stronghearthalf 26 // aasimar 27 // 28

43 // civdwarves 41 -- this is all dwarf subraces, save duergar. // civelves 42 -- all elf subraces, save drow and wild. // civhalflings 43 -- all halfling subraces, save ghostwise // // // EPF 6/16/05 // // NOTE: Only subraces supported in NWN2 are implemented here. I just thought I'd leave space for the others in // the event we add them for expansions.

// gc_check_stats /* This script checks to see if the player (PC_Speaker) has stats above a certain number nStat = The integer of which stat to check for (list boxes will be done later) nVal = The value the stat needs to equal or exceed */

// gc_comp_remove // // returns TRUE if the companion with tag sCompanion is both in the party and can be removed at this point.

// gc_dead // // Returns true if sCreatureTag is no longer amongst the living (or unliving)

// gc_distance(string sTagA, string sTagB, string sCheck) /* This script compares the distance between objects A and B against sCheck.

Parameters: string sTagA = Tag of object A. If blank, use OWNER. string sTagB = Tag of object B. string sCheck = Conditional to compare distance(A,B) to. "<3.0" - distance < 3.0m "=10.0" - distance == 10.0m "!4.0" - distance != 4.0m */

// gc_distance_pc(string sTag, string sCheck) /* This script compares the distance between sTag and the nearest PC against sCheck.

Parameters: string sTag = Tag of object. If blank, use OWNER. string sCheck = Conditional to compare distance(object,PC) to.

44 "<3.0" - distance < 3.0m "=10.0" - distance == 10.0m "!4.0" - distance != 4.0m */

// gc_equipped(string sItem, string sTarget, int bExactMatch) /* Check to see if a given item is equipped by a given creature

Parameters: string sItem = The tag, or partial tag of the item. string sTarget = The tag of the creature. If blank, use PCSpeaker. "$PARTY" is a non-standard target constant that will check the entire party. int bExactMatch = If 0, allow sItem to be a tag substring. */

45

// gc_global_float /* This script checks a local float variable's value sVariable = This is the name of the variable being changed sCheck = This is what you want to see what the local string is set to. Default is an = check, but you can also specify <,>,or ! So an sCheck of "<50" returns TRUE if sVariable is less than 50, an sCheck of "9" or "=9" returns TRUE if sVariable is equal to 9 and an sCheck of "!0" returns TRUE if sVariable is not equal to 0. */

// gc_global_int /* This script checks a local int variable's value sVariable = This is the name of the variable being changed sCheck = This is what you want to see what the local string is set to. Default is an = check, but you can also specify <,>,or ! So an sCheck of "<50" returns TRUE if sVariable is less than 50, an sCheck of "9" or "=9" returns TRUE if sVariable is equal to 9 and an sCheck of "!0" returns TRUE if sVariable is not equal to 0. */

// gc_global_string /* This script checks a local string variable's value sVariable = This is the name of the variable being changed sCheck = This is what you want to see what the local string is set to */

// gc_has_feat /* This checks if the creature or player has a given feat sTarg = The creature to check for the feat. If blank, check the PC Speaker nFeat = The number of the feat. See nwscript.nss for a list of feats. bIgnoreUses= Only check if the player has the feat itself, not uses left of the feat */

// gc_is_enemy_near(float fRadius, int bLineOfSight) /* This script checks if an enemy creature is within a given radius from the PC Speaker.

Parameters:

46 float fRadius = The radius of the sphere to check within. int bLineOfSight = If =1 check line of sight from PC. */

// gc_is_female /* This checks to see if the PC Speaker is female, returns TRUE if it's a girl */

// gc_is_in_combat // // Returns true if sTarget is in combat

// gc_is_in_party(string sTarget) /* Check if target henchman is in the party.

Parameters: string sTarget = Tag of the henchman to check. If empty, use dialog OWNER. */

// gc_is_male /* This checks to see if the PC Speaker is male, returns TRUE if it's a boy */

// gc_is_near(string sTag, string sObjTypes, float fRadius, int bLineOfSight) /* This script checks if any object within fRadius radius to the OWNER contains the partial tag sTag.

Parameters: string sTag = The tag or partial tag to match to objects nearby. e.g. "guard" will match "guard1", "guard2", "blackguard" string sObjTypes = Filter which types of objects to compare to. C = creature I = item T = trigger D = door A = area of effect W = waypoint P = placeable S = store E = encounter ALL = everything e.g. "CPI" will search only creatures, placeables, and items float fRadius = Radius of sphere to check within. e.g. "20.0f"

47 = 20 meters int bLineOfSight = If =1 check line of sight from OWNER. */

// gc_is_owner /* This script checks if the owner of the dialogue is the given tag sTag = This is the tag of the object you are checking for */

// gc_is_skill_higher /* Checks the speaker's skills. If Skill A is greater than or equal to than Skill B, returns TRUE. Otherwise returns false.

if bStrictlyGreaterThan = 1, then we will only return 1 in the case where Skill A is greater than Skill B, and not when they are equal.

skill ints 0 APPRAISE 1 BLUFF 2 CONCENTRATION 3 CRAFT ALCHEMY 4 CRAFT ARMOR 5 CRAFT WEAPON 6 DIPLOMACY 7 DISABLE DEVICE 8 DISCIPLINE 9 HEAL 10 HIDE 11 INTIMIDATE 12 LISTEN 13 LORE 14 MOVE SILENTLY 15 OPEN LOCK 16 PARRY 17 PERFORM 18 RIDE 19 SEARCH 20 CRAFT TRAP 21 SLEIGHT OF HAND 22 SPELL CRAFT 23 SPOT 24 SURVIVAL 25 TAUNT 26 TUMBLE 27 USE MAGIC DEVICE */

// gc_item_count(string sItemTag, string sCheck, int bPCOnly)

48 /* Compares the number of items with tag sItemTag the speaker/party possesses to condition sCheck.

Parameters: string sItemTag = Tag of the item to count. string sCheck = Condition and value to check, for example: "<5" Less than 5 ">1" Greater than 1 "=9" Equal to 9 "!0" Not equal to 0 int bPCOnly = If =0 then check party's inventory, else check speaker inventory only */

// gc_journal_entry /* This script compares the state of specified journal quest to a check value. sQuestTag - tag of the quest to examine on the PC sCheck - conditional to check against. This param works the same as it does in gc_local_int. */

// gc_local_float(string sVariable, string sCheck, string sTarget) /* This script checks a local float variable's value.

Parameters: string sVariable = This is the name of the variable. string sCheck = This is the operation to compare local float to. e.g. If sCheck = "<10.0" then return TRUE if sVariable < 10.0 If sCheck = "9.0" or "=9.0" then return TRUE OR FALSE if sVariable is equal to 9.0. We cannot guarentee float accuracy, so == comparisons will generally fail. string sTarget = Identifier or tag of the Target. If blank then use OWNER. */

// gc_local_int(string sVariable, string sCheck, string sTarget) /* This script checks a local int variable's value.

Parameters: string sVariable = The name of the variable string sCheck = The operation to check on the value of the variable. Default is ==, but you can also specify <, >, or ! e.g. sCheck of "<50" returns TRUE if sVariable's value is <50 a sCheck of "9" or "=9" returns TRUE if

49 sVariable's value is equal to 9 and a sCheck of "!0" returns TRUE if sVariable's value is not equal to 0. string sTarget = Tag or identifier of Target. If blank then use dialog OWNER. */

// gc_local_string(string sVariable, string sCheck, string sTarget) /* This script checks a local string variable's value.

Parameters: string sVariable = This is the name of the variable checked. string sCheck = This is the string to compare equality against. string sTarget = This is the tag or identifier of the Target. If blank then use OWNER */

// gc_module( string sTag ) /* Compare sTag to current module's tag. */

// gc_node /* Used on nodes of a dialog to specify it's index.

iNodeIndex - This Node's index (for use w/ gtr_speak_node)

*/

// gc_num_comps (string sCheck) /* This script checks number of roster companions the player has.

Parameters: string sCheck = The operation to check on the value of the variable. Default is ==, but you can also specify <, >, or ! e.g. sCheck of "<50" returns TRUE if sVariable's value is <50 a sCheck of "9" or "=9" returns TRUE if sVariable's value is equal to 9 and a sCheck of "!0" returns TRUE if sVariable's value is not equal to 0. */

// gc_num_pcs (string sCheck) /* This script checks number of PCs in the current game.

50 Parameters: string sCheck = The operation to compare to the number of PCs(NumPC). Default is "=", but you can also specify "<", ">", or "!" e.g. sCheck of "<3" returns TRUE if NumPC is less than 3, sCheck of "2" or "=2" returns TRUE if NumPC is equal to 2, and sCheck of "!1" returns TRUE if NumPC is not equal to 1. */

// gc_obj_valid(string sTag, int bAreaOnly) /* Determines if object is valid (e.g. exists, != OBJECT_INVALID). GetNearest may fail in case of searching the OWNER's tag.

Parameters: string sTag = The tag of the object to search for. int bAreaOnly = If =0 search entire module; otherwise search OWNER's area only. */

// gc_rand_1of /* Used to randomly pick a dialog response. Use paramaters 2 through X for each entry after the first, decementing by 1 for each branch going down. Example: 3 entries would have the following conditionals: gc_rand_1of(3) gc_rand_1of(2) The final entry doesn't need a check since it is a certainty.

*/

// gc_reputation /* This checks the reputation of the speaking player nRepLevel = Checks how noble or ignoble the player's rep is from +4 (Idolized) to -4 (Vilified) nRepNumber = See if it is over a specific number value (overrides previous int) */

// gc_roster_campaignnpc( string sRosterName ) /* Returns CampaignNPC flag T/F of roster member sRosterName. Returns FALSE if unable to find sRosterName in roster table.

//RWT-OEI 09/29/05 //This function returns whether or not a valid roster member is set //as a Campaign NPC. See description of SetIsRosterMemberCampaignNPC //for details on Campaign NPCs. //Returns true or false, depending. False returned if unable to find the //roster member int GetIsRosterMemberCampaignNPC( string sRosterName ); */

51

// gc_singleplayer () /* Returns TRUE if this is a single player only game, otherwise returns FALSE. */

// gc_skill_dc(int nSkill, int nDC) /* Determine if PC Speaker's skill roll is successful.

Parameters: int nSkill = skill int to check int nDC = difficulty class to beat

Remarks: skill ints 0 APPRAISE 1 BLUFF 2 CONCENTRATION 3 CRAFT ALCHEMY 4 CRAFT ARMOR 5 CRAFT WEAPON 6 DIPLOMACY 7 DISABLE DEVICE 8 DISCIPLINE 9 HEAL 10 HIDE 11 INTIMIDATE 12 LISTEN 13 LORE 14 MOVE SILENTLY 15 OPEN LOCK 16 PARRY 17 PERFORM 18 RIDE 19 SEARCH 20 CRAFT TRAP 21 SLEIGHT OF HAND 22 SPELL CRAFT 23 SPOT 24 SURVIVAL 25 TAUNT 26 TUMBLE 27 USE MAGIC DEVICE */

// gc_skill_rank(int nSkill, int nRank) /* Determine if PC Speaker has sufficient rank in a particular skill.

Parameters: int nSkill = skill int to check int nRank = minimum rank to return TRUE

52

Remarks: skill ints 0 APPRAISE 1 BLUFF 2 CONCENTRATION 3 CRAFT ALCHEMY 4 CRAFT ARMOR 5 CRAFT WEAPON 6 DIPLOMACY 7 DISABLE DEVICE 8 DISCIPLINE 9 HEAL 10 HIDE 11 INTIMIDATE 12 LISTEN 13 LORE 14 MOVE SILENTLY 15 OPEN LOCK 16 PARRY 17 PERFORM 18 RIDE 19 SEARCH 20 CRAFT TRAP 21 SLEIGHT OF HAND 22 SPELL CRAFT 23 SPOT 24 SURVIVAL 25 TAUNT 26 TUMBLE 27 USE MAGIC DEVICE */

// gc_talkto(string sTarget) /* This checks to see if you have not talked to this person before. See ga_talkto.nss.

Parameters: string sTarget = Target of the NPC. If blank, use dialog OWNER. */

// gc_true() // Return TRUE

53 Global Door

// gd_close_op /* closes door after someone opens a door goes on the onOpen event of a door. */

54 Global Group

// gg_death_custom_script /* Executes a custom script on the module when a group dies. */

// gg_death_journal /* GroupOnDeath handler to advance journal state of first PC. Checks group local variables sQuestTag, nEntry, and bOverride */

// gg_death_talk.nss /* Group DeathScript. Assigned using GroupOnDeathBeginConversation(). Creates an IPoint Speaker when all group members have been killed to begin a conversation. */

// ginc_actions /* various encapsulated action funtions Main characteristic of action functions is that they are applied to the object that runs them, a target is not supplied as a parameter.

*/

// gc_node will look at these vars. SetLocalInt(oObject, "sn_NodeIndex", iNodeIndex); // node index to check for SetLocalInt(oObject, "sn_OnceOnly", iOnceOnly); // signal whether we should clear node if true }

// sets a node which should be checked for in conversation w/ gc_node and starts convo

55 Global Include

// ginc_alignment /* This include file has functions for adjusting alignment */ // ginc_autosave.nss /* NWN2 Single Player Auto Save Include */ // ginc_baddie_stream /* include for streaming baddies */ // ginc_behavior /* support file for behavior related functions (complex sets of actions and conditions) */ // ginc_companion /* Helper functions for companions. */ // ginc_crafting /* Crafting related functions */

// ginc_death.nss /* NWN2 Knock Out/Wake Up death system functions */ // ginc_debug /* Debug functions */ // ginc_effect /* Effects related constants and functions

Note that many of these effects are temporary. I would not count on the SP_ effects and TESTSEF effects in particular to persist until ship time, so keep that in mind. -EPF

*/ // ginc_event_handlers /* event handler related

56 */ // ginc_group /* Framework and functions for working with groups of objects (usually creatures)

How to use: 1. use ResetGroup() to clear out/delete a group before use to avoid side effects 2. add creatures to your group using the functions under the label *** Group creation *** 3. set up formations, noise and events to fire -- under *** Group Formation and Noise setup *** 4. give group actions -- under *** Group Actions ***

Notes: When creating groups, a creature already in a group will not join another. Some functions have params to overide this, but it is not recommended and can have odd side effects.

*/ // ginc_gui.nss /* GUI/Screen campaign include */

// ginc_ipspeaker /* Various functions for IPoint Speaker pending conversations

Used in gp_ipspeaker_hb, gg_death_talk */ // ginc_item /* Item/Inventory/Store related functions */ // ginc_item_script /* include for item scripts */ // ginc_journal /* journal/quest related functions */ // ginc_math /* Math related functions */ // ginc_misc /* Miscellaneous useful functions

57 */ // ginc_object /* object (creature and placeable) related functions */ // ginc_param_const /* Include file for interesting params and converting ints to constants. */

// ginc_sound /* Sound and Music functions. */

// ginc_trigger /* trigger related functions */

// ginc_utility.nss /* This is the main utility script for NWN2 */

// ginc_vars /* Global/local variable related functions */ // ginc_wp /* Standard include for scripted waypoints

The functions are organized by job-related categories. General utility funtions are listed first, the rest of the sections are listed in alphabetical order according to job category.

*/

58 Global Placeables

// gp_forgemagic_ca /* forge magic weapons on spell cast */

// gp_ipcleaner_hb.nss /* Heartbeat handler to clean up area after combat cutscene has ended. Used in conjunction with ginc_cutscene's CombatCutsceneSetup(); */

// gp_ipspeaker_hb /* Heartbeat handler to start conversation with the PC when conditions are safe. Safe being, NPC speaker and PC (including faction) are not in combat nor in conversation.

Used with gg_death_talk.nss (GroupOnDeathBeginConversation) */

// gp_output_2da /* output 2da data for crafting to the log file */

// gp_talk_door // // Start a conversation with a door.

// gp_talk_object.nss /* This script allows you to speak to an object. Set a conversation, set Usable to True, and attach this script to the OnUsed event. */

// gp_treasure_op_de /* Spawns in general purpose treasure and gold based on variables:

TreasureClass - one of three values. Default is low const int X2_DTS_CLASS_LOW = 0; //Treasure Class Low const int X2_DTS_CLASS_MEDIUM = 1; //Treasure Clas Medium

59 const int X2_DTS_CLASS_HIGH = 2; //Treasure Class High

TreasureType - add desired types together. For example, gold + disposable = 5 Defualt is 5 (gold + disp) Note that you cannot add the same type more than once (i.e. no gold+gold). const int X2_DTS_TYPE_DISP = 1; const int X2_DTS_TYPE_AMMO = 2; const int X2_DTS_TYPE_GOLD = 4; // actually gold and gems (not allowed) const int X2_DTS_TYPE_ITEM = 8; // char specific Item (ignores treasure class) const int X2_DTS_TYPE_MAGIC = 16; // random magic items const int X2_DTS_TYPE_MUNDANE = 32; // random mundane items

This script should be placed in the container's OnOpen and OnDeath events. If bashed, disposeable will be dropped and broken item generated. If no treasures are generated, 1d20 gold will be created. */

60 Global Reports

// gr_character_xml /* output character data to the log in XML format */

// gr_dcr /* Run DetermineCombatRound on self */

// gr_debug /* Starts the debug conversation for this module

This script for use with the dm_runscript console command */

// gr_dm /* Summons the DM.

This script for use with the dm_runscript console command */

// gr_equip_comps.nss // Equip companions with high level gear

// gr_followleader /* Sets player to auto-follow the party leader.

This script for use with the dm_runscript console command */

// gr_followpos /* test script for setting up follow positions */

// gr_henchinv /* open inventory of henchman 1.

This script for use with the dm_runscript console command */

61

// gr_instrument /* Gives player the instrument of death.

This script for use with the dm_runscript console command */

// gr_item_report /*

*/

// gr_jumpleader /* Teleports player to the party leader.

This script for use with the dm_runscript console command */

// gr_jumptodm /* jumpts player to the a DM.

This script for use with the dm_runscript console command */

// gr_kill_aoe( float fRadius ) // Inflict massive damage to hostiles within fRadius meters

// gr_lostitems /* Opens up the LostItems store for the player. If no lost items store is found, one is created. Plot items aren't added to this store if it doesn't exist, so this command be run once at the beginning of the module to make sure one is created.

This script for use with the dm_runscript console command */

// gr_outofmyway.nss /* Force nearby creatures to move away from the PC. */

// gr_pc_spawn /* the spawn-like script for PC's

62 Sets up listening patterns and variables. */

// gr_print_effects( string sTag )

//gr_report /* info on target */

// gr_restart /* Restarts the module. Assumes module name is the file name.

This script for use with the dm_runscript console command */

// gr_roster_reset // Resets all roster members in-game to average PC level

// gr_where_am_i /* Reports current location

This script for use with the dm_runscript console command

63 Graphical User Interace

// gui_bhvr_a_casting_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_casting_overkill /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_casting_power /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_casting_scaled /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_combat_mode_use_off.nss /* Combat Mode Use All Off Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_combat_mode_use_on.nss /* Combat Mode Use All On Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_def_master_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_def_master_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_disarm_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_disarm_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_dispel_off /* Behavior script for the character sheet behavior sub-panel */

64 // gui_bhvr_a_dispel_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_feat_use_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_feat_use_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_follownear.nss /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_follownear.nss /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_follownear.nss /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_item_use_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_item_use_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_puppet_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_puppet_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_retry_locks_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_retry_locks_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_stealth_none

65 /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_stealth_perm /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_a_stealth_temp /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_casting_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_casting_overkill /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_casting_power /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_casting_scaled /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_combat_mode_use_off.nss /* Combat Mode Use Off Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_combat_mode_use_on.nss /* Combat Mode Use On Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_def_master_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_def_master_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_disarm_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_disarm_on

66 /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_dispel_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_dispel_on /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_feat_use_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_feat_use_on /* Behavior script for the character sheet behavior sub-panel */

//:://///////////////////////////////////////////// //:: Behavior Screen - Follow Distance: Far //:: gui_bhvr_followfar.nss

//:://///////////////////////////////////////////// //:: Behavior Screen - Follow Distance: Medium //:: gui_bhvr_followmed.nss

//:://///////////////////////////////////////////// //:: Behavior Screen - Follow Distance: Near //:: gui_bhvr_follownear.nss

// gui_bhvr_inc /* include file for the GUI Behavior related scripts: gui_bhvr_follownear gui_bhvr_followmed gui_bhvr_followfar gui_bhvr_def_master_on gui_bhvr_def_master_off gui_bhvr_retry_locks_on gui_bhvr_retry_locks_off gui_bhvr_stealth_none gui_bhvr_stealth_perm gui_bhvr_stealth_temp gui_bhvr_disarm_on gui_bhvr_disarm_off gui_bhvr_dispel_on gui_bhvr_dispel_off gui_bhvr_casting_overkill gui_bhvr_casting_power gui_bhvr_casting_scaled gui_bhvr_casting_off

67 gui_bhvr_item_use_on gui_bhvr_item_use_off gui_bhvr_feat_use_on gui_bhvr_feat_use_off gui_bhvr_combat_mode_use_on gui_bhvr_combat_mod_use_off

gui_bhvr_a_follownear gui_bhvr_a_followmed gui_bhvr_a_followfar gui_bhvr_a_def_master_on gui_bhvr_a_def_master_off gui_bhvr_a_retry_locks_on gui_bhvr_a_retry_locks_off gui_bhvr_a_stealth_none gui_bhvr_a_stealth_perm gui_bhvr_a_stealth_temp gui_bhvr_a_disarm_on gui_bhvr_a_disarm_off gui_bhvr_a_dispel_on gui_bhvr_a_dispel_off gui_bhvr_a_casting_overkill gui_bhvr_a_casting_power gui_bhvr_a_casting_scaled gui_bhvr_a_casting_off gui_bhvr_a_item_use_on gui_bhvr_a_item_use_off gui_bhvr_a_feat_use_on gui_bhvr_a_feat_use_off gui_bhvr_a_combat_mode_use_on gui_bhvr_a_combat_mod_use_off

*/

// gui_bhvr_item_use_off /* Behavior script for the character sheet behavior sub-panel */

// gui_bhvr_puppet_off /* Behavior script for the character sheet behavior sub-panel */

// gui_bhvr_puppet_on /* Behavior script for the character sheet behavior sub-panel

68 */

// gui_bhvr_retry_locks_off /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_retry_locks_on /* Behavior script for the character sheet behavior sub-panel */

// gui_bhvr_stealth_none /* Behavior script for the character sheet behavior sub-panel */ // gui_bhvr_stealth_perm /* Behavior script for the character sheet behavior sub-panel */

// gui_bhvr_stealth_temp /* Behavior script for the character sheet behavior sub-panel */

//:://///////////////////////////////////////////// //:: Behavior Screen - Update //:: gui_bhvr_update.nss

// gui_death_exitgame.nss /* Death GUI 'Exit Game' callback */

// gui_death_hidden_click.nss /* Hidden Death GUI 'Click' callback */

// gui_death_respawn.nss /* Death GUI 'Respawn' callback: wake up groggy */

// gui_death_respawn_self.nss /* NWN2 Default Death Screen 'Respawn' callback */

69

// gui_force_comp // // A companion is forced into the party, and the party gui is brought up. // This is a callback script called from ka_hotspot_click_force. The function DisplayForceCompanionMessage() defines // the companion who gets forced into the party, setting it as a global variable.

// gui_input_ok

// gui_map_transition /* Transitions party to a waypoint set in a global variable. */

// gui_name_enchanted_item /* rename weapon user has just enchanted w/ the input string. */

70