Various functions related to NPCs/Critters.
Include npc_common_h.fos for usage.
Defines |
| #define | _FreeHex (map.IsHexPassed(hx, hy) && @ (map.GetCritter(hx, hy)) == null) |
| #define | _AddHex |
| #define | _OldHex (hx == px && hy == py) |
| #define | _ReturnHex outX = hx; outY = hy; return true |
Functions |
| bool | AttackCritter (Critter& attacker, Critter& target, uint minhp) |
| bool | AttackCritter (Critter& attacker, Critter& target) |
| bool | HasIntelligentBrain (Critter& cr) |
| void | UnsetCritterIllegalFlag (Critter& critter) |
| void | UnsetCritterIllegalFlag (Critter& critter, int location) |
| void | UnsetCritterIllegalFlag (uint id, int location) |
| void | SetCritterIllegalFlag (Critter& critter, int reason) |
| void | SetCritterIllegalFlag (Critter& critter, int location, int reason) |
| void | PutAwayItems (Critter& critter) |
| int | GetCritterIllegalFlag (Critter& critter, int location) |
| | Get illegal flag status of critter in a specific location.
|
| int | GetCritterIllegalFlag (Critter& critter) |
| | Clear illegal flags in critter's current location.
|
| void | ClearIllegalFlags (Critter& critter) |
| | Clear illegal flags in all towns.
|
| bool | IsFlaggedAsIllegal (Critter& critter) |
| bool | IsFlaggedAsIllegal (Critter& critter, int location) |
| void | Heal (Critter& cr) |
| | Heal a critter.
|
| bool | HasSameScript (Critter& critter1, Critter& critter2) |
| | Check if two critters has the same script assigned.
|
| bool | IsInLocation (Critter& critter, int locationPID) |
| | Check if a critter is in a specific location.
|
| bool | MoveByDir (Critter& critter, uint8 dir, uint steps, bool run) |
| uint | GetNearGuards (Map@ map, uint16 hexX, uint16 hexY, uint radius, array< Critter@>@ crits) |
| | Gets all general purpose guards in a radius around given hex.
|
| uint | GetNearFactionGuards (Map@ map, uint16 hexX, uint16 hexY, uint radius, uint faction, array< Critter@>@ crits) |
| | Gets all faction guards in a radius around given hex.
|
| Item@ | ArmBestWeapon (Critter& critter) |
| | Arm the best weapon available to the NPC.
|
| Item@ | ArmFavoriteWeapon (Critter& critter) |
| | Tries to arm NPC with its favorite weapon.
|
| void | FindFreeHexes (Map@ map, uint16 hexX, uint16 hexY, int& num, array< uint16 >& coordsX, array< uint16 >& coordsY) |
| bool | FindNearestFreeHex (Map@ map, uint16 hexX, uint16 hexY, uint16& outX, uint16& outY) |
| bool | Flee (Critter& cr) |
| bool | Flee (Critter& cr, bool Run) |
| | Flee to worldmap via closest exitgrid.
|
| void | MoveRandom (Critter& npc, uint maxDist) |
| | Issue random walk for a critter to a hex in stepDist distance, as long as the actual distance to home pos is less than maxDist.
|
| void | MoveRandom (Critter& npc, uint maxDist, bool Run) |
| void | MoveRandom (Critter& npc, uint maxDist, uint stepDist, bool Run) |
| bool | CanUseWeapon (Critter& critter, uint proto) |
| | Checks if a critter can use a weapon (has an animation for it).
|
| bool | CanUseWeapon (Critter& critter, Item@ weapon) |
| | Checks if a critter can use a weapon (has an animation for it).
|
| bool | HasUnusableWeapon (Critter& critter, uint bag) |
| | Checks if a critter can't use a weapon from a specific bag.
|
| bool | HasUnusableWeapon (Critter& critter) |
| | Checks if a critter can't use a weapon in his inventory.
|
| bool | HasUnusableWeapon (uint crpid, uint bag) |
| | Checks if a critter PID can't use a weapon from a specific bag.
|
| void | AddWaitPlan (Critter& critter, uint waittime) |
| | The critter will wait for the specified time without getting busy (it can speak to players).
|
| void | TryReportOffense (Critter@ cr, Critter@ offender, int reputationdrop) |
| string | GetStoredFirstName (Critter& critter) |
| string | GetStoredName (Critter& critter) |
| string | GenerateNewName (Critter& critter) |
| uint | GetCrittersWithScript (Map& map, uint16 pid, uint findType, string& scriptName, string& funcDeclaration, array< Critter@>@ critters) |
| | Gather all critters from a map that share the given script, and comply to the search parameters.
|
| uint | GetCrittersLoc (Location& loc, uint16 pid, uint findType, array< Critter@>@ critters) |
| void | SetDeleteEvent (Critter& cr, uint time) |
| void | DropDeleteEvent (Critter& cr) |
| uint | cte_Delete (Critter& cr, int identifier, uint& rate) |
Dialog functions |
|
| void | r_MoveRandom (Critter& player, Critter@ npc, int val) |
| bool | d_HasNumPlayersInParty (Critter& leader, Critter@ npc, int num) |
| | Checks if a party has specified numbers of members.
|
| bool | d_HasNotNumPlayersInParty (Critter& leader, Critter@ npc, int val) |
| | Checks if a party has NOT specified numbers of members.
|