Various utility functions to make life easier when working with FO2238. More...
Various utility functions to make life easier when working with FO2238.
Include utils_h.fos for usage.
Classes | |
| class | DateTime |
Functions | |
| string | GetMsgStr (int textMsg, uint strNum) |
Critter related | |
A list of functions that are more or less related to manipulating critters. | |
| Critter@ | AddNpc (Map@ map, uint16 pid, uint16 x, uint16 y, uint8 dir, uint dialogId, string& script, uint aiPack, uint bagId, uint teamId, bool isMob, uint level) |
| AddNpc that is backwards compatible with old AddNpc function. | |
| Critter@ | AddNpc (Map@ map, uint16 pid, uint16 x, uint16 y, uint8 dir, uint dialogId, string& script, uint aiPack, uint bagId, uint teamId, uint factionRank, uint factionMode, bool isMob, uint level) |
| AddNpc that is backwards compatible with old AddNpc function and provide additional faction info setting. | |
| Critter@ | AddNpc (Map@ map, uint16 pid, uint16 x, uint16 y, uint8 dir, array< int > params, uint dialogId, string& script, uint aiPack, uint bagId, uint teamId, bool isMob, uint level) |
| AddNpc that is backwards compatible with old AddNpc function and override default parameters. | |
| Critter@ | AddNpc (Map@ map, uint16 pid, uint16 x, uint16 y, uint8 dir, array< int > params, uint dialogId, string& script, uint aiPack, uint bagId, uint teamId, uint factionRank, uint factionMode, bool isMob, uint level) |
| AddNpc that is backwards compatible with old AddNpc function with additional faction data and override default parameters. | |
| string | GetCritterInfo (Critter& cr) |
| Retrieve string with some critter information. | |
| void | AddScore (Critter@ cr, uint score, uint points) |
| Add score to a critter. | |
| bool | ReloadWeapon (Critter& cr) |
| Item@ | GetRadio (Critter& cr) |
| Retrieve radio that critter wears in a slot. | |
| Item@ | GetRepairTool (Critter& cr) |
| Retrieve tool that critter wears in a slot. | |
| Item@ | GetEquippedItemByType (Critter& cr, uint ItemType) |
| Retrieve an item of specified type (any weapon for example) that critter wears in a slot. | |
| Item@ | GetEquippedItem (Critter& cr, uint Pid) |
| Retrieve a specific item that critter wears in a slot. | |
| Item@ | GetEquippedItem (Critter& cr, array< uint >& Pids) |
| Retrieve any item in list that critter wears in a slot. | |
| string | GetConditionOfCritter (Critter@ cr) |
| Gives string of player condition. | |
| bool | SkillRoll (Critter@ cr, int skill, int bonus) |
| Does a skill roll. | |
| int | SkillCheck (Critter& cr, int skill, int skillused, Item@ item, int bonus) |
| Useful wrapper for making checks if a proper skill or item was applied in a given context. | |
| string | SkillName (uint8 skill) |
| string | GetExtConditionOfCritter (Critter@ cr) |
| Gives string of extended player condition (animation). | |
| bool | AddExpTeam (Critter& critter, int xp) |
| Function to add xp divided equally among all members of a "team". | |
| void | DropTimeouts (Critter& cr) |
| Drop all timeouts of target critter. | |
| void | ClearEvents (Critter& cr) |
| Clears all current critter events. | |
| void | GiveBag (uint bag, Critter@ cr) |
| Create bag and add items to critter. | |
| bool | HasItem (Critter@ cr, uint pid) |
| bool | HasSomeWeapon (Critter@ cr) |
| Has a weapon in inventory or equipped. | |
| uint | GetBestWeaponSkill (Critter@ cr) |
| Gets the best weapon skill that a critter has. | |
| void | AddOnlinePlayer (Critter& cr) |
| Add player to array of all online players. | |
| void | RemoveOnlinePlayer (Critter& cr) |
| Remove player from array of all online players. | |
| uint | GetAllOnlinePlayers (array< Critter@>& out players) |
| Retrieve all players that are online. | |
| uint | GetNumberOfPlayersOnline () |
| Check how many players are online. | |
| uint | GetAuthenticatedPlayers (array< Critter@>& out players) |
| Retrieve all authenticated players that are online. | |
| uint | GetAuthenticatedPlayers (array< Critter@>& out players, bool ignorePriviledges) |
| Critter@ | GetMostSkilled (array< Critter@>@ group, int skill) |
| Gets critter that is best at some skill in the group. | |
| string | GetAuthString (Critter& player) |
| Retrieve a string showing target players access level. | |
| string | GetAuthString (int accesslevel) |
| Retrieve a string showing target players access level. | |
| bool | CanRequestHelp (Critter& player) |
| Check if target player can use +requesthelp. | |
| void | SetRequestedHelp (Critter& player) |
| Disables the ability to use +requesthelp for some time. | |
| void | SetRequestedHelp (Critter& player, int minutes) |
| Critter@ | GetOnlineGM () |
| Retrieve a random GM. | |
| bool | IsHumanoid (Critter@ cr) |
| void | ClearEnemyStack (Critter& critter) |
| Clear EnemyStack of target NPC. | |
| void | ClearEnemyStacksOnMap (Map@ map) |
| Clear all EnemyStacks of all NPCs on specified map. | |
| bool | IsCurrentEnemy (Critter& cr, uint targetId) |
| Checks if a target with given id is the critter's enemy, based on the enemy stack and attack planes. | |
| string@ | GetSafePlayerName (uint id) |
| string | GetSafePlayerName (uint id, string& onSuccess, string& onError) |
| uint | GetGroupIndex (Critter& cr) |
| uint | GetGroupIndex (int st) |
| void | SetGroupIndex (Critter& cr, uint val) |
| Modifies data responsible for holding faction/group index. | |
| uint | GetGroupRank (Critter& cr) |
| void | SetGroupRank (Critter& cr, uint val) |
| uint | GetGroupMode (Critter& cr) |
| void | SetGroupMode (Critter& cr, uint val) |
| void | SetGroupInfo (Critter& cr, uint faction, uint rank, uint mode) |
| void | SetGroupInfoPack (Critter& cr, uint packInfo) |
File handling and I/O | |
A list of functions that are related to reading/writing data from files. | |
| bool | ReadPids (array< int >& out pids, bool removeinvalid) |
| Reads ITEMPID.H into supplied array. | |
| void | ReadDefines (string@ fileName, dictionary& items, array< string >@ defines) |
| Read values defined in the given file. | |
String handling | |
A list of useful functions that are related to manipulating strings in various ways. | |
| bool | ParseDefine (const string& in line, string& out spid, int& out id) |
| Gets info from line like this: define ITEM_PID number. | |
| int | SkipWhitespaces (const string& in str, int start) |
| skips all whitespaces in string starting at start position | |
| int | SkipNonWhitespaces (const string& in str, int start) |
| skips all non-whitespaces in string starting at start position | |
| bool | IsParameterTag (string& str) |
| Checks if a string containers a parameter tag. | |
| string | GetParameterString (array< string@>@ arr, string& parameter) |
| Gets the string of a named parameter in an array of strings. | |
| int | GetIndexOfString (array< string@>@ arr, string& str) |
| Returns the index of a string in an array of strings. | |
| string | GetConcatenatedString (array< string@>@ arr, uint startindex, int stopindex) |
| Concatenates the specified indexes of an array of strings to a string and returns it. | |
Locations and maps | |
A list of functions that are related to locations and maps. | |
| void | SetTurnBasedAvailability (Location@ loc) |
| Sets turn based mode for all maps within the location. | |
| bool | IsEncounterMap (Map@ map) |
| Checks if map is an encounter map. | |
| bool | IsTown (Map@ map) |
| Checks if map is a town map. | |
| uint | GetMapType (Map@ map) |
| Gets the type of a map. | |
| Location@ | GetLocationOf (Critter& critter) |
| Retrieve current location of a critter. | |
| string | GetLocationName (uint locId) |
| string | GetLocationName (Location@ loc) |
General functions | |
A list of functions that do various things. | |
| void | SetQuestGarbager (uint time, uint playerid, uint locid, uint var, uint val) |
| Sets the time and event to garbage the location, setting a given variable to given value when the location was present on event execution. | |
| void | LockDoor (uint x, uint y, Map@ map, uint complexity, uint lockid) |
| Lock a door. | |
| void | UnlockDoor (uint x, uint y, Map@ map) |
| Unlock a door. | |
| int | gcd (int a, int b) |
| array< int > | knapsack (array< int > weights, int W) |
Time and dates | |
A list of functions related to time and dates. | |
| IDateTime@ | GetCurrentDateTime () |
| string | GetCurrentDateTimeString () |
| Gets a DateTime string which displays both date and time. | |
| string | GetCurrentDateTimeString (bool date, bool time) |
| Gets a DateTime string which displays date or/and time. | |
Containers | |
A list of functions related to working with containers. | |
| Item@ | GetContainer (Map@ map, uint contpid, uint entire) |
| Retrieve container from a map, with Entire. | |
| bool | TeleportCar (Item@ Car, uint MapId) |
| Teleport a car to some other map. | |
| void | TransferItemsToContOnMap (Critter& cr, Map@ map, int entid, int contpid, int itemtypes) |
| Transfer some items from target critter to a container on a specific map via Entire. | |
| void | TransferItemsFromContOnMap (Critter& cr, Map@ map, int entid, int contpid) |
| Transfer items from a container to a critter. | |
| void | ClearContainer (Item@ container) |
| Deletes all items in specified container. | |
| void | MoveItemsCritterToCont (Critter& crFrom, Item& contTo, uint specid) |
| Move all items from a critter to a subcontainer of a container. | |
Variables | |
A list of functions related to working with game variables. | |
| int | GetGvar (uint gvar) |
| Wrapper function for retrieving the value of a GVAR (Global variable). | |
| void | SetGvar (uint gvar, uint value) |
| Wrapper function for setting the value of a GVAR (Global variable). | |
| int | GetLLvar (Location& location, uint llvar) |
| int | GetLLvar (uint locationId, uint llvar) |
| void | SetLLvar (Location& location, uint llvar, uint value) |
| int | GetLMvar (Map& map, uint lmvar) |
| int | GetLMvar (uint mapId, uint lmvar) |
| void | SetLMvar (Map& map, uint lmvar, uint value) |
| int | GetLIvar (Item& item, uint livar) |
| int | GetLIvar (uint itemId, uint livar) |
| void | SetLIvar (Item& item, uint livar, uint value) |
| int | GetLvar (Critter& critter, uint lvar) |
| Wrapper function for retrieving the value of an LVAR (Local variable) from a critter. | |
| int | GetLvar (uint id, uint lvar) |
| Wrapper function for retrieving the value of an LVAR (Local variable) from a critter. | |
| int | GetLvar (uint id, uint lvar, string& typeShort) |
| void | SetLvar (Critter& critter, uint lvar, uint value) |
| Wrapper function for setting the value of an LVAR (Local variable). | |
| void | SetLvar (uint id, uint lvar, uint value) |
| Wrapper function for setting the value of an LVAR (Local variable). | |
| void | SetLvar (uint id, uint lvar, uint value, string& typeShort, string& typeLong) |
| int | GetUvar (uint uvar, uint masterid, uint slaveid) |
| Wrapper function for retrieving the value of an UVAR ("Unicum" variable). | |
| void | SetUvar (uint uvar, uint masterid, uint slaveid, uint value) |
| Wrapper function for setting the value of an UVAR ("Unicum" variable). | |
Item Value | |
A list of functions related to retrieving the value of various items. | |
| uint | GetContainerValue (Item@ container) |
| Uses BaseItemValue to deduce value of all items in a container. | |
| uint | BaseItemValue (uint pid, bool ammo) |
| base value of an spawned item with this pid (with 0% deterioration, unbroken) | |
| uint | BaseItemValue (uint pid, uint broken, uint det, bool ammo) |
| base value of an spawned item with this pid (with det% deterioration, broken times broken) | |
| uint | BaseItemValue (Item@ item) |
| Full base value of an item, count included. | |
| uint | BaseItemValue (Item@ item, uint proc) |
| proc% of base value of an item (ammo value is always 100%), count included | |
| uint | BaseSingleItemValue (Item@ item) |
| full base value of an item, count NOT included. | |
| uint | BaseSingleItemValue (Item@ item, uint proc) |
| proc% of base value of an item (ammo value is always 100%), count NOT included | |
| bool | Pickable (Item@ item) |
| Critter@ AddNpc | ( | Map@ | map, | |
| uint16 | pid, | |||
| uint16 | x, | |||
| uint16 | y, | |||
| uint8 | dir, | |||
| uint | dialogId, | |||
| string& | script, | |||
| uint | aiPack, | |||
| uint | bagId, | |||
| uint | teamId, | |||
| bool | isMob, | |||
| uint | level | |||
| ) |
AddNpc that is backwards compatible with old AddNpc function.
| map | Map handle where NPC should be spawned. | |
| pid | PID of NPC to spawn. | |
| x | X-position on map. | |
| y | Y-position on map. | |
| dir | direction of NPC, see direction defines in _defines.fos | |
| dialogId | dialog id, see dialogs.lst or _dialogs.fos | |
| script | script module and init function to use, for example: "guard@critter_init", means use the function critter_init in script guard.fos | |
| aiPack | AI pack to assign to NPC. See _ai.fos | |
| bagId | Bag to assign to NPC. See BAGS.txt | |
| teamId | Assign Faction/Team. | |
| isMob | Deprecated parameter, used only in some really old code. Set it to false. | |
| level | Level of spawned NPC. |
| Critter@ AddNpc | ( | Map@ | map, | |
| uint16 | pid, | |||
| uint16 | x, | |||
| uint16 | y, | |||
| uint8 | dir, | |||
| uint | dialogId, | |||
| string& | script, | |||
| uint | aiPack, | |||
| uint | bagId, | |||
| uint | teamId, | |||
| uint | factionRank, | |||
| uint | factionMode, | |||
| bool | isMob, | |||
| uint | level | |||
| ) |
AddNpc that is backwards compatible with old AddNpc function and provide additional faction info setting.
| map | Map handle where NPC should be spawned. | |
| pid | PID of NPC to spawn. | |
| x | X-position on map. | |
| y | Y-position on map. | |
| dir | direction of NPC, see direction defines in _defines.fos | |
| dialogId | dialog id, see dialogs.lst or _dialogs.fos | |
| script | script module and init function to use, for example: "guard@critter_init", means use the function critter_init in script guard.fos | |
| aiPack | AI pack to assign to NPC. See _ai.fos | |
| bagId | Bag to assign to NPC. See BAGS.txt | |
| teamId | Assign Faction/Team. | |
| factionRank | Assign Faction/Team rank. | |
| factionMode | Assign Faction/Team mode. | |
| isMob | Deprecated parameter, used only in some really old code. Set it to false. | |
| level | Level of spawned NPC. |
| Critter@ AddNpc | ( | Map@ | map, | |
| uint16 | pid, | |||
| uint16 | x, | |||
| uint16 | y, | |||
| uint8 | dir, | |||
| array< int > | params, | |||
| uint | dialogId, | |||
| string& | script, | |||
| uint | aiPack, | |||
| uint | bagId, | |||
| uint | teamId, | |||
| bool | isMob, | |||
| uint | level | |||
| ) |
AddNpc that is backwards compatible with old AddNpc function and override default parameters.
| map | Map handle where NPC should be spawned. | |
| pid | PID of NPC to spawn. | |
| x | X-position on map. | |
| y | Y-position on map. | |
| dir | direction of NPC, see direction defines in _defines.fos | |
| params | override for default parameters | |
| dialogId | dialog id, see dialogs.lst or _dialogs.fos | |
| script | script module and init function to use, for example: "guard@critter_init", means use the function critter_init in script guard.fos | |
| aiPack | AI pack to assign to NPC. See _ai.fos | |
| bagId | Bag to assign to NPC. See BAGS.txt | |
| teamId | Assign Faction/Team. | |
| isMob | Deprecated parameter, used only in some really old code. Set it to false. | |
| level | Level of spawned NPC. |
| Critter@ AddNpc | ( | Map@ | map, | |
| uint16 | pid, | |||
| uint16 | x, | |||
| uint16 | y, | |||
| uint8 | dir, | |||
| array< int > | params, | |||
| uint | dialogId, | |||
| string& | script, | |||
| uint | aiPack, | |||
| uint | bagId, | |||
| uint | teamId, | |||
| uint | factionRank, | |||
| uint | factionMode, | |||
| bool | isMob, | |||
| uint | level | |||
| ) |
AddNpc that is backwards compatible with old AddNpc function with additional faction data and override default parameters.
| map | Map handle where NPC should be spawned. | |
| pid | PID of NPC to spawn. | |
| x | X-position on map. | |
| y | Y-position on map. | |
| dir | direction of NPC, see direction defines in _defines.fos | |
| params | override for default parameters | |
| dialogId | dialog id, see dialogs.lst or _dialogs.fos | |
| script | script module and init function to use, for example: "guard@critter_init", means use the function critter_init in script guard.fos | |
| aiPack | AI pack to assign to NPC. See _ai.fos | |
| bagId | Bag to assign to NPC. See BAGS.txt | |
| teamId | Assign Faction/Team. | |
| isMob | Deprecated parameter, used only in some really old code. Set it to false. | |
| level | Level of spawned NPC. |
Retrieve string with some critter information.
Suitable for usage in logging.
| void AddScore | ( | Critter@ | cr, | |
| uint | score, | |||
| uint | points | |||
| ) |
Add score to a critter.
| cr | Critter handle. | |
| score | Score index. | |
| points | How many points to add. |
| bool ReloadWeapon | ( | Critter& | cr | ) |
Gives string of player condition.
| cr | Handle to critter. |
| bool SkillRoll | ( | Critter@ | cr, | |
| int | skill, | |||
| int | bonus | |||
| ) |
Does a skill roll.
| cr | Handle to critter. | |
| skill | Skill number | |
| bonus | Skill bonus |
Useful wrapper for making checks if a proper skill or item was applied in a given context.
| cr | Critter reference. | |
| skill | Skill number to be checked | |
| skillused | Skill that is supposed to be used - if used item implied skill or used skill do not match, the function fails | |
| item | Item handle, might imply used skill, e.g. Lockpicks imply SK_LOCKPICK | |
| bonus | Skill bonus |
| string SkillName | ( | uint8 | skill | ) |
Gives string of extended player condition (animation).
| cr | Handle to critter. |
| bool AddExpTeam | ( | Critter& | critter, | |
| int | xp | |||
| ) |
Function to add xp divided equally among all members of a "team".
| critter | Handle to one member of a team. | |
| xp | Amount of total XP points to add. |
| void DropTimeouts | ( | Critter& | cr | ) |
Drop all timeouts of target critter.
| cr | Critter handle. |
| void GiveBag | ( | uint | bag, | |
| Critter@ | cr | |||
| ) |
Create bag and add items to critter.
| cr | Critter handle. | |
| bag | Bag Id to give. |
| bool HasItem | ( | Critter@ | cr, | |
| uint | pid | |||
| ) |
| bool HasSomeWeapon | ( | Critter@ | cr | ) |
Has a weapon in inventory or equipped.
| uint GetBestWeaponSkill | ( | Critter@ | cr | ) |
Gets the best weapon skill that a critter has.
| cr | Handle to critter. |
| void AddOnlinePlayer | ( | Critter& | cr | ) |
Add player to array of all online players.
| cr | Handle to critter. |
| void RemoveOnlinePlayer | ( | Critter& | cr | ) |
Remove player from array of all online players.
| cr | Handle to critter. |
| uint GetAllOnlinePlayers | ( | array< Critter@>& out | players | ) |
Retrieve all players that are online.
| players | Array to store player handles in. |
| uint GetNumberOfPlayersOnline | ( | ) |
Check how many players are online.
| uint GetAuthenticatedPlayers | ( | array< Critter@>& out | players | ) |
Retrieve all authenticated players that are online.
| players | Array to store player handles in. |
| uint GetAuthenticatedPlayers | ( | array< Critter@>& out | players, | |
| bool | ignorePriviledges | |||
| ) |
Gets critter that is best at some skill in the group.
| group | A group of critters. | |
| skill | Which skill. See _defines.fos for a list of skills. (SK_*) |
Retrieve a string showing target players access level.
| player | Target player. |
| string GetAuthString | ( | int | accesslevel | ) |
Retrieve a string showing target players access level.
| accesslevel | Access number. |
| bool CanRequestHelp | ( | Critter& | player | ) |
Check if target player can use +requesthelp.
| player | Target player. |
| void SetRequestedHelp | ( | Critter& | player | ) |
Disables the ability to use +requesthelp for some time.
| player | Target player. |
| void SetRequestedHelp | ( | Critter& | player, | |
| int | minutes | |||
| ) |
| Critter@ GetOnlineGM | ( | ) |
Retrieve a random GM.
If none is found, any authenticated (Admin) is picked.
| bool IsHumanoid | ( | Critter@ | cr | ) |
| void ClearEnemyStack | ( | Critter& | critter | ) |
Clear EnemyStack of target NPC.
| critter | Target NPC. |
| void ClearEnemyStacksOnMap | ( | Map@ | map | ) |
Clear all EnemyStacks of all NPCs on specified map.
| map | Target Map. |
| bool IsCurrentEnemy | ( | Critter& | cr, | |
| uint | targetId | |||
| ) |
Checks if a target with given id is the critter's enemy, based on the enemy stack and attack planes.
| string@ GetSafePlayerName | ( | uint | id | ) |
| uint GetGroupIndex | ( | Critter& | cr | ) |
| uint GetGroupIndex | ( | int | st | ) |
| void SetGroupIndex | ( | Critter& | cr, | |
| uint | val | |||
| ) |
Modifies data responsible for holding faction/group index.
| uint GetGroupRank | ( | Critter& | cr | ) |
| void SetGroupRank | ( | Critter& | cr, | |
| uint | val | |||
| ) |
| uint GetGroupMode | ( | Critter& | cr | ) |
| void SetGroupMode | ( | Critter& | cr, | |
| uint | val | |||
| ) |
| void SetGroupInfo | ( | Critter& | cr, | |
| uint | faction, | |||
| uint | rank, | |||
| uint | mode | |||
| ) |
| void SetGroupInfoPack | ( | Critter& | cr, | |
| uint | packInfo | |||
| ) |
| bool ReadPids | ( | array< int >& out | pids, | |
| bool | removeinvalid | |||
| ) |
Reads ITEMPID.H into supplied array.
| pids | Array to store read pids in. | |
| removeinvalid | Remove PIDs not used in the game. |
| void ReadDefines | ( | string@ | fileName, | |
| dictionary& | items, | |||
| array< string >@ | defines | |||
| ) |
Read values defined in the given file.
| fileName | Name of the file to read defines from. Relative path from the server application can be used. | |
| items | A dictionary to which the defines will be read into, the key is in string format, while the dictionary value is the define value. | |
| defines | A string array to which the defines will be read into. |
Gets info from line like this: define ITEM_PID number.
| line | A define line, example: "#define PID_ROCK (19)". | |
| spid | The parsed string will be stored in this variable. | |
| id | The parsed number will be stored in this variable. |
| int SkipWhitespaces | ( | const string& in | str, | |
| int | start | |||
| ) |
skips all whitespaces in string starting at start position
| str | The string used. | |
| start | The position in the string to start at. |
| int SkipNonWhitespaces | ( | const string& in | str, | |
| int | start | |||
| ) |
skips all non-whitespaces in string starting at start position
| str | The string used. | |
| start | The position in the string to start at. |
| bool IsParameterTag | ( | string& | str | ) |
Checks if a string containers a parameter tag.
Example: "-dir 0"
| str | The string used. |
Gets the string of a named parameter in an array of strings.
| arr | An array of strings (a sentance for example). | |
| parameter | The parameter tag to use. See IsParameterTag for more information. |
Returns the index of a string in an array of strings.
| arr | The array of strings to search. | |
| str | The string to look for. |
Concatenates the specified indexes of an array of strings to a string and returns it.
| startindex | Which index in the array to start at. | |
| stopindex | Which index in the array to stop at, if stopindex = -1 it means that it will run until the end of the array. |
| string GetMsgStr | ( | int | textMsg, | |
| uint | strNum | |||
| ) |
| void SetTurnBasedAvailability | ( | Location@ | loc | ) |
Sets turn based mode for all maps within the location.
| loc | Location handle. |
| bool IsEncounterMap | ( | Map@ | map | ) |
Checks if map is an encounter map.
| map | Map handle. |
| bool IsTown | ( | Map@ | map | ) |
Checks if map is a town map.
| map | Map handle. |
| uint GetMapType | ( | Map@ | map | ) |
Gets the type of a map.
| map | Map handle. |
Retrieve current location of a critter.
| critter | Critter handle. |
| string GetLocationName | ( | uint | locId | ) |
| void SetQuestGarbager | ( | uint | time, | |
| uint | playerid, | |||
| uint | locid, | |||
| uint | var, | |||
| uint | val | |||
| ) |
Sets the time and event to garbage the location, setting a given variable to given value when the location was present on event execution.
| time | Time to garbage, in real minutes, if 0 then default is taken | |
| playerid | Id of the player, the location owner | |
| locid | Id of the location | |
| var | Variable number to be set | |
| val | Value for the variable |
| void LockDoor | ( | uint | x, | |
| uint | y, | |||
| Map@ | map, | |||
| uint | complexity, | |||
| uint | lockid | |||
| ) |
Lock a door.
| x | X-position on map. | |
| y | Y-position on map. | |
| map | Map handle. | |
| complexity | Lock complexity. | |
| lockid | Id of the lock to use. The Id corresponds to the key that is needed to open the door. |
| void UnlockDoor | ( | uint | x, | |
| uint | y, | |||
| Map@ | map | |||
| ) |
Unlock a door.
| x | X-position on map. | |
| y | Y-position on map. | |
| map | Map handle. |
| int gcd | ( | int | a, | |
| int | b | |||
| ) |
| array<int> knapsack | ( | array< int > | weights, | |
| int | W | |||
| ) |
| IDateTime@ GetCurrentDateTime | ( | ) |
| string GetCurrentDateTimeString | ( | ) |
| string GetCurrentDateTimeString | ( | bool | date, | |
| bool | time | |||
| ) |
Retrieve container from a map, with Entire.
| map | Map handle. | |
| contpid | Itempid of the container to retrieve. | |
| entire | Which Entire to use for coordinates of the container (Entire has to be placed on the same hex as container in mapper) |
| bool TeleportCar | ( | Item@ | Car, | |
| uint | MapId | |||
| ) |
Teleport a car to some other map.
Transfer some items from target critter to a container on a specific map via Entire.
| map | Map handle. | |
| cr | Critter handle. | |
| contpid | Itempid of the container to transfer to. | |
| entid | Which Entire to use for coordinates of the container (Entire has to be placed on the same hex as container in mapper) | |
| itemtypes | Type of items to transfer from critter. ITEMTRANSFER_ALL or ITEMTRANSFER_WEAPONS is valid. |
| void ClearContainer | ( | Item@ | container | ) |
Deletes all items in specified container.
| container | Handle to target container. |
Move all items from a critter to a subcontainer of a container.
| crFrom | The critter which items are moved from. | |
| contTo | Target container. | |
| specid | Special Id of subcontainer, if 0, critter's Id is used. |
| int GetGvar | ( | uint | gvar | ) |
Wrapper function for retrieving the value of a GVAR (Global variable).
| gvar | Target GVAR. |
| void SetGvar | ( | uint | gvar, | |
| uint | value | |||
| ) |
Wrapper function for setting the value of a GVAR (Global variable).
| gvar | Target GVAR. | |
| value | Value to set. |
| int GetLLvar | ( | Location& | location, | |
| uint | llvar | |||
| ) |
| int GetLLvar | ( | uint | locationId, | |
| uint | llvar | |||
| ) |
| void SetLLvar | ( | Location& | location, | |
| uint | llvar, | |||
| uint | value | |||
| ) |
| int GetLMvar | ( | Map& | map, | |
| uint | lmvar | |||
| ) |
| int GetLMvar | ( | uint | mapId, | |
| uint | lmvar | |||
| ) |
| void SetLMvar | ( | Map& | map, | |
| uint | lmvar, | |||
| uint | value | |||
| ) |
| int GetLIvar | ( | Item& | item, | |
| uint | livar | |||
| ) |
| int GetLIvar | ( | uint | itemId, | |
| uint | livar | |||
| ) |
| void SetLIvar | ( | Item& | item, | |
| uint | livar, | |||
| uint | value | |||
| ) |
| int GetLvar | ( | Critter& | critter, | |
| uint | lvar | |||
| ) |
Wrapper function for retrieving the value of an LVAR (Local variable) from a critter.
| critter | Critter handle. | |
| lvar | LVAR to check. |
| int GetLvar | ( | uint | id, | |
| uint | lvar | |||
| ) |
Wrapper function for retrieving the value of an LVAR (Local variable) from a critter.
| id | Critter Id. | |
| lvar | LVAR to check. |
| int GetLvar | ( | uint | id, | |
| uint | lvar, | |||
| string& | typeShort | |||
| ) |
| void SetLvar | ( | Critter& | critter, | |
| uint | lvar, | |||
| uint | value | |||
| ) |
Wrapper function for setting the value of an LVAR (Local variable).
| critter | Critter handle. | |
| lvar | Target LVAR. | |
| value | Value to set. |
| void SetLvar | ( | uint | id, | |
| uint | lvar, | |||
| uint | value | |||
| ) |
Wrapper function for setting the value of an LVAR (Local variable).
| id | Critter Id. | |
| lvar | Target LVAR. | |
| value | Value to set. |
| int GetUvar | ( | uint | uvar, | |
| uint | masterid, | |||
| uint | slaveid | |||
| ) |
Wrapper function for retrieving the value of an UVAR ("Unicum" variable).
| uvar | Target UVAR. | |
| masterid | MasterId corresponding to some critter. | |
| slaveid | SlaveId corresponding to another critter. |
| void SetUvar | ( | uint | uvar, | |
| uint | masterid, | |||
| uint | slaveid, | |||
| uint | value | |||
| ) |
Wrapper function for setting the value of an UVAR ("Unicum" variable).
| uvar | Target UVAR. | |
| masterid | MasterId corresponding to some critter. | |
| slaveid | SlaveId corresponding to another critter. | |
| value | Value of the UVAR to set. |
| uint GetContainerValue | ( | Item@ | container | ) |
Uses BaseItemValue to deduce value of all items in a container.
| container | Target container. |
| uint BaseItemValue | ( | uint | pid, | |
| bool | ammo | |||
| ) |
base value of an spawned item with this pid (with 0% deterioration, unbroken)
| pid | Pid of an item. | |
| ammo | Is it ammo? |
| uint BaseItemValue | ( | uint | pid, | |
| uint | broken, | |||
| uint | det, | |||
| bool | ammo | |||
| ) |
base value of an spawned item with this pid (with det% deterioration, broken times broken)
| pid | Pid of an item. | |
| ammo | Is it ammo? | |
| broken | How many times the item was broken. | |
| det | % deterioration. |
| uint BaseItemValue | ( | Item@ | item | ) |
Full base value of an item, count included.
| item | Item handle. |
| uint BaseItemValue | ( | Item@ | item, | |
| uint | proc | |||
| ) |
proc% of base value of an item (ammo value is always 100%), count included
| item | Item handle. | |
| proc | Percentage of base value. |
| uint BaseSingleItemValue | ( | Item@ | item | ) |
full base value of an item, count NOT included.
| item | Item handle. |
| uint BaseSingleItemValue | ( | Item@ | item, | |
| uint | proc | |||
| ) |
proc% of base value of an item (ammo value is always 100%), count NOT included
| item | Item handle. | |
| proc | Percentage of value. |
| bool Pickable | ( | Item@ | item | ) |
1.7.1