Class Hierarchy

            UObject             Account      PolCore()       DataFileElement
               |
               |                Guild        Script          Datastore
     +---------+--------+
     |                  |       Array        Dictionary      Datafile
   Character           Item
     |                  |       AuxConnection   Error        String
    NPC                 |
                        |                                    Struct
     +------------------+--------------+-----------+
     |                  |              |           |
 Equipment           Lockable         Map        Multi
     |                  |                          |
 +---+----+        +----+--------+            +----+----+
 |        |        |             |            |         |
Armor  Weapon     Door        Container      Boat     House
                                 |
                            +----+----+
                            |         |
                         Spellbook   Corpse

Last Modified: 6/12/2003

Account
Explanation
Object describing a player's game account
Members
NameTypeDescAccess
nameStringthe name of the accountr/o
enabledbooleantrue if enabledr/o
bannedbooleantrue if bannedr/o
passwordhashstringMD5 password hash stringr/o
usernamepasswordhashstringMD5 username+password hash stringr/o
Methods
PrototypeReturnsDesc
ban()truebans the account
unban()trueunbans the account
enable()trueenables the account
disable()truedisables the account
setpassword(string newpass)true/errorsets the account password to newpass
checkpassword(string pass)boolean/errorreturns true if 'pass' is the account's password
setname(string newname, string newpass)true/errorsets the account name to newname, newpass optional
getcharacter(integer slot)true/OfflineCharacterRefgets an OfflineCharacterRef for the character in slot 'slot'. returns error if not character in that slot (1..5)
deletecharacter(integer slot) true/errorDeletes character in slot 'slot'. returns error if not character in that slot (1..5)
getprop(string propname)true/errorGetObjProperty for account objects.
setprop(string propname, propval)trueSetObjProperty for account objects.
eraseprop(string propname)trueEraseObjProperty for account objects.
propnames()Arrayreturns an array of cprop names on this account



Armor
Parent
Equipment
Explanation
Equipable items that protect against damage in combat
Members
NameTypeDescAccess
ar_modintegerArmor factor modifierr/w
arintegerModified armor factorr/o
ar_baseintegerBase armor factor (as in itemdesc.cfg)r/o
onhitscriptstringScript name that runs when armor is hitr/w



Array
Explanation
Data structure for linear storage, dynamically resizes to fit more elements. Declare with var a := array;
Methods
PrototypeReturnsDesc
size()intnumber of elements in the array
erase(int index)true/falseerases the element at index
insert(int index, object)void/errorinserts a new object into the array at index
shrink(index)true/errorerases index to end of array
append(object)true/errorinserts object in the end of the array
reverse()truereverses the elements of the array
sort()truesorts the elements of the array
+ arrayarrayconcatinates 2 arrays



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.
Methods
PrototypeReturnsDesc
transmit(object o)error/0Transmits the packable object 'o' over the Aux connection.



Boat
Parent
Multi
Explanation
A Multi object that moves in water.
Members
NameTypeDescAccess
itemsarrayArray of Item References on the deck of the boatr/o
mobilesarrayArray of Character References on the deckr/o
has_offline_mobilesbooleantrue if players are logged out on the deckr/o
tillermanItemItemRef to the tillerman itemr/o
portplankItemItemRef to the left-side plank itemr/o
starboardplankItemItemRef to the right-side plank itemr/o
holdItemItemRef to the hold container itemr/o
Methods
PrototypeReturnsDesc
move_offline_mobiles(int x, int y, int z)true/falsemoves offline mobiles on boat to x,y,z



Character
Parent
UObject
Children
NPC
Explanation
A mobile object that exists in the world (NPC or player character)
Members
NameTypeDescAccess
warmodeinteger1 if in warmoder/o
genderinteger0=male 1=femaler/w
trueobjtypeintegeroriginal objtyper/w
truecolorintegeroriginal colorr/w
ar_modintegerArmor factor modifierr/w
hiddenboolean1 = normal players cannot seer/w
concealedintegercmdlevel below this value cannot seer/w
frozenboolean1 = player is frozen (by a GM)r/w
paralyzedboolean1 = player is paralyzedr/w
poisonedboolean1 = player is poisonedr/w
stealthstepsintegernumber of walk steps left until player is revealedr/w
squelchedinteger1 = player cannot speakr/o
deadinteger1 = player is deadr/o
arintegertotal armor factorr/o
backpackItemReference to character's pack (if any)r/o
weaponItemReference to character's weapon (if any)r/o
acctnameAccountAccount name string (if not NPC)r/o
acctintegerAccount Reference (if not NPC)r/o
cmdlevelintegercommand level of characterr/w
cmdlevelstrStringstring name of command levelr/o
criminalinteger1 = player is criminal (gray)r/o
ipStringIP Address stringr/o
goldintegerAmount of gold in character's packr/o
title_prefixStringString placed before name i.e. Lord Racalacr/w
title_suffixStringString placed after name i.e. Racalac the Braver/w
title_guildStringString guild title i.e. [ROX, super d00d] Racalacr/w
title_raceStringString race title after suffix in paperdollr/w
guildidintegerguild ID numberr/o
guildGuildguild object referencer/o
murdererboolean1 = player flagged murderer (red)r/w
attachedScriptScript reference for attached scriptr/o
reportablesArray(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 occurredr/o
clientversionstringUO Client version stringr/o
Methods
PrototypeReturnsDesc
setpoisoned(bool)true/errorsets the character poisoned, controller of calling script is flagged as in repsystem
setparalyzed(bool)true/errorsets the character paralyzed, controller of calling script is flagged as in repsystem
setcriminal(int level)true/errorsets the character criminal. level multiplies the CriminalFlagInterval as defined in repsys.cfg. level=0 clears criminal timer.
setlightlevel(int level, int duration)truesets the light level of the character to 'level' for 'duration' seconds
squelch(int duration)truecharacter cannot talk for 'duration' seconds. -1 means forever. 0 clears the squelch
enable(string setting)true/errorenables the 'granted' privilage to the character
disable(string setting)truedisables the 'granted' privilage to the character
enabled(string setting)true/falsetrue if the privilage is enabled
setcmdlevel(string cmdlevel)true/errorgrants the command level to the char as defined in cmds.cfg
spendgold(int amount)true/errorif enough gold, removes it from the player's pack
setmurderer(bool)true/errorflags the character as a murderer (red)
removereportable(int serial, int gameclock)true/errorremoves the killer with 'serial' from the reportables list that was added at 'gameclock'
getgottenitem()error/ItemRefreturns an ItemRef to the item held on the player's cursor, if any.
setwarmode(boolean)integer/errorSets the internal warmode flag and sends the update to the player. Returns the new warmode value.



Container
Parent
Lockable
Children
Corpse
Explanation
Items that can be locked, and have other items inside them



Corpse
Parent
Lockable
Explanation
Objects that are created when character objects are killed
Members
NameTypeDescAccess
corpsetypeintegerobjtype of the character killedr/o



DataFileElement
Explanation
A data element inside a datastore file
Methods
PrototypeReturnsDesc
GetProp(string propname)script object/errorReturns an unpacked script object (i.e. int,string,array,etc)
SetProp(string propname, object propvalue)true/errorSets a packable object to a property
EraseProp(string propname)true/errorErases the property named 'propname'
PropNames()arrayReturns an array of property name strings



Datafile
Explanation
Object representing a data file in a data store
Methods
PrototypeReturnsDesc
CreateElement(key)error/DataFileElemRefkey is int or string, depending on datafile flags
FindElement(key)error/DataFileElemRefsee key notes above
DeleteElement(key)error/truesee key notes above
Keys()arrayarray of ints or strings, depending on datafile flags



Datastore
Explanation
Functions for manipulating a datastore. Not an actual object, but funcs found in datafile.em, presented here for completeness.
Methods
PrototypeReturnsDesc
CreateDataFile(string name, int flags)DataFileRef/errorCreates a datafile
OpenDataFile(string name)DataFileRef/errorOpens a datafile
UnloadDataFile(string name)true/errorUnloads a datafile



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;
Methods
PrototypeReturnsDesc
size()intnumber of pairs in dictionary
erase(key)true/errorerases a pair from the dict
insert(key, value)error/intinserts a pair into the dict, returns new size
exists(key)error/intif exists, returns count of matching key
keys()arrayreturns an array of the keys
[key]valuegets value at key, or uninit if key doesn't exist



Door
Parent
Lockable
Explanation
A door item that automatically closes.
Members
NameTypeDescAccess
isopen booleantrue if the door is openr/o
Methods
PrototypeReturnsDesc
open()trueopens the door
close()truecloses the door
toggle()truetoggles the door to the other state



Equipment
Parent
Item
Children
Weapon
Armor
Explanation
Class containing concrete subclasses which are equipable and have hit points
Members
NameTypeDescAccess
qualityfloat1.0=Averager/w
hpintegerHit points of itemr/w
maxhp_modintegerMaximum Hit Point modificationr/w
maxhpintegerMaximum Hit Points of itemr/o



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.
Members
NameTypeDescAccess
errortextstringInformational Error stringr/w



Guild
Explanation
Object representing a player guild association
Members
NameTypeDescAccess
membersarrayArray of Character Refs who are guild membersr/o
allyguildsarrayArray of GuildRefs who are allied guildsr/o
enemyguildsarrayArray of GuildRefs who are enemy guildsr/o
guildidintegerGuild ID numberr/o
Methods
PrototypeReturnsDesc
ismember(Character)error/truetrue if the character is a member of the guild
isallyguild(GuildRef)true/errortrue if the guild is an ally
isenemyguild(GuildRef)true/errortrue if the guild is an enemy
addmember(CharacterRef)true/erroradds a character to the guild
addallyguild(GuildRef)true/erroradds an ally guild
addenemyguild(GuildRef)true/erroradds an enemy guild
removemember(CharacterRef)true/errorremoves a character member
removeallyguild(GuildRef)true/errorremoves an ally guild
removeenemyguild(GuildRef)true/errorremoves an enemy guild



House
Parent
Multi
Explanation
A Multi object where players hoard items.
Members
NameTypeDescAccess
components ArrayArray of House components, i.e. sign, doorsr/o
itemsArrayArray of Item References in the houser/o
mobilesArrayArray of Character References in the houser/o



Item
Parent
UObject
Children
Equipment
Lockable
Map
Multi
Explanation
Represents a physical item in the world.
Members
NameTypeDescAccess
amountintegerstack sizer/o
layerintegerequipment layerr/o
containerItemitem contained inr/o
usescriptstringdouble-click action script. set to empty string for itemdesc.cfg default script.r/w
equipscriptstringscript run when item equipped on a characterr/w
unequipscriptstringscript run when item unequippedr/w
descstringsingle click description string (formatted name)r/o
movablebooleantrue if player may move the itemr/w
invisiblebooleantrue if the item is invisibler/w
decayatintegergame clock value after which this item might decayr/o
sellpriceintegerAmount of gold an NPC sells this item for. 0=not for sale, -1=itemdesc default.r/w
buypriceintegerAmount of gold an NPC buys this item for. 0=not for sale, -1=itemdesc default.r/w
newbiebooleantrue if the item remains with the ghost when player diesr/w
item_countintegernumber of items in container (or 1 if this item is not a container)r/o



Lockable
Parent
Item
Children
Door
Container
Explanation
Class containing concrete subclasses which can 'lock'
Members
NameTypeDescAccess
lockedbooleantrue if the item is lockedr/w



Map
Parent
Item
Explanation
A Map item that shows a a map image in a gump when double clicked.
Members
NameTypeDescAccess
xeastintegereast gump edge (world coord)r/w
xwestintegerwest gump edge (world coord)r/w
ynorthintegernorth gump edge (world coord)r/w
ysouthintegersouth gump edge (world coord)r/w
gumpwidthintegerwidth in pixels of map gumpr/w
gumpheightintegerheight in pixels of map gumpr/w
Methods
PrototypeReturnsDesc
getpins()arrayreturns array of structs{x,y} of pins for the map
insertpin(int index, int x, int y)true/errorinsert pin{x,y} before index
appendpin(int x, int y)true/errorappend pin{x,y} to end of course
erasepin(int index)true/errorerase pin at index



Multi
Parent
Item
Children
House
Boat
Explanation
Special items that display as many pieces of a large structure, as defined in multi.cfg



NPC
Parent
Character
Explanation
A Non-Player Character mobile object
Members
NameTypeDescAccess
npctemplatestringNPC template name in npcdesc.cfgr/o
masterCharactercontrolling player character, false if noner/o
processScriptControl script reference, error on noner/o
eventmaskintegerbitwise-ORd list of sysevents that have been enabled, error if no control script runningr/o
speech_colorintegerNPC speech text colorr/w
speech_fontintegerNPC speech text fontr/w
scriptstringcontrol script namer/w
use_adjustmentsbooleanUse movement adjustments to avoid single-tile obsticalsr/w
run_speedintegerNPC walk delay (maximum 250)r/w
Methods
PrototypeReturnsDesc
setmaster(CharacterRef master)true/falseSets the master character for the NPC, if not passed, clears master.



Polcore
Explanation
Object containing server data
Members
NameTypeDescAccess
itemcountintegerTotal Item Countr/o
mobilecountintegerTotal Mobile Countr/o
uptimeintegerUptime in secondsr/o
sysloadintegerSystem Loadr/o
sysload_severityintegerSystem Load Severityr/o
bytes_sentintegerNumber of bytes sentr/o
bytes_receivedintegerNumber of bytes receivedr/o
versionintegerVersion, i.e. 95r/o
systimeintegerUNIX time()r/o
events_per_minintegerEvents per minuter/o
skill_checks_per_minintegerSkill checks per minuter/o
combat_operations_per_minintegerCombat operations per minuter/o
error_creations_per_minintegerScript errors per minuter/o
tasks_ontime_per_minintegerTasks ontime per minuter/o
tasks_late_per_minintegerTasks late per minuter/o
tasks_late_ticks_per_minintegerTasks late ticks per minuter/o
instr_per_minintegerScript instructions per minuter/o
priority_divideintegerPriority Divider/o
verstrstringVersion Stringr/o
compiledatestringCompile Dater/o
compiletimestringCompile Timer/o
packagesarrayArray of enabled package namesr/o
all_scriptsarrayArray of all cached script objectsr/o
script_profilesarrayArray of structs: struct have members name, instr, invocations, instr_per_invoc, instr_percentr/o
iostatsintegerstruct of arrays of structs - iostats["sent"array->256 elements of struct["count","bytes"],"received"array->256 elements of struct["count","bytes"]]r/o
queued_iostatsarraystructure same as iostats, but for queued I/O statsr/o
Methods
PrototypeReturnsDesc
log_profile(bool clear)true/falseWrites the script profile to the log, optionally clearing it after.
set_priority_divide(int divide)true/falseSets the priority divide to 'divide'
clear_script_profile_counters()true/falseClears the script profile counters



Script
Explanation
Object representing a script in the system
Members
NameTypeDescAccess
pidintegerProcess IDr/o
namestringScript namer/o
statestringScript stater/o
instr_cyclesintegerInstruction Cyclesr/o
sleep_cyclesintegerSleep Cyclesr/o
consec_cyclesintegerConsecutive Cyclesr/o
PCintegerProgram Counterr/o
call_depthintegerCall depthr/o
num_globalsintegerNumber of global variablesr/o
var_sizeintegerNumber of variablesr/o
globalsDictionaryDictionary of global variable name=>value pairsr/o
Methods
PrototypeReturnsDesc
sendevent(obj event)error/truesends a event to this script (usually a struct)
kill()trueKills this script
clear_event_queue()trueclears the event queue of the script



String
Explanation
An ordered collection of ascii (1-byte) characters. Declare with var s := "my string"
Methods
PrototypeReturnsDesc
[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/uninitseaches the string for 'substr'. If found, returns the first character of the substring, else uninitialized object.
[substr] := replace_strstringfinds the first occurance of 'substr' and replaces substr with 'replace_str'. returns the new string.
+ stringstringconcatenates the strings, returns the new string.



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
PrototypeReturnsDesc
.+membern/astruct.+member adds a member
.membervaluegets value of member
[member]valuegets value of member ONLY when member is a string! no using integers here like an array.



UObject
Children
Character
Item
Explanation
The base UO Object class
Members
NameTypeDescAccess
xintegerx coordinater/o
yintegery coordinater/o
zintegerz coordinater/o
nameStringname string (for items use .desc for single-click text)r/w
objtypeintegerobject type as defined in itemdesc.cfgr/o
graphicintegerart id numberr/w
serialintegerunique object identifierr/o
colorintegercolor value (0 to 0xFFF)r/w
facingintegerfacing or the object (meaningful for mobiles and light-emitting items) range 0-127r/w
heightintegerheight of the graphic as defined in tiledata.mulr/o
weightintegerweight of the graphic as defined in tiledata.mulr/o
multiMultiMultiRef for the Multi the object is onr/o
Methods
PrototypeReturnsDesc
isa(POLCLASS_*)booleanTrue if the derived class is the same as the passed class type (see uo.em for all constants)
set_member(string membername, obj value)object, new value of member or errorSets the built-in member 'membername' to 'value'. obj.set_member("name","u suck") is the same as obj.name := "u suck"
get_member(string membernameobject, value of member or errorGets the value of the built-in member 'membername'. var objname := obj.get_member("name") is the same as var objname := obj.name



Weapon
Parent
Equipment
Explanation
Equipable items that deal damage in combat
Members
NameTypeDescAccess
dmg_modintegerDamage Modifierr/w
attributestringAttribute name this weapon uses as a skillr/o
hitscriptstringScript name that runs when weapon makes a hitr/w




If you know if any information is incorrect on these pages, mail your corrections to racalac@polserver.com

Copyright ©2003-2011 David Carpman, all rights reserved. DO NOT REPRODUCE, MIRROR, ALTER, SPINDLE, MUTILATE, OR SIT ON.