x0_i0_henchman
This include file REPLACES the original henchman include file (nw_i0_henchman) from campaign one; both should not be included in the same script.Many functions here have the same names/parameters as functions as nw_i0_henchman to facilitate code reuse, so dual includes will result in major compile errors due to function redefinition.
Function behavior may, and does, differ from the originals.
The primary difference is that X0 henchmen can be hired by more than one person during the course of the game. The current master of the henchman will be stored in a local variable on the henchman itself; campaign variables on the player will indicate whether the player has ever hired the henchman.
NOTE: This file includes nw_i0_generic, nw_i0_plot, nw_i0_spells and x0_i0_common.
Constants
Name | Value | Brief Description | DELAY_BETWEEN_RESPAWN_CHECKS | 3.0 | Amount of time to pass between respawn checks. | HENCHMEN_DIE_ANIM_DURATION | 6500000000.0 | Duration henchmen play their die animations. | MAX_RESPAWN_WAIT | 60.0 | The maximum length of time to wait before respawn. | sDeekin | X0_HEN_DEE | XP1 Henchmen tag. | sDorna | X0_HEN_DOR | XP1 Henchmen tag. | sGoHomeScript | x0_ch_hen_gohome | Script name. | sHenchmanDeathVarname | NW_L_HEN_I_DIED | sHenchmanDyingVarname | X0_HEN_IS_DYING | sHenchmanKilledSuffix | _GOTKILLED | sHenchmanResurrectedSuffix | _RESURRECTED | sIsHiredVarname | X0_IS_CURRENTLY_HIRED | sLastMasterVarname | X0_LAST_MASTER_TAG | sStoredHenchmanVarname | X0_HEN_STORED | sXandos | X0_HEN_XAN | XP1 Henchmen tag. | X0_NUMBER_HENCHMEN | 3 | Number of henchmen. | X2_NUMBER_HENCHMEN | 2 | This won't be the same as the GetMaxHenchmen() function due to followers. |
---|
Functions
Name | Brief Description |
---|---|
AdjustXP2Levels | Internal function. Adjusts the levels for the henchmen. |
brentDebug | Internal function. Commented out SendMessageToPC message to GetFirstPC. |
CopyHenchmanLocals | Copy all henchman-related local variables from source to target. Used when henchmen level up to keep variables consistent between the two copies of the henchman. This is a good function to look at to see what the local variables used on henchmen are. |
DoLevelUp | If you want a function that will return OBJECT_INVALID no matter what parameters you send it, this one is for you! There is a different version located in nw_i0_henchman. |
DoRespawn | This function actually invokes the respawn. |
DoRespawnCheck | Perform a single respawn check -- this function works in a circle with RespawnCheck. |
FireHenchman | Use to fire the henchman. |
GetCanLevelUp | If you want a function that will return FALSE no matter what parameters you send it, this one is for you! There is a different version located in nw_i0_henchman. |
GetDidDie | Returns TRUE if the henchman died. UNLIKE original in nw_i0_henchman, does NOT reset the value -- use SetDidDie(FALSE) to do that. |
GetDidQuit | Determine if the henchman quit. |
GetDialogFile | Internal function. Returns dialog file to use based on the state of the henchmen. |
GetDialogFileToUse | Internal function. Returns the filename for the appropriate dialog file to be used. Henchmen have various dialog files throughout the game. |
GetHasMaxWaitPassed | See if our maximum wait time has passed. |
GetHasMet | Returns TRUE if the player has met this henchman. This uses local variables, not campaign variables. |
GetIsFollower | Returns TRUE if oHench is a follower. |
GetIsHenchmanDying | Determine if this henchman is currently dying. |
GetIsHired | Returns TRUE if the henchman is currently hired. |
GetKilled | Determine if this PC got the henchman killed. |
GetLastMaster | Returns the last master of this henchman (useful for death situations). |
GetPlayerHasHired | Determine whether the player has ever hired this henchman. |
GetPlayerHasHiredInCampaign | Indicate whether the player has ever hired this henchman in this campaign. |
GetResurrected | Determine if this PC resurrected the henchman. |
GetWorkingForPlayer | Determine whether the henchman is currently working for this PC. Returns FALSE if(!GetIsObjectValid(oHench) || !GetIsObjectValid(oPC)). Returns TRUE if(GetMaster(oHench) == oPC). |
HireHenchman | Can be used for both initial hiring and rejoining. |
KeepDead | Keep dead by playing the appropriate death animation for the maximum wait until respawn. |
LevelHenchmanUpTo | Levels a henchman up to the given level, alternating between the first and second classes if they are multiclassed. |
LevelUpAribeth | Internal function. Initial Aribeth you meet in Chapter 3. Levels her up to level 16 Paladin, Level 6 Blackguard. |
LevelUpXP1Henchman | Levels up the henchman assigned to oPC. |
PartialRes | Internal function. Does a partial restoration to get rid of negative effects. |
PostRespawnCleanup | Clean up after the respawn. |
PreRespawnSetup | Set up before the respawn. |
QuitHenchman | Used when the henchman quits. |
RaiseForRespawn | Raise and freeze henchman to 1 hp so they can be stabilized. |
RemoveAllFollowers | Removes all followers. If bRemoveAll = TRUE then remove normal henchies too. |
RespawnCheck | Do the checking to see if we respawn -- this function works in a circle with DoRespawnCheck. |
RespawnHenchman | Respawn the henchman, by preference at the master's current respawn point, or at the henchman's starting location otherwise. |
RetrieveCampaignHenchman | Call this function when a PC enters a sequel module to restore the henchman (complete with inventory). The function StoreCampaignHenchman must have been called first, and both modules must use the same campaign database. (See notes in x0_i0_campaign.) The restored henchman will automatically be re-hired and will be created next to the PC. |
RetrieveHenchmanItems | Retrieve (and then delete) all henchman inventory items out of the campaign database, putting them in the inventory of the henchman. This is paired with StoreHenchmanItems for the leveling-up process. |
SetDidDie | Set on the henchman to indicate they died; can also be used to unset this variable. |
SetDidQuit | Set whether the henchman quit this player's employ. |
SetHasMet | Use when the player first meets the henchman/NPC. This uses local variables, not campaign variables. |
SetHenchmanDying | Wrapper function added to fix bugs in the dying-state process. Need to figure out whenever his value changes. |
SetIsFollower | Sets whether oHench is a follower or not. |
SetKilled | Set got killed. |
SetLastMaster | Set the last master. |
SetNumberOfRandom | Internal function. Sets the number of random popups or interjections that the henchman has. Should be called in henchman spawn scripts. |
SetPlayerHasHired | Indicate whether the player has ever hired this henchman. |
SetPlayerHasHiredInCampaign | Indicate whether the player has ever hired this henchman in this campaign. |
SetResurrected | Set that this PC resurrected the henchman. |
StopKeepingDead | Stop keeping dead by playing the 'woozy' standing animation. |
StoreCampaignHenchman | Call this function when the PC is about to leave a module to enable restoration of the henchman on re-entry into the sequel module. Both modules must use the same campaign database for this to work. |
StoreHenchmanItems | Store all items in the henchman's inventory in the campaign database, skipping those items which have the henchman's tag in their name. This is paired with RetrieveHenchmanItems for the leveling-up process. |
WrapCommandable | Internal function. Toggles the henchman's commandable status. |
X2_GetNumberOfHenchmen | Internal function. Count number of henchman. |
X2_FireFirstHenchman | Internal function. Fires the first henchman who is not a follower. |
author: Mistress, contributor: Graewerld