Class Hierarchy |
Account | |||
---|---|---|---|
Explanation | |||
Object describing a player's game account | |||
Members | |||
Name | Type | Desc | Access |
banned | Boolean | true if banned | r/o |
defaultcmdlevel | Integer | the number for the accounts default command level | r/o |
enabled | Boolean | true if enabled | r/o |
name | String | the name of the account | r/o |
uo_expansion | String | used uo-expansion | r/o |
usernamepasswordhash | String | MD5 username+password hash string | r/o |
Methods | |||
Prototype | Returns | Desc | |
addcharacter(index) | nothing/error | If Index is 0 (.AddCharacter(0)), it will find the next available slot on the account. (Otherwise pass 1-5) Will create a naked, uncolored, male character named 'new character' at 1, 1, 1 on Britannia. No scripts are ran for this method of character creation. Edit this new character via the script creating it. | |
ban() | true | bans the account | |
checkpassword(string pass) | boolean/error | returns true if 'pass' is the account's password | |
delete() | true/error | Delete this empty account. | |
deletecharacter(integer slot) | true/error | Deletes character in slot 'slot'. returns error if not character in that slot (1..5) | |
disable() | true | disables the account | |
enable() | true | enables the account | |
eraseprop(string propname) | true | EraseObjProperty for account objects. | |
get_member(string membername) | object, value of member or error | Gets the value of the built-in member 'membername'. var objname := obj.get_member("name") is the same as var objname := obj.name" proto="get_member(string membername)" returns="object, value of member or error | |
getcharacter(integer slot) | true/OfflineCharacterRef | gets an OfflineCharacterRef for the character in slot 'slot'. returns error if not character in that slot (1..5) | |
getprop(string propname) | true/error | GetObjProperty for account objects. | |
move_char(string destacctname, integer slot) | true/error | Move character from this account to destination account. You can use it to flip chars on same account too. | |
propnames() | Array | returns an array of cprop names on this account | |
set_uo_expansion(string expansion) | true/error | This determines what flag is sent with packet 0xB9 during login (Nothing -> 0x0000 / T2A -> 0x0001 / LBR -> 0x0002 / AOS -> 0x801b / SE -> 0x805b / ML -> 0x80db / KR -> 0x86DB / SA -> 0x187DF / HSA -> 0x387DF / TOL -> 0x7387DF). It's possible to hook 0xB9 but don't forget to set_uo_expansion anyway because core uses this for internal flags (e.g. AoS Tooltips). The servspecopt.cfg UOFeatureEnable is used with packet 0xA9 and is currently global to all clients. Recognized values: TOL, HSA, SA, KR, ML, SE, AOS, LBR, T2A (default). | |
setdefaultcmdlevel(integer number) | true/error | Set the account's default command level. | |
setname(string newname, string newpass) | true/error | sets the account name to newname, password to newpass. The parameter newpass is only optional if you have clear text passwords (RetainCleartextPasswords) - which you shouldn't. | |
setpassword(string newpass) | true/error | sets the account password to newpass | |
setprop(string propname, propval) | true | SetObjProperty for account objects. | |
split(string newacctname, integer slot) | AccountRef/error | Create a new account and move character to it. On success returns a reference to the new account. | |
unban() | true | unbans the account |
Armor | |||
---|---|---|---|
Parent | |||
Equipment | |||
Explanation | |||
Equipable items that protect against damage in combat | |||
Members | |||
Name | Type | Desc | Access |
ar | Integer | Modified armor factor | r/o |
ar_base | Integer | Base armor factor (as in itemdesc.cfg) | r/o |
ar_mod | Integer | Armor factor modifier | r/w |
onhitscript | String | Script name that runs when armor is hit | r/w |
Array | |||
---|---|---|---|
Explanation | |||
Data structure for linear storage, dynamically resizes to fit more elements. Declare with var a := array; Pre-intialize with var a := array { 53, 76, 32 }; Note that functional methods (find, findIndex, filter, map, reduce) will return uninit on arrays that have named members, eg. an array where arr.+name has been used. | |||
Methods | |||
Prototype | Returns | Desc | |
+ array | array | concatinates 2 arrays | |
append(object) | true/error | inserts object in the end of the array | |
cycle([int count]) | true/error | will move array [count] steps backwards or forwards in-place as it were a conveyor belt. {1, 2, 3}.cycle() Will make it: {3, 1, 2}. Accepts a negative value as a shift to move different direction | |
erase(int index) | true/false | erases the element at index | |
exists(index) | error/int | Returns 1 if index is in array. | |
filter(FunctionObject testFn) | array |
Returns a new array containing just the elements that pass the test function. If no elements pass the test, an empty array is returned.testFn is a function that can accept up to three parameters:
|
|
find(FunctionObject testFn) | array |
Returns the first element in the provided array that satisfies the provided testing function. If no elements satisfy the testing function, <uninitialized object> is returned.testFn is a function that can accept up to three parameters:
|
|
findIndex(FunctionObject testFn) | integer |
Returns the index of the first element in an array that satisfies the provided testing function. If no elements satisfy the testing function, 0 is returned.testFn is a function that can accept up to three parameters:
|
|
insert(int index, object) | void/error | inserts a new object into the array at index | |
map(FunctionObject mapFn) | array |
Returns a new array populated with the results of calling a provided mapping function on every element in the calling array.mapFn is a function that can accept up to three parameters:
|
|
randomentry() | value/error | returns random array entry | |
reduce(FunctionObject reducerFn, [initialValue]) | any |
Executes a user-supplied reducer callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the array is a single value. The first time that the callback is run there is no 'return value of the previous calculation'. If supplied, an initial value may be used in its place. Otherwise the array element at index 1 is used as the initial value and iteration starts from the next element (index 2 instead of index 1).reducerFn is a function that can accept up to four parameters:
For additional examples and discussions, see Racalac's Escript Guide. |
|
reverse() | true | reverses the elements of the array | |
shrink(index) | true/error | erases index to end of array | |
size() | int | number of elements in the array | |
sort(int sub_index:=0) | true/error | sorts the elements of the array, or if sub_index is given sorts array of arrays using the given index for sorting | |
sorted_insert(obj, sub_index:=0, reverse:=0) | true/error | Inserts obj into already sorted array. sub_index and reverse parameter have to match the sorting criteria of the array. |
AuxConnection | |||
---|---|---|---|
Explanation | |||
An object passed to an Aux Service Script that allows the script to transmit and recieve packed data over a TCP/IP port. use wait_for_event() in the service script to recieve data. | |||
Members | |||
Name | Type | Desc | Access |
ip | String | Originating IP on the AuxConnection Pipe | r/o |
Methods | |||
Prototype | Returns | Desc | |
transmit(object o) | error/0 | Transmits the packable object 'o' over the Aux connection. If the connection script has the AUXSVC_ASSUME_STRING script option, then the parameter object o is sent as a string and not unpacked. If the Aux Connection was created with the ignore_line_breaks option, then a CRLF will not be appended to the message. |
BinaryFile | |||
---|---|---|---|
Explanation | |||
Object representing a binaryfile. | |||
Methods | |||
Prototype | Returns | Desc | |
Close() | integer | Closes the underlying stream. | |
Flush() | integer | Writes all unwritten chars from buffer to file. | |
GetInt16() | integer/error | Gets unsigned 16-bit (2 byte) value. | |
GetInt32() | integer/error | Gets unsigned 32-bit (4 byte) value. | |
GetInt8() | integer/error | Gets unsigned 8-bit (1 byte) value. | |
GetSInt16() | integer/error | Gets signed 16-bit (2 byte) value. | |
GetSInt32() | integer/error | Gets signed 32-bit (4 byte) value. | |
GetSInt8() | integer/error | Gets signed 8-bit (1 byte) value. | |
GetString(int length) | string/error | Gets a string (1-byte characters) for length characters. | |
Peek() | integer/error | Reads and returns the next byte without extracting it (-1 if eof is reached). | |
Seek(int offset, int seekdir) | integer/error | Seeks to position. See file.em constants for seekdir | |
SetInt16() | 1/error | Sets unsigned 16-bit (2 byte) value. | |
SetInt32() | 1/error | Sets unsigned 32-bit (4 byte) value. | |
SetInt8() | 1/error | Sets unsigned 8-bit (1 byte) value. | |
SetSInt16() | 1/error | Sets signed 16-bit (2 byte) value. | |
SetSInt32() | 1/error | Sets signed 32-bit (4 byte) value. | |
SetSInt8() | 1/error | Sets signed 8-bit (1 byte) value. | |
SetString(string string, int nullterminate) | 1/error | Sets a string. Set nullterminate to 1 if you want to automatically append a 0 terminator. | |
Size() | integer/error | Returns filesize in bytes. | |
Tell() | integer/error | Returns current position. |
Boat | |||
---|---|---|---|
Parent | |||
Multi | |||
Explanation | |||
A Multi object that moves in water. | |||
Members | |||
Name | Type | Desc | Access |
components | Array | array of ItemRefs of all the components on the boat | r/o |
has_offline_mobiles | Boolean | true if players are logged out on the deck | r/o |
hold | Item | ItemRef to the hold container item | r/o |
hull | Array | array of ItemRefs of all the hull components on the boat, or empty array if none | r/o |
items | Array | Array of Item References on the deck of the boat | r/o |
mobiles | Array | Array of Character References on the deck | r/o |
multiid | Integer | id for this kind of multi | r/o |
pilot | Character | pilot of boat (if any) | r/o |
portplank | Item | ItemRef to the left-side plank item | r/o |
rope | Array | array of ItemRefs of all the rope components on the boat, or empty array if none | r/o |
rudder | Array | array of ItemRefs of all the rudder components on the boat, or empty array if none | r/o |
sails | Array | array of ItemRefs of all the sails components on the boat, or empty array if none | r/o |
starboardplank | Item | ItemRef to the right-side plank item | r/o |
storage | Array | array of ItemRefs of all the storage components on the boat, or empty array if none | r/o |
tiller | Array | array of ItemRefs of all the tiller components on the boat, or empty array if none | r/o |
tillerman | Item | ItemRef to the tillerman item | r/o |
weaponslot | Array | array of ItemRefs of all the weaponslot components on the boat, or empty array if none | r/o |
wheel | Array | array of ItemRefs of all the wheel components on the boat, or empty array if none | r/o |
Methods | |||
Prototype | Returns | Desc | |
move_offline_mobiles(int x, int y, int z[, string realm]) | true/false | moves offline mobiles on boat to x,y,z. If realm is not set, Boat-realm is used. | |
set_alternate_multiid(int) | true/error | Used to change a boat's multi to an alternative multi defined in its itemdesc file. Alternate ids are referenced with an integer based on the order they are defined in the itemdesc file starting from 1, with the base multi id being 0. | |
set_pilot(Character | 0) | true/false | Sets the boat pilot to the provided character; removes pilot if 0 is passed. Mouse movements from the boat's pilot will be sent to the boat's control script. See event SYSEVENT_BOAT_MOVEMENT for more details. Possible errors: The boat is already being piloted; The boat does not have a running process; That character is not connected; The boat does not have that character on it; The boat mount piece is not equippable by that character; The client for that character does not support High Seas Adventure |
Boolean | |||
---|---|---|---|
Explanation | |||
Object representing a boolean value, only comparison operators ==, !=, ! are implemented. Can be stored in cprops/datafiles. |
Character | |||
---|---|---|---|
Parent | |||
UObject | |||
Children | |||
NPC | |||
Explanation | |||
A mobile object that exists in the world (NPC or player character) | |||
Members | |||
Name | Type | Desc | Access |
acct | Account | Account Reference (if not NPC) (deprecated, will be removed in next release, use Client instead) | r/o |
acctname | String | Account name string (if not NPC) | r/o |
active_skill | Boolean | 1 if character has an active attached skill script | r/o |
aggressorto | Array | list of mobiles this character is flagged as aggressor on repsys | r/o |
ar | Integer | Total armor factor. If it's an NPC without armor equipped, it will return its intrinsic armor value taken from NpcDesc AR entry. | r/o |
ar_mod | Integer | Armor factor modifier | r/w |
attached | Script | Script reference for attached script | r/o |
backpack | Item | Reference to character's pack (if any) | r/o |
buffs | dictionary | Returns the current active buffs added via addBuff as dictionary. Key is the iconid and value a struct struct{name_cliloc, desc_cliloc, end_time, name_args, desc_args}. | r/o |
candidate_of_party | Party | party object reference | r/o |
carrying_capacity | Integer | Current carrying capacity. Defined as (40 + 3.5*chr.strength + chr.carrying_capacity_mod)*ssopt.carrying_capacity_mod. Note that characters can go above their carrying capacity, but will run out of stamina much faster. | r/o |
carrying_capacity_mod | Integer | Carrying capacity modifier. Is taken into account prior to global ssopt modifier. | r/w |
casting_spell | Bool | 1 if character has an active attached spell script | r/o |
client | Client | returns ClientRef object or error | r/o |
clientinfo | Struct | UO Client information struct (check out core-changes.txt for an example) (deprecated, will be removed in next release, use Client instead) | r/o |
clienttype | Integer | clientversion type bitfield (deprecated, will be removed in next release, use Client instead) | r/o |
clientver_detail | Struct | UO Client version string as Struct of Ints {major;minor;rev;patch} (deprecated, will be removed in next release, use Client instead) | r/o |
clientversion | String | UO Client version string | r/o |
cmdlevel | Integer | command level of character | r/w |
cmdlevelstr | String | string name of command level | r/o |
concealed | Integer | concealed below this value cannot see | r/w |
connected | Boolean | To determine if the character is actively connected to the game. Is set to 1 before logon/reconnect scripts are run and 0 right before logofftest is run. Will return 1 on NPC. | r/o |
createdat | Integer | PolClock when character was created | r/o |
criminal | Integer | 1 = player is temporally criminal (gray) or murderer (red) (see also temporally_criminal) | r/o |
cursor | Boolean | True if the client has an active target cursor | r/o |
damage_cold | Integer | Total AOS+ damage factor. | r/o |
damage_cold_mod | Integer | AOS+ damage modifier | r/w |
damage_energy | Integer | Total AOS+ damage factor. | r/o |
damage_energy_mod | Integer | AOS+ damage modifier | r/w |
damage_fire | Integer | Total AOS+ damage factor. | r/o |
damage_fire_mod | Integer | AOS+ damage modifier | r/w |
damage_physical | Integer | Total AOS+ damage factor. | r/o |
damage_physical_mod | Integer | AOS+ damage modifier | r/w |
damage_poison | Integer | Total AOS+ damage factor. | r/o |
damage_poison_mod | Integer | AOS+ damage modifier | r/w |
dead | Integer | 1 = player is dead | r/o |
deafed | Integer | 1 = player cannot hear | r/o |
defence_increase | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
defence_increase_cap | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
defence_increase_cap_mod | Integer | Modifier for property, added to base property. | r/w |
defence_increase_mod | Integer | Modifier for property, added to base property. | r/w |
delay_mod | Integer | Weapon Delay modifier, milliseconds | r/w |
evasionchance_mod | Integer | Subtractive modificator of the hitchance from the defender (+- int in thousandth) | r/w |
faster_cast_recovery | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
faster_cast_recovery_mod | Integer | Modifier for property, added to base property. | r/w |
faster_casting | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
faster_casting_mod | Integer | Modifier for property, added to base property. | r/w |
followers | Integer | This is for storage for the Followers byte in statmsg packet, default 0 | r/w |
followers_max | Integer | Max followers for statmsg packet, default 0 | r/w |
frozen | Boolean | 1 = player is frozen (by a GM) | r/w |
gender | Integer | 0=male 1=female | r/w |
gold | Integer | Amount of gold in character's pack | r/o |
guild | Guild | guild object reference | r/o |
guildid | Integer | guild ID number | r/o |
gump | Boolean | True if the client has any active gumps from SendGump | r/o |
hidden | Boolean | 1 = normal players cannot see | r/w |
hit_chance | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
hit_chance_mod | Integer | Modifier for property, added to base property. | r/w |
hitchance_mod | Integer | Additive modificator of the hitchance from the attacker (+- int in thousandth) | r/w |
house_editing | Boolean | 1 if character is currently editing an house | r/o |
ip | String | IP Address string (deprecated, will be removed in next release, use Client instead) | r/o |
last_textcolor | Struct | last text color used by the character. Values are between 2 and 1001. Returns 0 if not yet spoken. (will not be saved inside of the datafile) | r/o |
lastcoord | Struct | position before the last walk packet as struct{lastx,lasty,lastz} | r/o |
lawfullydamaged | Array | list of mobiles this character is flagged as lawfully damaged on repsys | r/o |
lower_mana_cost | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
lower_mana_cost_mod | Integer | Modifier for property, added to base property. | r/w |
lower_reagent_cost | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
lower_reagent_cost_mod | Integer | Modifier for property, added to base property. | r/w |
luck | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
luck_mod | Integer | Modifier for property, added to base property. | r/w |
max_attack_range_increase | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. Max attack Range Increase is used as a numeric modifier to the maximum range of a weapon, e.g. Weapon maximum range of 3 + max attack range increase of 2 would make the maximum attack range 5. | r/o |
max_attack_range_increase_mod | Integer | Modifier for property, added to base property. | r/w |
min_attack_range_increase | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. Min attack Range Increase is used as a numeric modifier to the minimum range of a weapon, e.g. Weapon minimum range of 1 + min attack range increase of 1 would make the minimum attack range 2. | r/o |
min_attack_range_increase_mod | Integer | Modifier for property, added to base property. | r/w |
mountedsteps | Integer | number of steps taken while character was mounted | r/w |
movecost_run_mod | Double | multiplier for stamina consum on movement | r/w |
movecost_run_mounted_mod | Double | multiplier for stamina consum on movement | r/w |
movecost_walk_mod | Double | multiplier for stamina consum on movement | r/w |
movecost_walk_mounted_mod | Double | multiplier for stamina consum on movement | r/w |
moved_at | Double | MilliSecondClock when character last moved due to walking/running | r/o |
movemode | String | movemode string {default 'L'} like from NPCDesc.cfg | r/o |
murderer | Boolean | 1 = player flagged murderer (red) | r/w |
opponent | MobileRef | Mobile reference if a combat opponent is selected. | r/o |
paralyzed | Boolean | 1 = player is paralyzed | r/w |
parrychance_mod | Integer | Additive modificator of the parry_chance from the defender (+- int in thousandth) | r/w |
party | Party | party object reference | r/o |
partycanloot | Boolean | True if client has set the loot rights | r/o |
poisoned | Boolean | 1 = player is poisoned, just makes the health bar green or not | r/w |
position_changed_at | Double | MilliSecondClock when character last changed position for any reason | r/o |
prompt | Boolean | True if the client has any active String or Unicode prompt windows | r/o |
race | Integer | Set/get the ML/SA race (new constants in UO.EM: RACE_HUMAN, RACE_ELF,RACE_GARGOYLE). You have to set visual graphic by yourself if you change value (Human male/female = 0x190/0x191 / Elf male/female = 0x25d/0x25e / Gargoyle male/female = 0x029a/0x029b). You can choose Race at Char creation if your UOExpansion and UOFeature settings fit. | r/w |
reportables | Array | (reputation system) Array of Structs: { serial, killer, gameclock }, serial = killer's serial, killer = 'offline mobile reference' to the killer, gameclock = game time when the death occurred | r/o |
resist_cold | Integer | Total AOS+ armor factor. If it's an NPC without armor equipped, it will return its intrinsic armor value taken from NpcDesc AR entry. | r/o |
resist_cold_cap | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
resist_cold_cap_mod | Integer | Modifier for property, added to base property. | r/w |
resist_cold_mod | Integer | AOS+ Armor factor modifier (Player) | r/w |
resist_energy | Integer | Total AOS+ armor factor. If it's an NPC without armor equipped, it will return its intrinsic armor value taken from NpcDesc AR entry. | r/o |
resist_energy_cap | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
resist_energy_cap_mod | Integer | Modifier for property, added to base property. | r/w |
resist_energy_mod | Integer | AOS+ Armor factor modifier (Player) | r/w |
resist_fire | Integer | Total AOS+ armor factor. If it's an NPC without armor equipped, it will return its intrinsic armor value taken from NpcDesc AR entry. | r/o |
resist_fire_cap | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
resist_fire_cap_mod | Integer | Modifier for property, added to base property. | r/w |
resist_fire_mod | Integer | AOS+ Armor factor modifier (Player) | r/w |
resist_physical | Integer | Total AOS+ armor factor. If it's an NPC without armor equipped, it will return its intrinsic armor value taken from NpcDesc AR entry. | r/o |
resist_physical_cap | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
resist_physical_cap_mod | Integer | Modifier for property, added to base property. | r/w |
resist_physical_mod | Integer | AOS+ Armor factor modifier (Player) | r/w |
resist_poison | Integer | Total AOS+ armor factor. If it's an NPC without armor equipped, it will return its intrinsic armor value taken from NpcDesc AR entry. | r/o |
resist_poison_cap | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
resist_poison_cap_mod | Integer | Modifier for property, added to base property. | r/w |
resist_poison_mod | Integer | AOS+ Armor factor modifier (Player) | r/w |
shield | Armor | Returns the ItemRef of the sheild, if any, is worn. | r/o |
skillcap | Integer | This is for storage of overall skillcap, default 700 | r/w |
spell_damage_increase | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. | r/o |
spell_damage_increase_mod | Integer | Modifier for property, added to base property. | r/w |
squelched | Integer | 1 = player cannot speak | r/o |
statcap | Integer | AOS+ Statcap entry in statusbar, default 255 | r/w |
stealthsteps | Integer | number of walk steps left until player is revealed | r/w |
swing_speed_increase | Integer | Total calculation of all modifiers from items equipt plus personal modifier and personal base. Swing Speed Increase is used as a % modifier to the calculated speed of a weapon, e.g. Weapon speed of 30 * swing speed increase of 100% would make the swing speed 60. | r/o |
swing_speed_increase_mod | Integer | Modifier for property, added to base property. | r/w |
temporally_criminal | Integer | 1 = player is temporally criminal (gray) (see also criminal) | r/o |
tithing | Integer | Tithing for statmsg packet, default 0 | r/w |
title_guild | String | String guild title i.e. [ROX, super d00d] Racalac | r/w |
title_prefix | String | String placed before name i.e. Lord Racalac | r/w |
title_race | String | String race title after suffix in paperdoll | r/w |
title_suffix | String | String placed after name i.e. Racalac the Brave | r/w |
tradewindow | Container | Reference to the trade container if the char has an active trade, error if no active trade | r/o |
trading_with | Character | Reference to character they are trading with (if any) | r/o |
truecolor | Integer | original color | r/w |
trueobjtype | Integer | original objtype | r/w |
uclang | String | Reports the Unicode Language string client sends during logon. | r/o |
uo_expansion_client | Integer | client send expansion info flag (deprecated, will be removed in next release, use Client instead) | r/o |
warmode | Integer | 1 if in warmode | r/o |
weapon | Item | Reference to character's weapon (if any) | r/o |
Methods | |||
Prototype | Returns | Desc | |
addBuff(int icon_id, int duration, int cliloc_name, int cliloc_descr, string arguments_desc, [string arguments_name]) | true/error | Adds a buff to Character's buff bar. Duration is in seconds: countdown is done by the client, but the icon is never automatically removed. Arguments is an Unicode string; separated by a single tab character. Example: who.addBuff(1029, 30, 1075814, 1075815, "1234 5678"); Optional arguments_name parameters needs a client higher then 5.x and modifies the cliloc_name. | |
attack_once([MobileRef opp]) | true/error | Attacks once without modifing the swingtimer. If no opp is given attacks current attackable opponent, else attacks given opponent (but checks if still attackable) | |
clearAggressorTo(MobileRef chr) | true/error | clears aggressor entry for given chr | |
clearBuffs() | true/error | Removes all buffs from Character's buff bar. | |
clearLawfullydamagedTo(MobileRef chr) | true/error | clears lawfullydamaged entry for given chr | |
cleargottenitem() | true/error | Returns 'dragged' item to original location. | |
compareversion(string Version) | true/false | true if Client Version >= given Versionstring | |
deaf(int duration) | int/error | character cannot hear for 'duration' seconds. -1 means forever. 0 clears the deaf | |
delBuff(int icon_id) | true/error | Removes a buff from Character's buff bar. | |
disable(string setting) | true | disables the 'granted' privilege to the character | |
disableSkillsFor(int duration) | duration/error | Disables skill scripts for given seconds | |
enable(string setting) | true/error | enables the 'granted' privilege to the character | |
enabled(string setting) | true/false | true if the privilege is enabled | |
getcorpse() | Corpse | Returns an item reference to the most recent corpse made. | |
getgottenitem() | error/ItemRef | returns an ItemRef to the item held on the player's cursor, if any. | |
kill([MobileRef killer]) | true | Kills character ignoring invul, if killer is set repsys:OnDamage is called | |
privileges() | dictionary | Dictionary where keys are privilege name, value is 0/1 boolean. | |
removereportable(int serial, int gameclock) | true/error | removes the killer with 'serial' from the reportables list that was added at 'gameclock' | |
setAggressorTo(MobileRef chr) | true/error | sets aggressor for repsys.cfg:AggressorFlagTimeout seconds for given chr | |
setLawfullydamagedTo(MobileRef chr) | true/error | sets lawfullydamaged for repsys.cfg:AggressorFlagTimeout seconds for given chr | |
setcmdlevel(string cmdlevel) | true/error | grants the command level to the char as defined in cmds.cfg | |
setcriminal(int level) | true/error | sets the character criminal. level multiplies the CriminalFlagInterval as defined in repsys.cfg. level=0 clears criminal timer. | |
setfacing(string/int direction, flags := FACE_NORMAL) | true/error | Sets Facing to given direction. If FACE_FORCE is set frozen/paralysed is not checked | |
setlightlevel(int level, int duration) | true | sets the light level of the character to 'level' for 'duration' seconds | |
setmurderer(bool) | true/error | flags the character as a murderer (red) | |
setparalyzed(bool) | true/error | sets the character paralyzed, controller of calling script is flagged as in repsystem | |
setpoisoned(bool) | true/error | sets the character poisoned, controller of calling script is flagged as in repsystem | |
setseason(int season_id,int playsound ) | int/error | Used to send the Season packet 0xBC to a single character, doesnt resend the lightlevel or weather. | |
setswingtimer(int time) | true/error | If opponent is set sets swingtimer to given ms time. | |
setwarmode(boolean) | integer/error | Sets the internal warmode flag and sends the update to the player. Returns the new warmode value. | |
spendgold(int amount) | true/error | if enough gold, removes it from the player's pack | |
squelch(int duration) | int/error | character cannot talk for 'duration' seconds. -1 means forever. 0 clears the squelch |
ClassInstanceRef | |||
---|---|---|---|
Explanation | |||
A reference to an Escript class instance, created via calling a class constructor via ClassName() or @ClassName.new(). A class instance behaves similarly like a Struct, and can have string members attached to it. | |||
Methods | |||
Prototype | Returns | Desc | |
<script function name>(...) | unspecified | A class instance has methods for each instance method defined for the class. See the Escript guide for more information. | |
.+member | n/a | add member | |
.-member | n/a | removes a member | |
.?member | int | returns count of matching member | |
.member | value | gets value of member | |
[member] | value | gets value of member ONLY when member is a string |
Client | |||
---|---|---|---|
Explanation | |||
Object representing a connected client. The ClientRef is important when having packethooks which are active before characters are selected, when you only have access to the Client and not the Character. Because the ClientRef contains most information that was in the Character before, it becomes redundant to have those methods and properties in the Character and they will be removed in a future release. | |||
Members | |||
Name | Type | Desc | Access |
acct | Account | Account reference | r/o |
acctname | String | Account name string | r/o |
clientinfo | Struct | UO Client information struct (check out core-changes.txt for an example) | r/o |
clienttype | Integer | clientversion type bitfield | r/o |
clientver_detail | Struct | UO Client version string as Struct of Ints {major;minor;rev;patch} | r/o |
clientversion | String | UO Client version string | r/o |
disable_inactivity_timeout | Boolean | If true, client will not be disconnected due to inactivity. | r/w |
ip | String | IP Address string | r/o |
last_activity_at | Integer | POL clock when last activity has been made | r/o |
last_packet_at | Integer | POL clock when last packet has been received | r/o |
port | Integer | connected listen port | r/o |
uo_expansion_client | Integer | client send expansion info flag | r/o |
visual_range | Integer | returns the client setting of visual range, or overwrites the current range. If set to 0 the client given range will be used. As long as the visual range is set via script the client can no longer modify the range. VisualRangeMin/Max limit is not taken into account. |
r/w |
Methods | |||
Prototype | Returns | Desc | |
compareversion(string Version) | true/false | true if Client Version >= given Versionstring |
Container | |||
---|---|---|---|
Parent | |||
Lockable | |||
Children | |||
Corpse | |||
Spellbook | |||
Explanation | |||
Items that can be locked, and have other items inside them | |||
Members | |||
Name | Type | Desc | Access |
held_weight_multiplier | Double | Multiplicative modifier when calculating the container's held weight. For example, on an backpack (having weight 3 stones) that contains items totalling a weight of 100 stone, setting this property to 0.5 would have the backpack weigh 53 (3 + 100 * 0.5) stone. | r/w |
max_items_mod | Integer | from -32768 to 32767, modifier for max items allowed in the container | r/w |
max_slots_mod | Integer | from -32768 to 32767, modifier for max slots allowed in the container | r/w |
max_weight_mod | Integer | from -32768 to 32767, modifier for max weight allowed in the container | r/w |
no_drop_exception | Boolean | defines if npc is a valid target even if no_drop is set for the item | r/w |
DataFileElement | |||
---|---|---|---|
Explanation | |||
A data element inside a datastore file | |||
Methods | |||
Prototype | Returns | Desc | |
EraseProp(string propname) | true/error | Erases the property named 'propname' | |
GetProp(string propname) | script object/error | Returns an unpacked script object (i.e. int,string,array,etc) | |
PropNames() | array | Returns an array of property name strings | |
SetProp(string propname, object propvalue) | true/error | Sets a packable object to a property |
Datafile | |||
---|---|---|---|
Explanation | |||
Object representing a data file in a data store | |||
Methods | |||
Prototype | Returns | Desc | |
CreateElement(key) | error/DataFileElemRef | key is int or string, depending on datafile flags | |
DeleteElement(key) | error/true | see key notes above | |
FindElement(key) | error/DataFileElemRef | see key notes above | |
Keys() | array | array of ints or strings, depending on datafile flags |
Dictionary | |||
---|---|---|---|
Explanation | |||
Data structure for key->value pairs (i.e."associative array"). Keys may be intgers, strings, reals, mobrefs, or itemrefs. Declare with var d := dictionary. Pre-intialize with var d := dictionary { "abx" -> 72, "xyz" -> 32 }; | |||
Methods | |||
Prototype | Returns | Desc | |
[key] | value | gets value at key, or uninit if key doesn't exist | |
erase(key) | true/error | erases a pair from the dict | |
exists(key) | error/int | if exists, returns count of matching key | |
insert(key, value) | error/int | inserts a pair into the dict, returns new size | |
keys() | array | returns an array of the keys | |
size() | int | number of pairs in dictionary |
Error | |||
---|---|---|---|
Explanation | |||
An object representing a script error. Comparing this object against the keyword 'error' allows the scripter to know if the result of a core function was an error. It always evaluates as false in boolean contexts. Declare with var e := error; Pre-intialize with var e := error { errortext := "error message" }; | |||
Members | |||
Name | Type | Desc | Access |
errortext | String | Informational Error string | r/w |
ExportedScript | |||
---|---|---|---|
Explanation | |||
Object representing a script loaded via OS::LoadExportedScript(). The script will be alive as long as the object exists. | |||
Members | |||
Name | Type | Desc | Access |
exported_functions | Array of Strings | Returns names of all exported functions. | r/o |
Methods | |||
Prototype | Returns | Desc | |
call(function name, [array of args]) | Object/Error | Calls the given function with the optional arguments and returns the function return value. Calling script will be blocked until the function returns and will be executed non-critical or critical depending on the calling script. |
FunctionObject | |||
---|---|---|---|
Explanation | |||
Object representing a function. Created via "var f:=@myfunc;" Object can be copied inside the same script, but cannot be stored in cprops or transfered to a different script. | |||
Methods | |||
Prototype | Returns | Desc | |
call(...) | unspecified | Calls the underlying function, arguments and return value are the same as the original function. | |
new(...) | ClassInstanceRef | Returns a new instance of a class whose constructor is this FunctionObject , calling the class constructor function with a new this instance. |
Guild | |||
---|---|---|---|
Explanation | |||
Object representing a player guild association | |||
Members | |||
Name | Type | Desc | Access |
allyguilds | Array | Array of GuildRefs who are allied guilds | r/o |
enemyguilds | Array | Array of GuildRefs who are enemy guilds | r/o |
guildid | Integer | Guild ID number | r/o |
members | Array | Array of Character Refs who are guild members | r/o |
Methods | |||
Prototype | Returns | Desc | |
addallyguild(GuildRef) | true/error | adds an ally guild | |
addenemyguild(GuildRef) | true/error | adds an enemy guild | |
addmember(CharacterRef) | true/error | adds a character to the guild | |
eraseprop(string propname) | true/error | Erases the property named 'propname'. | |
getprop(string propname) | script object/error | Returns an unpacked script object (i.e. int,string,array,etc) | |
isallyguild(GuildRef) | true/error | true if the guild is an ally | |
isenemyguild(GuildRef) | true/error | true if the guild is an enemy | |
ismember(Character) | error/true | true if the character is a member of the guild | |
propnames() | Array | Returns an array of property name strings. | |
removeallyguild(GuildRef) | true/error | removes an ally guild | |
removeenemyguild(GuildRef) | true/error | removes an enemy guild | |
removemember(CharacterRef) | true/error | removes a character member | |
setprop(string propname, object propval) | true/error | Sets a packable object to a property. |
House | |||
---|---|---|---|
Parent | |||
Multi | |||
Explanation | |||
A Multi object where players hoard items. | |||
Members | |||
Name | Type | Desc | Access |
components | Array | Array of House components, i.e. sign, doors | r/o |
custom | Boolean | 1 = custom house | r/o |
house_editing | Boolean | 1 if the house is currently being edited | r/o |
house_parts | Integer | returns array of structs{graphic,xoffset,yoffset,z} or error if not a custom house. When in edit mode returns the current working design. To get the real coords from an elem add house.x/y | r/o |
items | Array | Array of Item References in the house | r/o |
mobiles | Array | Array of Character References in the house | r/o |
multiid | Integer | id for this kind of multi | r/o |
Methods | |||
Prototype | Returns | Desc | |
acceptcommit(Character chr, bool commit) | true/error | If commit is 0 then drops the not committed custom house changes or accept them instead | |
add_component(ItemRef) | true/error | Add item to House components | |
addhousepart(int graphic, int xoffset, int yoffset, int z) | true/error | Adds a part to the custom house design. | |
cancelediting(Character chr, bool drop_changes) | true/error | Stops editing mode. If drop_changes is true, drops all non committed changes | |
erase_component(ItemRef) | true/error | Erase item from House components | |
erasehousepart(int graphic, int xoffset, int yoffset, int z) | true/error | Removes a part from the custom house design. | |
set_multiid(int multiid | string name, [flags]) | true/error |
Set the multi's multiid , changing its shape. If
name is passed, will use the MultiID as defined by that item
descriptor. Uses the same flags as CreateMultiAtLocation() and
can return the same errors. To either keep or recreate the components (eg.
doors, house signs, ...), pass either CRMULTI_KEEP_COMPONENTS
or CRMULTI_RECREATE_COMPONENTS respectively. See module function
CreateMultiAtLocation in uo.em for more information.
|
|
setcustom(bool custom) | true/error | Sets the house as custom. Setting to 1 is needed before SendHousingTool() works. |
Item | |||
---|---|---|---|
Parent | |||
UObject | |||
Children | |||
Equipment | |||
Lockable | |||
Map | |||
Multi | |||
Explanation | |||
Represents a physical item in the world. | |||
Members | |||
Name | Type | Desc | Access |
amount | Integer | stack size | r/o |
buyprice | Integer | Amount of gold an NPC buys this item for. 0=not for sale, -1=itemdesc default. | r/w |
character_owner | OfflineCharacterRef | Returns Character that owns the item, ie. the character whose backpack or equipped items contains the item. | r/o |
container | Item | item contained in | r/o |
cursed | Boolean | true if item is cursed; does not have any special core handling other than preventing cursed and non-cursed items from stacking together. | r/w |
damage_cold | Integer | Total AOS+ damage factor. | r/o |
damage_cold_mod | Integer | AOS+ damage modifier | r/w |
damage_energy | Integer | Total AOS+ damage factor. | r/o |
damage_energy_mod | Integer | AOS+ damage modifier | r/w |
damage_fire | Integer | Total AOS+ damage factor. | r/o |
damage_fire_mod | Integer | AOS+ damage modifier | r/w |
damage_physical | Integer | Total AOS+ damage factor. | r/o |
damage_physical_mod | Integer | AOS+ damage modifier | r/w |
damage_poison | Integer | Total AOS+ damage factor. | r/o |
damage_poison_mod | Integer | AOS+ damage modifier | r/w |
decayat | Integer | game clock value after which this item might decay. 0=do not decay | r/w |
defence_increase | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
defence_increase_cap | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
defence_increase_cap_mod | Integer | Modifier for property, added to base of the object. | r/w |
defence_increase_mod | Integer | Modifier for property, added to base of the object. | r/w |
desc | String | single click description string (formatted name and suffix added to it without formatting if it exists) | r/o |
doubleclickrange | Integer | Max distance for using this item | r/o |
equipscript | String | script run when item equipped on a character | r/w |
faster_cast_recovery | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
faster_cast_recovery_mod | Integer | Modifier for property, added to base of the object. | r/w |
faster_casting | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
faster_casting_mod | Integer | Modifier for property, added to base of the object. | r/w |
getgottenby | Character | Returns CharRef of Player holding item, Error if not being held | r/o |
hit_chance | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
hit_chance_mod | Integer | Modifier for property, added to base of the object. | r/w |
house | House | Returns a reference to the House this item is component of, if any | r/o |
hp | Integer | Hit points of item | r/w |
insured | Boolean | like newbie, but it gets reset to 0 whenever it saves an item from dropping | r/w |
invisible | Boolean | true if the item is invisible | r/w |
item_count | Integer | number of items in container including the container itself (1 if this item is not a container or an empty container) | r/o |
layer | Integer | equipment layer | r/o |
lower_mana_cost | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
lower_mana_cost_mod | Integer | Modifier for property, added to base of the object. | r/w |
lower_reagent_cost | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
lower_reagent_cost_mod | Integer | Modifier for property, added to base of the object. | r/w |
luck | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
luck_mod | Integer | Modifier for property, added to base of the object. | r/w |
max_attack_range_increase | Integer | Total of base property plus mod, applied to characters when equipt. Adjusts the maximum attack range of a player by the total number of all modifiers e.g. weapons base maximum attack range of 3 + max attack range increase of 2 means a final attack range of 5. | r/o |
max_attack_range_increase_mod | Integer | Modifier of property, added to the base of the object. | r/w |
maxhp | Integer | Maximum Hit Points of item | r/o |
maxhp_mod | Integer | Maximum Hit Point modification | r/w |
min_attack_range_increase | Integer | Total of base property plus mod, applied to characters when equipt. Adjusts the minimum attack range of a player by the total number of all modifiers e.g. weapons base minimum attack range of 1 + min attack range increase of 1 means a final minimum attack range of 2. | r/o |
min_attack_range_increase_mod | Integer | Modifier of property, added to the base of the object. | r/w |
movable | Boolean | true if player may move the item | r/w |
name_suffix | String | For adding crafter marks or such, will be appended to desc | r/w |
newbie | Boolean | true if the item remains with the ghost when player dies | r/w |
no_drop | Boolean | If set no drop of this item is allowed, except no_drop_exception is set for target | r/w |
process | Script | Control script reference, error on none | r/o |
quality | Double | 1.0=Average and default | r/w |
resist_cold | Integer | Total AOS+ armor factor. | r/o |
resist_cold_cap | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
resist_cold_cap_mod | Integer | Modifier for property, added to base of the object. | r/w |
resist_cold_mod | Integer | AOS+ Armor factor modifier | r/w |
resist_energy | Integer | Total AOS+ armor factor. | r/o |
resist_energy_cap | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
resist_energy_cap_mod | Integer | Modifier for property, added to base of the object. | r/w |
resist_energy_mod | Integer | AOS+ Armor factor modifier | r/w |
resist_fire | Integer | Total AOS+ armor factor. | r/o |
resist_fire_cap | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
resist_fire_cap_mod | Integer | Modifier for property, added to base of the object. | r/w |
resist_fire_mod | Integer | AOS+ Armor factor modifier | r/w |
resist_physical | Integer | Total AOS+ armor factor. | r/o |
resist_physical_cap | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
resist_physical_cap_mod | Integer | Modifier for property, added to base of the object. | r/w |
resist_physical_mod | Integer | AOS+ Armor factor modifier | r/w |
resist_poison | Integer | Total AOS+ armor factor. | r/o |
resist_poison_cap | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
resist_poison_cap_mod | Integer | Modifier for property, added to base of the object. | r/w |
resist_poison_mod | Integer | AOS+ Armor factor modifier | r/w |
saveonexit | Boolean | default 1, if you set this to 0 the item and (if container, it's contents) will NOT be saved to datafile | r/w |
sellprice | Integer | Amount of gold an NPC sells this item for. 0=not for sale, -1=itemdesc default. | r/w |
snoopscript | String | double-click action script when owned by another character. set to empty string for itemdesc.cfg default script. | r/w |
spell_damage_increase | Integer | Total of base property plus mod, applied to characters when equipt. | r/o |
spell_damage_increase_mod | Integer | Modifier for property, added to base of the object. | r/w |
stackable | Integer | return is based on POL Decided stackability of item. | r/o |
swing_speed_increase | Integer | Total of base property plus mod, applied to characters when equipt. Swing Speed Increase is used as a % modifier to the calculated speed of a weapon, e.g. Weapon speed of 30 * swing speed increase of 100% would make the swing speed 60. | r/o |
swing_speed_increase_mod | Integer | Modifier for property, added to base of the object. | r/w |
tile_layer | Integer | returns the Layer setting in the Tiles.cfg/Tiledata | r/o |
unequipscript | String | script run when item unequipped | r/w |
usescript | String | double-click action script. set to empty string for itemdesc.cfg default script. | r/w |
weight_multiplier_mod | Double | Multiplicative modifier when calculating an item's weight. For example, on an item that weighs 100 stone, setting this property to 0.5 would have the item weigh 50 stone. | r/w |
Methods | |||
Prototype | Returns | Desc | |
hasExistingStack(container) | Item | Checks if there is an existing stack in a container or not, returns the ItemRef of the stack if it exists | |
splitStackAt(x, y, z, realm, amount) | Item | Will split the item into 2 stacks. Returns a reference to the new stack made from item. Places new stack at the coordinates | |
splitStackInto(container, amount) | Item | Will split the item into 2 stacks. Returns a reference to the new stack made from item. Places new stack into the container |
Map | |||
---|---|---|---|
Parent | |||
Item | |||
Explanation | |||
A Map item that shows a a map image in a gump when double clicked. | |||
Members | |||
Name | Type | Desc | Access |
editable | Boolean | If true, pins on the map can be moved | r/w |
facetid | Integer | This has actually nothing to do with realms, the value is the same as in FacetXX.mul file | r/w |
gumpheight | Integer | height in pixels of map gump | r/w |
gumpwidth | Integer | width in pixels of map gump | r/w |
xeast | Integer | east gump edge (world coord) | r/w |
xwest | Integer | west gump edge (world coord) | r/w |
ynorth | Integer | north gump edge (world coord) | r/w |
ysouth | Integer | south gump edge (world coord) | r/w |
Methods | |||
Prototype | Returns | Desc | |
appendpin(int x, int y) | true/error | append pin{x,y} to end of course | |
erasepin(int index) | true/error | erase pin at index | |
getpins() | array | returns array of structs{x,y} of pins for the map | |
insertpin(int index, int x, int y) | true/error | insert pin{x,y} before index |
Multi | |||
---|---|---|---|
Parent | |||
Item | |||
Children | |||
House | |||
Boat | |||
Explanation | |||
Special items that display as many pieces of a large structure, as defined in multi.cfg | |||
Members | |||
Name | Type | Desc | Access |
footprint | Struct | returns a struct with 'xmin', 'xmax', 'ymin', 'ymax' of the world coordinates the multi occupies. | r/o |
items_decay | Boolean | activates decay for items inside of the multi | r/w |
NPC | |||
---|---|---|---|
Parent | |||
Character | |||
Explanation | |||
A Non-Player Character mobile object | |||
Members | |||
Name | Type | Desc | Access |
alignment | Integer | NPC template alignment. | r/o |
eventmask | Integer | bitwise-ORd list of sysevents that have been enabled, error if no control script running | r/o |
master | Character | controlling player character, false if none | r/o |
no_drop_exception | Boolean | defines if npc is a valid target even if no_drop is set for the item | r/w |
npctemplate | String | NPC template name in npcdesc.cfg | r/o |
process | Script | Control script reference, error on none | r/o |
run_speed | Integer | NPC walk delay (maximum 250) | r/w |
saveonexit | Boolean | default 1, if you set this to 0 the npc and all items contained within it's wornitems container will NOT be saved to datafile | r/w |
script | String | control script name | r/w |
speech_color | Integer | NPC speech text color | r/w |
speech_font | Integer | NPC speech text font | r/w |
use_adjustments | Boolean | Use movement adjustments to avoid single-tile obsticals | r/w |
Methods | |||
Prototype | Returns | Desc | |
setmaster(CharacterRef master) | true/false | Sets the master character for the NPC, if not passed, clears master. |
Package | |||
---|---|---|---|
Explanation | |||
Object representing a package in the system | |||
Members | |||
Name | Type | Desc | Access |
desc | String | name + directory | r/o |
dir | String | Package directory path | r/o |
name | String | Package name | r/o |
npcdesc | Boolean | Does the Package hold an own npcdesc.cfg? | r/o |
supports_http | Boolean | Does the Package supports www? | r/o |
version | String | Package version | r/o |
Packet | |||
---|---|---|---|
Explanation | |||
Object representing a binary packet. Print(Packet) returns string of Packet contents. | |||
Methods | |||
Prototype | Returns | Desc | |
GetInt16(int offset) | integer/error | Gets 16-bit (2 byte) value at offset (0-based). Automatically converts to Big-Endian. | |
GetInt16Flipped(int offset) | integer/error | Gets 16-bit (2 byte) value at offset (0-based). Automatically converts to Low-Endian. | |
GetInt32(int offset) | integer/error | Gets 32-bit (4 byte) value at offset (0-based). Automatically converts to Big-Endian. | |
GetInt32Flipped(int offset) | integer/error | Gets 32-bit (4 byte) value at offset (0-based). Automatically converts to Low-Endian. | |
GetInt8(int offset) | integer/error | Gets 8-bit (1 byte) value at offset (0-based). | |
GetSize() | integer | Returns size of packet data in bytes. | |
GetString(int offset, int length) | string/error | Gets a string (1-byte characters) at offset (0-based) for length characters. | |
GetUnicodeString(int offset, int length) | array/error | Gets a 'unicode string' (2-byte characters) at offset (0-based) for length characters (NOT BYTES). | |
GetUnicodeStringFlipped(int offset, int length) | array/error | Gets a 'unicode string' (2-byte characters) at offset (0-based) for length characters (NOT BYTES). With Flipped Byte Order (for specific packet support) | |
SendAreaPacket(int x, int y, int range, string realm) | integer/error | Sends this packet to all the players in range of x,y. Returns integer number of clients this packet was successfully sent to. | |
SendPacket(Character) | true/error | Sends this packet to character. | |
SetInt16(int offset, int value) | true/error | Sets an 16-bit (2-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Automatically converts to Big-Endian. | |
SetInt16Flipped(int offset, int value) | true/error | Sets an 16-bit (2-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Automatically converts to Low-Endian. | |
SetInt32(int offset, int value) | true/error | Sets an 32-bit (4-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Automatically converts to Big-Endian. NOTE: currently there's a compiler problem setting 0xFFFFFFFF, it gets converted to 0x7FFFFFFF. Use multiple SetInt16 or SetInt8 calls for now. | |
SetInt32Flipped(int offset, int value) | true/error | Sets an 32-bit (4-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Automatically converts to Low-Endian. NOTE: currently there's a compiler problem setting 0xFFFFFFFF, it gets converted to 0x7FFFFFFF. Use multiple SetInt16 or SetInt8 calls for now. | |
SetInt8(int offset, int value) | true/error | Sets an 8-bit (1-byte) value at offset (0-based). If offset is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. | |
SetSize(int newsize) | integer/error | Sets the new size of the packet, possibly destroying data if packet size was decreased. Updates the encoded size for variable length packets, not allowed for fixed-length packets. Returns the old size of the packet. | |
SetString(int offset, string string, int nullterminate) | true/error | Sets a string value at offset (0-based). If offset plus length of string is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Set nullterminate to 1 if you want to automatically append a 0 terminator. | |
SetUnicodeString(int offset, array unicode character, int nullterminate) | true/error | Sets a unicode string at offset (0-based). If offset plus length of string (2*number of members in the array) is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Set nullterminate to 1 if you want to automatically append a double 0 terminator. Unicode strings in eScript are arrays of 2-byte values. See unicode.em for useful functions. CAscZ in basic.em is useful for character sets that use the ascii/ansi standard. | |
SetUnicodeStringFlipped(int offset, array unicode character, int nullterminate) | true/error | Sets a unicode string at offset (0-based). If offset plus length of string (2*number of members in the array) is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Set nullterminate to 1 if you want to automatically append a double 0 terminator. Unicode strings in eScript are arrays of 2-byte values. See unicode.em for useful functions. CAscZ in basic.em is useful for character sets that use the ascii/ansi standard. With Flipped Byte Order (for specific packet support) | |
SetUtf8String(int offset, string string, int nullterminate) | true/error | Sets a UTF-8 encoded string value at offset (0-based). If offset plus length of string is greater than current size, the packet is resized to fit the new data and the encoded size is updated for variable length packets. Resizing is not allowed for fixed-length packets. Set nullterminate to 1 if you want to automatically append a 0 terminator. |
Party | |||
---|---|---|---|
Explanation | |||
Object representing a player party association | |||
Members | |||
Name | Type | Desc | Access |
candidates | Array | Array of Offline Character Refs who are party candidates | r/o |
leader | OfflineCharRef | Offline Character Ref of leader | r/o |
members | Array | Array of Offline Character Refs who are party members | r/o |
Methods | |||
Prototype | Returns | Desc | |
addcandidate(CharacterRef) | error/true | Adds a character to the party as candidate. | |
addmember(CharacterRef) | error/true | Adds a character to the party. If the player is already candidate of another party, this function will fail. | |
eraseprop(string propname) | true/error | Erases the property named 'propname'. | |
getprop(string propname) | script object/error | Returns an unpacked script object (i.e. int,string,array,etc). | |
propnames() | Array | Returns an array of property name strings. | |
removecandidate(CharacterRef) | true/error | Removes a character candidate. | |
removemember(CharacterRef) | true/error | Removes a character member. | |
setleader(CharacterRef) | error/true | Sets new leader. | |
setprop(string propname, object propval) | true/error | Sets a packable object to a property. |
Polcore | |||
---|---|---|---|
Explanation | |||
Object containing server data | |||
Members | |||
Name | Type | Desc | Access |
all_scripts | Array | Array of all cached script objects | r/o |
bytes_received | Double | Number of bytes received from clients | r/o |
bytes_sent | Double | Number of bytes sent to clients | r/o |
combat_operations_per_min | Integer | Combat operations per minute | r/o |
compiledatetime | String | Compile Date and Time | r/o |
error_creations_per_min | Integer | Script errors per minute | r/o |
events_per_min | Integer | Events per minute | r/o |
instr_per_min | Integer | Script instructions per minute | r/o |
iostats | Integer | struct of arrays of structs - iostats["sent"array->256 elements of struct["count","bytes"],"received"array->256 elements of struct["count","bytes"]] | r/o |
itemcount | Integer | Total Item Count | r/o |
last_character_serial | Integer | Last character serial number assigned by core | r/o |
last_item_serial | Integer | Last item serial number assigned by core | r/o |
memory_usage | Integer | current process usage in KB | r/o |
mobilecount | Integer | Total Mobile Count | r/o |
packages | Array | Array of enabled package names | r/o |
pkt_status | Array | returns and array of info structures about packets currently in the queue | r/o |
poldir | String | Directory of the POL executable | r/o |
priority_divide | Integer | Priority Divide | r/o |
queued_iostats | Array | structure same as iostats, but for queued I/O stats | r/o |
running_scripts | Array | Array of running script objects | r/o |
script_profiles | Array | Array of structs: struct have members name, instr, invocations, instr_per_invoc, instr_percent | r/o |
scripts_late_per_min | Integer | Scripts late per minute | r/o |
scripts_ontime_per_min | Integer | Scripts on time per minute | r/o |
skill_checks_per_min | Integer | Skill checks per minute | r/o |
sysload | Integer | System Load | r/o |
sysload_severity | Integer | System Load Severity | r/o |
systime | Integer | UNIX time() | r/o |
tasks_late_per_min | Integer | Tasks late per minute | r/o |
tasks_late_ticks_per_min | Integer | Tasks late ticks per minute | r/o |
tasks_ontime_per_min | Integer | Tasks ontime per minute | r/o |
uptime | Integer | Uptime in seconds | r/o |
version | Integer | Version, i.e. 95 | r/o |
verstr | String | Version String | r/o |
Methods | |||
Prototype | Returns | Desc | |
clear_script_profile_counters() | true/false | Clears the script profile counters | |
internal(integer) | unspecified | developer methods, not officially published | |
log_profile(bool clear) | true/false | Writes the script profile to the log, optionally clearing it after. | |
set_priority_divide(int divide) | true/false | Sets the priority divide to 'divide' |
Script | |||
---|---|---|---|
Explanation | |||
Object representing a script in the system | |||
Members | |||
Name | Type | Desc | Access |
attached_to | Object | Mobile or Item where Script is attached to. If it's attached to a Character, it will return the Character. If it's an AI-Script it will return the NPC. If it's a ControlScript it will return the Item. Checks are made in the order above. | r/o |
call_depth | Integer | Call depth | r/o |
consec_cycles | Integer | Consecutive Cycles | r/o |
controller | MobileRef | Mobile which is responsible for damage etc. | r/o |
globals | Dictionary | Dictionary of global variable name=>value pairs | r/o |
instr_cycles | Integer | Instruction Cycles | r/o |
name | String | Script name | r/o |
num_globals | Integer | Number of global variables | r/o |
package | PackageRef | Reference to the package where this script exists, returns error "Script has no package" if script is from a system folder | r/o |
pc | Integer | Program Counter | r/o |
pid | Integer | Process ID | r/o |
sleep_cycles | Integer | Sleep Cycles | r/o |
state | String | Script state | r/o |
var_size | Integer | Estimated size of global variables and current local variables | r/o |
Methods | |||
Prototype | Returns | Desc | |
clear_event_queue() | true | clears the event queue of the script | |
get_member(string membername) | object, value of member or error | Gets the value of the built-in member 'membername'. var objname := obj.get_member("name") is the same as var objname := obj.name | |
kill() | true | Kills this script | |
loadsymbols() | Boolean | Loads the .dbg file | |
sendevent(obj event) | error/true | sends a event to this script (usually a struct) | |
stacktrace( options?: struct{ format?: 'string' | 'array' } | uninit ) | Array/String | Get information regarding the current execution stack of this script. The value is either a string containing a line for each stack frame, or an array of objects representing each stack frame. options is a struct specifying the format to return via setting a member format to the value "string" (default) or "array" . If "array" , then the result will be an array containing structs with members pc (program counter), file (script name), name (function name), and line (script line).The script must been compiled with debugging information (using ecompile.cfg setting GenerateDebugInfo or ecompile -x flag) in order to get function name and line information. If debug information is not available, then only the script's program counter will be reported. |
Spellbook | |||
---|---|---|---|
Parent | |||
Container | |||
Explanation | |||
Object representing a Spellbook. | |||
Methods | |||
Prototype | Returns | Desc | |
AddSpell(int spellid) | 1/0/error | Adds given spellid. | |
HasSpell(int spellid) | 1/0/error | Checks if given spellid is inside the spellbook. | |
RemoveSpell(int spellid) | 1/0/error | Removes given spellid. | |
Spells() | array | Returns array of SpellIDs |
StorageArea | |||
---|---|---|---|
Explanation | |||
Object representing a storage area. It is iterable: iterates over Item objects (root items in storage area). | |||
Members | |||
Name | Type | Desc | Access |
count | Integer | Number of root items in this storage area | r/o |
totalcount | Integer | Number of items in this storage area | r/o |
StorageAreas | |||
---|---|---|---|
Explanation | |||
Object representing a list of all storage areas. It is iterable: iterates over StorageArea objects. It supports the [] operator: its behavior is similar to FindStorageArea() | |||
Members | |||
Name | Type | Desc | Access |
count | Integer | Number of storage areas | r/o |
String | |||
---|---|---|---|
Explanation | |||
An ordered collection of ascii (1-byte) characters. Declare and pre-initialize with var s := "my string" | |||
Methods | |||
Prototype | Returns | Desc | |
+ string | string | concatenates the strings, returns the new string. | |
[start,length] | string | 'Substring': returns a new string from the character range between start and length, inclusive. Returns error if index out of range. Ex: var str := "yomama"; str[2,3] would return "oma". | |
[substr] | string/uninit | seaches the string for 'substr'. If found, returns the first character of the substring, else uninitialized object. | |
[substr] := replace_str | string | finds the first occurance of 'substr' and replaces substr with 'replace_str'. returns the new string. | |
find(search,[start]) | int | returns like Find(string, search, start) the index of the first occurance of 'search' after 'start' within str, but unlike the basic.em function the Start parameter is optional if not given it searches the whole string | |
format(args) | string | formats a string using the data from args. Accepts the following format: {:x} for hex representation {:o} for octal {:b} for binary Add a # to get notation prefix, e.g.: "{:x}".format(10) -> "a" "{:#x}".format(10) -> "0xa" Parameters can be simple: "You have {} gold coins".format(120) -> "You have 120 gold coins" and are unpacked implicitly by their order: "{} hits {} for {} of damage".format("John", "Bob", 120) -> "John hits Bob for 120 of damage" However you can specify parameters explicitly (first argument is at 1): "You hit {2} for {1} damage".format(120, "John Doe") -> "You hit John Doe for 120 damage" Format allows accessing object members: "Spell {1.spell_name} requires reagents: {1.reagents}".format(struct{spell_name:="Fire Wrath", "Ba, Bm, Ga"}) -> "Spell Fire Wrath requires reagents: Ba, Bm, Ga" Implicit members also work: "{name} you hit level {level}".format(struct{name:="Jane Doe", level:=4}) -> "Jane Doe you hit level 4" Character or item members are accessed the same way: "{1.name}, your shield {2.desc} has {2.hp} hp".format(who, who.shield) -> "Admin, your shield Buckler of Death has 150 hp" |
|
join(array) | string | returns a string which is the concatenation of the array elements, seperated by str | |
length() | int | returns number of characters in the string | |
lower() | string | returns like lower(str) the lowercase version and also modifies the str | |
upper() | string | returns like upper(str) the uppercase version and also modifies the str |
Struct | |||
---|---|---|---|
Explanation | |||
Data structure with explicitly named members (keys). Keys may be only be strings. Declare with var s := struct; Pre-intialize with: var s := struct { a := 1, b := 2 }; | |||
Methods | |||
Prototype | Returns | Desc | |
.+member | n/a | struct.+member adds a member | |
.-member | n/a | struct.-member removes a member | |
.?member | int | struct.?member returns count of matching member | |
.member | value | gets value of member | |
[member] | value | gets value of member ONLY when member is a string! no using integers here like an array. | |
erase(key) | error/int | removes given key | |
exists(key) | error/int | if exists, returns count of matching key | |
insert(int index, object) | int/error | inserts a new object into the struct for key. Returns size. | |
keys() | array | returns an array of the keys | |
size() | int | number of keys in the struct |
UObject | |||
---|---|---|---|
Children | |||
Character | |||
Item | |||
Explanation | |||
The base UO Object class | |||
Members | |||
Name | Type | Desc | Access |
color | Integer | color value (0 to 0xFFF) | r/w |
dirty | Boolean | This is set when anything on the object changes, and cleared on world save | r/o |
facing | Integer | facing or the object (meaningful for mobiles and light-emitting items) range 0-127 | r/w |
graphic | Integer | art id number | r/w |
height | Integer | height of the graphic as defined in tiledata.mul | r/o |
multi | Multi | MultiRef for the Multi the object is on | r/o |
name | String | name string (for items use .desc for single-click text, this does not include suffix or formatting) | r/w |
objtype | Integer | object type as defined in itemdesc.cfg | r/o |
realm | String | case-sensitive name of the realm | r/o |
serial | Integer | unique object identifier | r/o |
specific_name | Boolean | Set if a specific name is set, otherwise like itemdesc name false. | r/o |
weight | Integer | weight of the graphic as defined in tiledata.mul | r/o |
x | Integer | x coordinate | r/o |
y | Integer | y coordinate | r/o |
z | Integer | z coordinate | r/o |
Methods | |||
Prototype | Returns | Desc | |
eraseprop(string propname) | true/error | Erases the property named 'propname'. | |
get_member(string membername) | object, value of member or error | Gets the value of the built-in member 'membername'. var objname := obj.get_member("name") is the same as var objname := obj.name | |
getprop(string propname) | script object/error | Returns an unpacked script object (i.e. int,string,array,etc) | |
isa(POLCLASS_*) | boolean | True if the derived class is the same as the passed class type (see uo.em for all constants) | |
propnames() | Array | Returns an array of property name strings. | |
set_member(string membername, obj value) | object, new value of member or error | Sets the built-in member 'membername' to 'value'. obj.set_member("name","Eric") is the same as obj.name := "Eric" | |
setprop(string propname, object propval) | true/error | Sets a packable object to a property. |
Weapon | |||
---|---|---|---|
Parent | |||
Equipment | |||
Explanation | |||
Equipable items that deal damage in combat | |||
Members | |||
Name | Type | Desc | Access |
attribute | String | Attribute name this weapon uses as a skill | r/o |
dmg_mod | Integer | Damage Modifier | r/w |
hitscript | String | Script name that runs when weapon makes a hit | r/w |
speed_mod | Integer | from -32768 to 32767, an optional way to delay if you want to use the default speed math and just add to that | r/w |
XMLAttributes | |||
---|---|---|---|
Explanation | |||
Object representing XML attributes of a node. ForEach support: iterates over all attributes, iterator is a struct with key=attributename and value=attributevalue, _iterator_iter is integer index. | |||
Methods | |||
Prototype | Returns | Desc | |
[key] | String/Error | Returns attribute value. | |
propnames() | Array of Strings | Returns array of all attribute names. |
XMLFile | |||
---|---|---|---|
Explanation | |||
Object representing a XML file. ForEach support: iterates over all child nodes, iterator is XMLNode object _iterator_iter is integer index. | |||
Methods | |||
Prototype | Returns | Desc | |
[key] | XMLNode | If key is integer returns node of given index, if key is a string returns first node with key as name. | |
appendxmlcomment(string value) | 1 | Adds comment. | |
appendxmlnode(string value, [struct{attributes}]) | Created node on success. | Appends node with name value and given attributes (key=name, value=value). | |
removexmlnode(integer/string/XMLNode) | 1/0 | removes node by index, first node with given name or passed one. | |
savexml(string filename) | 1/0 | Saves to file. | |
setxmldeclaration(string version, string encoding, string standalone) | 1 | Sets the xml declaration. | |
xmltostring([string ident]) | String | Returns XML as string, identation is by default \t. |
XMLNode | |||
---|---|---|---|
Explanation | |||
Object representing a XML node. ForEach support: iterates over all child nodes, iterator is XMLNode object _iterator_iter is integer index. | |||
Members | |||
Name | Type | Desc | Access |
attributes | XMLAttributes | Returns attribute object of node. | r/o |
type | String | Returns type string (XMLComment, XMLDeclaration, XMLDocument, XMLElement, XMLText, XMLTypeCount, XMLUnknown). | r/o |
Methods | |||
Prototype | Returns | Desc | |
appendxmlcomment(string value) | 1 | Adds comment. | |
appendxmlnode(string value, [struct{attributes}]) | Created node on success. | Appends node with name value and given attributes (key=name, value=value). | |
appendxmltext(string text) | 1 | Adds node text. | |
clonenode() | XMLNode | Create a copy of node which is then valid longer then the file object. | |
firstxmlchild([string value]) | XMLNode | Returns first children or first with given name. | |
nextxmlsibling([string value]) | XMLNode | Returns next sibling or first with given name. | |
removexmlattribute(string key) | Parent node on success. | Removes attribute with given name. | |
removexmlnode(integer/string/XMLNode) | 1/0 | removes node by index, first node with given name or passed one. | |
setxmlattribute(struct{attributes}) | Parent node on success. | Sets node attributes (key=name, value=value). |