File Constants:
const MSGLEN_VARIABLE := -1;
Functions:
Modules:
-
[+] Attribute
- AlterAttributeTemporaryMod
- BaseSkillToRawSkill
- CheckSkill
- GetAttribute
- GetAttributeBaseValue
- GetAttributeCap
- GetAttributeDefaultCap
- GetAttributeIntrinsicMod
- GetAttributeLock
- GetAttributeName
- GetAttributeTemporaryMod
- RawSkillToBaseSkill
- SetAttributeBaseValue
- SetAttributeCap
- SetAttributeLock
- SetAttributeTemporaryMod
- [+] Basic
- [+] BasicIO
- [+] Boat
- [+] CfgFile
- [+] CliLoc
- [+] DataFile
- [+] File
- [+] Guild
- [+] Http
- [+] Math
-
[+] Npc
- CanMove
- Face
- GetProperty
- IsLegalMove
- MakeBoundingBox
- Move
- RunAwayFrom
- RunAwayFromLocation
- RunToward
- RunTowardLocation
- Say
- SayUC
- Self
- SetAnchor
- SetOpponent
- SetProperty
- SetWarMode
- TurnAwayFrom
- TurnAwayFromLocation
- TurnToward
- TurnTowardLocation
- WalkAwayFrom
- WalkAwayFromLocation
- WalkToward
- WalkTowardLocation
- Wander
-
[+] OS
- Clear_Event_Queue
- Create_Debug_Context
- Debugger
- Events_Waiting
- GetEnvironmentVariable
- GetPid
- GetProcess
- HTTPRequest
- Is_Critical
- LoadExportedScript
- OpenConnection
- OpenURL
- PerformanceMeasure
- Run_Script
- Run_Script_To_Completion
- Set_Critical
- Set_Debug
- Set_Event_Queue_Size
- Set_Priority
- Set_Script_Option
- Sleep
- Sleepms
- Start_Script
- Start_Skill_Script
- SysLog
- Unload_Scripts
- Wait_For_Event
- [+] Party
- [+] PolSys
- [+] Storage
- [+] MySQL
- [+] Unicode
-
[+] UO
- Accessible
- AddAmount
- AddMenuItem
- ApplyConstraint
- AssignRectToWeatherRegion
- Attach
- Broadcast
- CanWalk
- CancelTarget
- CheckLineOfSight
- CheckLosAt
- CheckLosBetween
- CloseGump
- CloseTradeWindow
- CloseWindow
- ConsumeReagents
- ConsumeSubstance
- CoordinateDistance
- CoordinateDistanceEuclidean
- CreateAccount
- CreateItemAtLocation
- CreateItemCopyAtLocation
- CreateItemInBackpack
- CreateItemInContainer
- CreateItemInInventory
- CreateMenu
- CreateMultiAtLocation
- CreateNpcFromTemplate
- DestroyItem
- DestroyMulti
- Detach
- DisableEvents
- DisconnectClient
- Distance
- DistanceEuclidean
- EnableEvents
- EnumerateItemsInContainer
- EnumerateOnlineCharacters
- EquipFromTemplate
- EquipItem
- EraseGlobalProperty
- EraseObjProperty
- FindAccount
- FindObjtypeInContainer
- FindPath
- FindSubstance
- GetAmount
- GetCommandHelp
- GetCoordsInLine
- GetEquipmentByLayer
- GetFacing
- GetGlobalProperty
- GetGlobalPropertyNames
- GetHarvestDifficulty
- GetMapInfo
- GetMenuObjTypes
- GetMidpointCircleCoords
- GetMultiDimensions
- GetObjProperty
- GetObjPropertyNames
- GetObjType
- GetObjTypeByName
- GetRegionLightLevelAtLocation
- GetRegionName
- GetRegionNameAtLocation
- GetRegionString
- GetSpellDifficulty
- GetStandingCoordinates
- GetStandingHeight
- GetStandingLayers
- GetWorldHeight
- GrantPrivilege
- HarvestResource
- IsStackable
- ListAccounts
- ListEquippedItems
- ListGhostsNearLocation
- ListHostiles
- ListItemsAtLocation
- ListItemsInBoxOfObjType
- ListItemsNearLocation
- ListItemsNearLocationOfType
- ListItemsNearLocationWithFlag
- ListMobilesInBox
- ListMobilesInLineOfSight
- ListMobilesNearLocation
- ListMobilesNearLocationEx
- ListMultisInBox
- ListObjectsInBox
- ListObjectsInBoxOfClass
- ListOfflineMobilesInRealm
- ListStaticsAtLocation
- ListStaticsInBox
- ListStaticsNearLocation
- ListStaticsNearLocationOfType
- ListStaticsNearLocationWithFlag
- MoveItemToContainer
- MoveItemToSecureTradeWin
- MoveObjectToLocation
- OpenPaperdoll
- POLCore
- PerformAction
- PlayLightningBoltEffect
- PlayMovingEffect
- PlayMovingEffectEx
- PlayMovingEffectXYZ
- PlayMovingEffectXYZEx
- PlayMusic
- PlayObjectCenteredEffect
- PlayObjectCenteredEffectEx
- PlaySoundEffect
- PlaySoundEffectPrivate
- PlaySoundEffectXYZ
- PlayStationaryEffect
- PlayStationaryEffectEx
- PrintTextAbove
- PrintTextAbovePrivate
- ReadGameClock
- RegisterForSpeechEvents
- ReleaseItem
- RequestInput
- ReserveItem
- RestartScript
- Resurrect
- RevokePrivilege
- SaveWorldState
- SecureTradeWin
- SelectColor
- SelectMenuItem2
- SendBuyWindow
- SendCharProfile
- SendCharacterRaceChanger
- SendDialogGump
- SendEvent
- SendHousingTool
- SendInstaResDialog
- SendOpenBook
- SendOpenSpecialContainer
- SendOverallSeason
- SendPacket
- SendPopUpMenu
- SendQuestArrow
- SendSellWindow
- SendSkillWindow
- SendStatus
- SendStringAsTipWindow
- SendSysMessage
- SendTextEntryGump
- SendViewContainer
- SetGlobalProperty
- SetName
- SetObjProperty
- SetRegionLightLevel
- SetRegionWeatherLevel
- SetScriptController
- Shutdown
- SingleClick
- SpeakPowerWords
- StartSpellEffect
- SubtractAmount
- SystemFindObjectBySerial
- Target
- TargetCoordinates
- TargetMultiPlacement
- UpdateItem
- UpdateMobile
- UseItem
- [+] Util
- [+] Vitals
AddRealm(realm_name, base_realm) | |
---|---|
Parameters: | |
Name | Type |
realm_name | String - case-sensitive name of the realm |
base_realm | String - case-sensitive name of the realm |
Explanation | |
Creates a new Realm based on an other realm, uses same map and regions. | |
Return values | |
1 | |
Errors | |
"BaseRealm not found." | |
"BaseRealm is a ShadowRealm." | |
"Realmname already defined." |
CreatePacket(type, size) | |
---|---|
Parameters: | |
Name | Type |
type | Integer |
size | Integer |
Explanation | |
Creates a new packet object. Type is the byte command id that always is set as the first byte (no need to set it yourself). Size is the fixed-length size for this packet, or MSGLEN_VARIABLE if it is variable length (no need to figure out the size in advance, the packet buffer will be resized as need by using the Set* methods). | |
Notes: polsys.em constants for this function: | |
const MSGLEN_VARIABLE := -1; | |
Return values | |
A new packet object or Error | |
Errors | |
"Invalid parameter type." | |
"Packet type too high" | |
Related | |
Packet |
DeleteRealm(realm) | |
---|---|
Parameters: | |
Name | Type |
realm | String - case-sensitive name of the realm |
Explanation | |
Deletes a ShadowRealm, only if the realm is "clean" | |
Return values | |
1 | |
Errors | |
"Realm not found." | |
"Realm is not a ShadowRealm." | |
"Mobiles in Realm." | |
"Items in Realm." |
FormatItemDescription(desc, amount := 1, suffix := "") | |
---|---|
Parameters: | |
Name | Type |
desc | Base item description |
amount | Item amount |
suffix | Suffix to append |
Explanation | |
This formats the desc using Pols built in Singular/Plular formatter. | |
Return values | |
A string. |
GetCmdLevelName(number) | |
---|---|
Parameters: | |
Name | Type |
number | Integer |
Explanation | |
Will get a command level's name. | |
Return values | |
CmdLevelName or Error | |
Errors | |
"Invalid parameter type." | |
Related Configs | |
cmds.cfg |
GetCmdLevelNumber(name) | |
---|---|
Parameters: | |
Name | Type |
name | String |
Explanation | |
Will get the numeric value of a command level. | |
Return values | |
CmdLevel or Error | |
Errors | |
"Invalid parameter type." | |
"Could not find a command level with that name." | |
Related Configs | |
cmds.cfg |
GetItemDescriptor(objtype) | |
---|---|
Parameters: | |
Name | Type |
objtype | int Objtype OR string ObjtypeName |
Explanation | |
Returns a struct of all itemdesc.cfg properties for the objtype. | |
The keys are the property names, i.e. "Color", "Desc", etc. The values can be String, Integer, Real. The exceptions are "CProps" and "StackingIgnoresCProps". "CProps" is a dictionary where the CProp name is the key, and the value can be any packable type (i.e. array, struct, etc.). "StackingIgnoresCProps" is an array of strings. | |
Note: Descriptor of Weapon will return MinDamage and MaxDamage calculated from Damage-Dice too. | |
The primary use of this function is to pass it to any of the item creation functions, and the values in the struct will be used in place of the static itemdesc.cfg values. Use it to assign specific properties to an item during creation, rather than after. This allows easier stacking with existing item stacks. | |
Note: Not all properties can be assigned per-item, so editing the value in the descriptor struct will not be passed to the new item. | |
//For example, to stack with an existing stack with color 0x10 and cprop use uo; use polsys; program testdesc(who,objtype) var ret := GetItemDescriptor(CInt(objtype)); ret.Color := 0x10; ret.CProps.insert("blah","1"); //assuming the existing stack have this color and cprop ret.StackingIgnoresCProps.append("blingbling"); var item := CreateItemInBackpack(who,ret,10); if(item) print("OK!"); endif endprogram | |
To print the contents of the struct: var ret := GetItemDescriptor(objtype); foreach thing in ret print(_thing_iter + ": " + thing); endforeach | |
Return values | |
A struct of all itemdesc.cfg properties and values. | |
Errors | |
"Invalid parameter type" | |
"Itemdesc.cfg entry for objtype X not found." | |
Related Configs | |
itemdesc.cfg |
GetPackageByName(name) | |
---|---|
Parameters: | |
Name | Type |
name | String |
Explanation | |
Will return a package reference. | |
Return values | |
PackageRef or Error | |
Errors | |
"Invalid parameter type." | |
"No package found by that name." | |
Related | |
Package |
GetRealmDecay(realm_name) | |
---|---|
Parameters: | |
Name | Type |
realm_name | String - case-sensitive name of the realm |
Explanation | |
Returns whether realm has decay or enabled or not. | |
Return values | |
Boolean | |
Errors | |
"Realm not found." |
IncRevision( object ) | |
---|---|
Parameters: | |
Name | Type |
object | UObject Ref |
Explanation | |
Increases the internal "Revision" number of an UObject. Used to manually increase this number for scripted changes to things such as mob.race and such where core does not auto increase it. | |
Return values | |
1 on success | |
Errors | |
"Invalid parameter type." |
ListTextCommands(max_cmdlevel:=-1) | |
---|---|
Parameters: | |
Name | Type |
max_cmdlevel | Integer |
Explanation | |
Returns a dict of a dict of structs. | |
Dict 1 - Package names; Dict 2 - Command levels; Struct - .dir .script | |
Example: foreach package in ( commands ) Print("Pkg:"+_package_iter); foreach level in ( package ) Print(" CmdLvl:"+_level_iter); foreach command in ( level ) Print(" "+command); SleepMS(2); endforeach SleepMS(2); endforeach SleepMS(2); endforeach | |
Return values | |
Dict of a dict of structs |
ListenPoints( ) | |
---|---|
Explanation | |
Array of listen points... | |
Return values | |
Array | |
Errors | |
"Invalid parameter type." |
LogCPropProfile() | |
---|---|
Explanation | |
Writes the CProp profiling info into cpprofile.log file (see ProfileCProps option in pol.cfg). | |
Return values | |
1 or Error |
MD5Encrypt(str) | |
---|---|
Parameters: | |
Name | Type |
str | String |
Explanation | |
Encrypts given string. | |
Return values | |
MD5 hash string on success | |
Errors | |
"Invalid parameter" | |
"String is empty" | |
"Failed to encrypt" |
Packages() | |
---|---|
Explanation | |
Get an array of "package objects", with "name", "supports_http" and "npcdesc" members. (more info TBD) | |
Return values | |
An array of package objects. |
ReadMillisecondClock() | |
---|---|
Explanation | |
Returns a double of the current millisecond clock. The precision is 10ms. | |
Return values | |
Current time in milliseconds. |
Realms(realm:="") | |
---|---|
Parameters: | |
Name | Type |
realm | String |
Explanation | |
Returns a dictionary of structs or a single struct. | |
If a single case-sensitive realm name is passed, will return the information for only that realm. | |
example: | |
"realm_name" -> "width" "height" "mapid" "toplevel_item_count" "mobile_count" "season" | |
Return values | |
A dictionary of structs of Realms or struct of single Realm |
ReloadConfiguration() | |
---|---|
Explanation | |
reloads pol.cfg (most entries), npcdesc.cfg and bannedips.cfg | |
Linux: HUP signal will cause ReloadConfiguration to be called. | |
Return values | |
1 |
SetRealmDecay(realm_name, has_decay) | |
---|---|
Parameters: | |
Name | Type |
realm_name | String - case-sensitive name of the realm |
has_decay | Boolean - whether decay should be enabled or not |
Explanation | |
Enables or disables decay for realm. | |
Return values | |
1 | |
Errors | |
"Realm not found." |
SetSysTrayPopupText(text) | |
---|---|
Parameters: | |
Name | Type |
text | String tooltip text for systray icon |
Explanation | |
Sets the systray icon's tooltip text (win32 only) | |
Return values | |
1 |