2002-04-07 21:27:53 +00:00
# include "uox3.h"
# include "speech.h"
2002-10-25 05:24:55 +00:00
# include "cVersionClass.h"
Added:
-JS Get/Set "vulnerable" handlers for character properties (Abaddon)
-willHunger with Get/Set HungerStatus() wrappers to CChar class (can now
selectively stop a character/creature from continuing to hunger)
-JS Get/Set "willhunger" handlers for character properties Changed:
Linux compile fixes (thanks Malketh)
Hash.h warning fixed (thanks Philantrop)
Fixes to getRootPack() and getPackOwner()
Removed many #includes from the global scope, including them in the specific files that need them
This should greatly reduce compile time and filesize, along with the need to recompile after altering most headers
Removed the linux ifdefs around typedefd function declarations, this should work with gcc 3.2
Moved global loading functions into a new cFileIO() class to take them out of global scope
Fixed an issue causing items to not be sent to the client (thanks Malketh)
Moved some global structs into the CWorldMain class
Fixed a bug causing a crash on character / item creation
Moved all effects stuff into its own class to take it out of global scope
Changed the variable CChar::region to CChar::regionNum to avoid conflicts with the cTownRegion region[] indexes
Moved getbestskill(), isHuman(), and inDungeon() into the CChar class to remove them from global scope
Took npcSimpleAttackTarget() out of global scope
Rewrote restock() to make use of restockNPC()
Changed the typedef'd iterator in hash.h to HASHITERATOR to kill a Linux warning
Renamed cEffects::soundeffect() to PlaySound() and removed unneeded overloads
Fixed a bug causing executebatch to be set with locationcount data
Rewrote cEffects::bgsound()
Documented sounds.cpp
Misc minor cleanups / fixes
Removed:
sendItemsInRange() (CChar::Teleport() does the same thing)
Many #includes that were not being used
deathMenu()
respawnnow() and moved all of its code into command_respawn()
one instance of cEffects::scpSoundEffect() and renamed the other to PlaySound()
3/13/2003
Changed
Fixed an issue allowing the server to not have a dictionary.ZRO (which would cause a crash when a dictionary entry was called with no language)
Fixed an issue causing the server to puke when it attempted a restart
Moved SpawnRandomItem() into cItem class
Moved SpawnRandomMonster() into cCharHandle class
Broke necro.dfn into fishing.dfn and digging.dfn
Made better use of SpawnRandomItem() and SpawnRandomMonster()
3/12/2003
Added:
CPOpenGump and CPSpeech packet class to remove some global vars (Note these are pretty basic classes and someone
with a better understanding of how we handle sending/recieving packets could probably expand these to make better use of them)
Changed:
Moved many global vars into the CWorldMain() class
Cleaned ResetVars() in uox3.cpp as ResetDefaults() in CWorldMain() now handles much of that
Added a check to ensure text wasn't sent twice in talking(), should fix double-speech
Cleaned up cmdtable.cpp removing a couple duplicate entries, etc
Changed target() to only require 4 values (as the first two were always 0 and 1)
Removed many unneeded typedefs and globals
Went through cServerData() and noted unused server.ini entries
Moved title1(), title2(), and title3() to cClick.cpp since that is their only usage, made use
of MAX_TITLE to ensure we wouldn't overrun the buffers, and renamed them matching what title they were
3/11/2003
Changed:
Fixed a potentially very serious bugs with how containers were being set upon loading the world
Fixed possible re-adding of weight to containers and characters at load
Fixed a bug causing equipped items that were not weapons to take damage in combat
Minor cleanups / warning fixes / Linux compatability issues (punt)
3/7/2003
Overhauls/Additions/Major Changes
Changed:
Tweaks/Object Conversions/Misc Small Changes
Changed:
Changed CItem::Get/SetLayer() to a UI08
Fixed a bug in speech causing you to see your own text twice
Fixed a nasty crash bug
2003-03-23 10:18:02 +00:00
# include "cRaces.h"
# include "commands.h"
# include "skills.h"
2012-11-03 18:11:04 +00:00
# include "CJSMapping.h"
Added:
-JS Get/Set "vulnerable" handlers for character properties (Abaddon)
-willHunger with Get/Set HungerStatus() wrappers to CChar class (can now
selectively stop a character/creature from continuing to hunger)
-JS Get/Set "willhunger" handlers for character properties Changed:
Linux compile fixes (thanks Malketh)
Hash.h warning fixed (thanks Philantrop)
Fixes to getRootPack() and getPackOwner()
Removed many #includes from the global scope, including them in the specific files that need them
This should greatly reduce compile time and filesize, along with the need to recompile after altering most headers
Removed the linux ifdefs around typedefd function declarations, this should work with gcc 3.2
Moved global loading functions into a new cFileIO() class to take them out of global scope
Fixed an issue causing items to not be sent to the client (thanks Malketh)
Moved some global structs into the CWorldMain class
Fixed a bug causing a crash on character / item creation
Moved all effects stuff into its own class to take it out of global scope
Changed the variable CChar::region to CChar::regionNum to avoid conflicts with the cTownRegion region[] indexes
Moved getbestskill(), isHuman(), and inDungeon() into the CChar class to remove them from global scope
Took npcSimpleAttackTarget() out of global scope
Rewrote restock() to make use of restockNPC()
Changed the typedef'd iterator in hash.h to HASHITERATOR to kill a Linux warning
Renamed cEffects::soundeffect() to PlaySound() and removed unneeded overloads
Fixed a bug causing executebatch to be set with locationcount data
Rewrote cEffects::bgsound()
Documented sounds.cpp
Misc minor cleanups / fixes
Removed:
sendItemsInRange() (CChar::Teleport() does the same thing)
Many #includes that were not being used
deathMenu()
respawnnow() and moved all of its code into command_respawn()
one instance of cEffects::scpSoundEffect() and renamed the other to PlaySound()
3/13/2003
Changed
Fixed an issue allowing the server to not have a dictionary.ZRO (which would cause a crash when a dictionary entry was called with no language)
Fixed an issue causing the server to puke when it attempted a restart
Moved SpawnRandomItem() into cItem class
Moved SpawnRandomMonster() into cCharHandle class
Broke necro.dfn into fishing.dfn and digging.dfn
Made better use of SpawnRandomItem() and SpawnRandomMonster()
3/12/2003
Added:
CPOpenGump and CPSpeech packet class to remove some global vars (Note these are pretty basic classes and someone
with a better understanding of how we handle sending/recieving packets could probably expand these to make better use of them)
Changed:
Moved many global vars into the CWorldMain() class
Cleaned ResetVars() in uox3.cpp as ResetDefaults() in CWorldMain() now handles much of that
Added a check to ensure text wasn't sent twice in talking(), should fix double-speech
Cleaned up cmdtable.cpp removing a couple duplicate entries, etc
Changed target() to only require 4 values (as the first two were always 0 and 1)
Removed many unneeded typedefs and globals
Went through cServerData() and noted unused server.ini entries
Moved title1(), title2(), and title3() to cClick.cpp since that is their only usage, made use
of MAX_TITLE to ensure we wouldn't overrun the buffers, and renamed them matching what title they were
3/11/2003
Changed:
Fixed a potentially very serious bugs with how containers were being set upon loading the world
Fixed possible re-adding of weight to containers and characters at load
Fixed a bug causing equipped items that were not weapons to take damage in combat
Minor cleanups / warning fixes / Linux compatability issues (punt)
3/7/2003
Overhauls/Additions/Major Changes
Changed:
Tweaks/Object Conversions/Misc Small Changes
Changed:
Changed CItem::Get/SetLayer() to a UI08
Fixed a bug in speech causing you to see your own text twice
Fixed a nasty crash bug
2003-03-23 10:18:02 +00:00
# include "cScript.h"
# include "cEffects.h"
2012-11-03 18:11:04 +00:00
# include "CPacketSend.h"
# include "CResponse.h"
# include "movement.h"
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
# include "Dictionary.h"
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
# include "StringUtility.hpp"
2002-04-07 21:27:53 +00:00
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
//| Function - ClilocMessage()
//o------------------------------------------------------------------------------------------------o
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| Purpose - Sends a cliloc message to the client, which is displayed as a system message
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
void ClilocMessage ( CSocket * mSock , SpeechType speechType , UI16 hue , UI16 font , UI32 messageNum , const char * types = " " , . . . )
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
{
bool multipleArgs = false ;
2021-04-27 01:51:20 +08:00
std : : string argList = " " ;
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
std : : string stringVal = " " ;
const char * typesPtr = types ;
va_list marker ;
va_start ( marker , types ) ;
while ( * typesPtr ! = ' \0 ' )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
if ( * typesPtr = = ' i ' )
{
stringVal = oldstrutil : : number ( va_arg ( marker , SI32 ) ) ;
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
}
2022-10-24 18:39:33 +08:00
else if ( * typesPtr = = ' s ' )
{
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
stringVal = va_arg ( marker , char * ) ;
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
}
2012-11-03 18:11:04 +00:00
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
if ( ! stringVal . empty ( ) )
{
if ( ! multipleArgs )
2002-04-07 21:27:53 +00:00
{
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
multipleArgs = true ;
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
argList = stringVal ;
2002-04-07 21:27:53 +00:00
}
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
else
2022-10-24 18:39:33 +08:00
{
2022-03-04 07:35:46 -05:00
argList + = oldstrutil : : format ( " \t %s " , stringVal . c_str ( ) ) ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
}
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
+ + typesPtr ;
}
va_end ( marker ) ;
2002-04-07 21:27:53 +00:00
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
CPClilocMessage toSend ;
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
toSend . Type ( speechType ) ;
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
toSend . Hue ( hue ) ;
toSend . Font ( font ) ;
toSend . Message ( messageNum ) ;
toSend . ArgumentString ( argList ) ;
2002-04-07 21:27:53 +00:00
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
mSock - > Send ( & toSend ) ;
}
2002-04-07 21:27:53 +00:00
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
//| Function - ClilocMessage()
//o------------------------------------------------------------------------------------------------o
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| Purpose - Sends a clilocmessage to the client, which will be displayed as if said by srcObj
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
void ClilocMessage ( CSocket * mSock , CBaseObject * srcObj , SpeechType speechType , UI16 hue , UI16 font , UI32 messageNum , bool sendAll , const char * types = " " , . . . )
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
{
bool multipleArgs = false ;
2021-04-27 01:51:20 +08:00
std : : string argList = " " ;
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
std : : string stringVal = " " ;
const char * typesPtr = types ;
va_list marker ;
va_start ( marker , types ) ;
while ( * typesPtr ! = ' \0 ' )
2002-04-07 21:27:53 +00:00
{
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
if ( * typesPtr = = ' i ' )
2022-10-24 18:39:33 +08:00
{
stringVal = oldstrutil : : number ( va_arg ( marker , SI32 ) ) ;
}
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
else if ( * typesPtr = = ' s ' )
2022-10-24 18:39:33 +08:00
{
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
stringVal = va_arg ( marker , char * ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
if ( ! stringVal . empty ( ) )
{
if ( ! multipleArgs )
2002-04-07 21:27:53 +00:00
{
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
multipleArgs = true ;
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
argList = stringVal ;
2002-04-07 21:27:53 +00:00
}
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
else
2022-10-24 18:39:33 +08:00
{
2022-03-04 07:35:46 -05:00
argList + = oldstrutil : : format ( " \t %s " , stringVal . c_str ( ) ) ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
}
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
+ + typesPtr ;
}
va_end ( marker ) ;
2002-04-07 21:27:53 +00:00
2022-10-24 18:39:33 +08:00
CPClilocMessage toSend ( ( * srcObj ) ) ;
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
toSend . Type ( speechType ) ;
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
toSend . Hue ( hue ) ;
toSend . Font ( font ) ;
toSend . Message ( messageNum ) ;
toSend . ArgumentString ( argList ) ;
2002-04-07 21:27:53 +00:00
2022-10-24 18:39:33 +08:00
bool sendSock = ( mSock ! = nullptr ) ;
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
if ( sendAll )
{
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
UI16 searchDistance = DIST_SAMESCREEN ;
2021-07-29 01:01:12 +08:00
if ( speechType = = WHISPER | | speechType = = ASCIIWHISPER )
2022-10-24 18:39:33 +08:00
{
2021-07-29 01:01:12 +08:00
searchDistance = DIST_SAMETILE ;
2022-10-24 18:39:33 +08:00
}
2021-07-29 01:01:12 +08:00
else if ( speechType = = YELL | | speechType = = ASCIIYELL )
2022-10-24 18:39:33 +08:00
{
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
searchDistance = DIST_SAMESCREEN * 1.5 ;
2022-10-24 18:39:33 +08:00
}
2021-07-29 01:01:12 +08:00
else if ( speechType = = EMOTE | | speechType = = ASCIIEMOTE )
2022-10-24 18:39:33 +08:00
{
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
searchDistance = DIST_INRANGE ;
2022-10-24 18:39:33 +08:00
}
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
2022-10-24 18:39:33 +08:00
for ( auto & tmSock : FindNearbyPlayers ( srcObj , searchDistance ) )
{
if ( sendSock & & ( tmSock = = mSock ) )
{
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
sendSock = false ;
2022-10-24 18:39:33 +08:00
}
2022-06-06 14:24:41 -04:00
tmSock - > Send ( & toSend ) ;
2002-04-07 21:27:53 +00:00
}
}
2021-05-27 05:42:35 +08:00
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
if ( sendSock )
2022-10-24 18:39:33 +08:00
{
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
mSock - > Send ( & toSend ) ;
2022-10-24 18:39:33 +08:00
}
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
}
2002-04-07 21:27:53 +00:00
2012-11-03 18:11:04 +00:00
CSpeechQueue * SpeechSys ;
2002-04-07 21:27:53 +00:00
2022-10-24 18:39:33 +08:00
std : : map < std : : string , UnicodeTypes > codeLookup ;
2002-04-07 21:27:53 +00:00
2022-06-22 07:35:21 -04:00
void InitializeLookup ( )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
for ( SI32 i = static_cast < SI32 > ( ZERO ) ; i < static_cast < SI32 > ( TOTAL_LANGUAGES ) ; + + i )
{
codeLookup [ LanguageCodes [ static_cast < UnicodeTypes > ( i ) ] ] = static_cast < UnicodeTypes > ( i ) ;
}
2002-04-07 21:27:53 +00:00
}
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
//| Function - FindLanguage()
//o------------------------------------------------------------------------------------------------o
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| Purpose - Attempt to find language used by client
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
2012-11-03 18:11:04 +00:00
UnicodeTypes FindLanguage ( CSocket * s , UI16 offset )
2002-04-07 21:27:53 +00:00
{
2021-06-12 07:30:23 -04:00
if ( s = = nullptr )
2012-11-03 18:11:04 +00:00
return ZERO ;
2002-04-07 21:27:53 +00:00
2012-11-03 18:11:04 +00:00
char langCode [ 4 ] ;
langCode [ 0 ] = s - > GetByte ( offset ) ;
langCode [ 1 ] = s - > GetByte ( + + offset ) ;
langCode [ 2 ] = s - > GetByte ( + + offset ) ;
langCode [ 3 ] = 0 ;
2002-04-07 21:27:53 +00:00
2021-04-27 01:51:20 +08:00
std : : string ulangCode = langCode ;
2022-03-04 07:35:46 -05:00
ulangCode = oldstrutil : : upper ( ulangCode ) ;
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
2012-11-03 18:11:04 +00:00
UnicodeTypes cLang = s - > Language ( ) ;
if ( LanguageCodes [ cLang ] ! = ulangCode . c_str ( ) )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
std : : map < std : : string , UnicodeTypes > : : const_iterator p = codeLookup . find ( ulangCode ) ;
2012-11-03 18:11:04 +00:00
if ( p ! = codeLookup . end ( ) )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
return p - > second ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
else
2022-10-24 18:39:33 +08:00
{
Console . Error ( oldstrutil : : format ( " Unknown language type \" %s \" . PLEASE report this in the Bugs section of the forums at https://www.uox3.org! " , ulangCode . c_str ( ) ) ) ;
}
2002-04-07 21:27:53 +00:00
}
2012-11-03 18:11:04 +00:00
return cLang ;
2002-04-07 21:27:53 +00:00
}
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
//| Function - SysBroadcast()
//o------------------------------------------------------------------------------------------------o
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| Purpose - This function was adapted to be used with the new code
2012-11-03 18:11:04 +00:00
//| in the console thread that allows text to be entered on
//| the console and it be shipped out to all logged in players.
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//|
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
//| Changes - (February 27, 2000)
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
void SysBroadcast ( const std : : string & txt )
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
if ( ! txt . empty ( ) )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
/*if( cwmWorldState->ServerData()->UseUnicodeMessages() )
{
Network - > pushConn ( ) ;
for ( CSocket * mSock = Network - > FirstSocket ( ) ; ! Network - > FinishedSockets ( ) ; mSock = Network - > NextSocket ( ) )
{
CChar * mChar = mSock - > CurrcharObj ( ) ;
if ( ValidateObject ( mChar ) )
{
CPUnicodeMessage unicodeMessage ;
unicodeMessage . Message ( txt ) ;
unicodeMessage . Font ( 0xFFFF ) ;
unicodeMessage . Colour ( 0xFFFF ) ;
unicodeMessage . Type ( 1 ) ;
unicodeMessage . Language ( " ENG " ) ;
unicodeMessage . Name ( " System " ) ;
unicodeMessage . ID ( 0 ) ;
unicodeMessage . Serial ( 0 ) ;
mSock - > Send ( & unicodeMessage ) ;
}
}
Network - > popConn ( ) ;
}
else
{ */
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
CSpeechEntry & toAdd = SpeechSys - > Add ( ) ;
toAdd . Speech ( txt ) ;
toAdd . Font ( FNT_NORMAL ) ;
toAdd . Speaker ( INVALIDSERIAL ) ;
toAdd . SpokenTo ( INVALIDSERIAL ) ;
toAdd . Type ( SYSTEM ) ;
toAdd . At ( cwmWorldState - > GetUICurrentTime ( ) ) ;
toAdd . TargType ( SPTRG_BROADCASTPC ) ;
toAdd . Colour ( 0x084D ) ;
toAdd . Font ( FNT_BOLD ) ;
toAdd . SpeakerName ( " System: " ) ;
//}
2002-04-07 21:27:53 +00:00
}
}
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
bool WhichResponse ( CSocket * mSock , CChar * mChar , std : : string text , CChar * tChar = nullptr ) ;
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
//| Function - CPITalkRequest::Handle()
//o------------------------------------------------------------------------------------------------o
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| Purpose - Handles speech requests from client
//|
//| Notes - Unicode speech format
//| byte=char, short=char[2], int=char[4], wchar=char[2]=unicode character
//|
//| Message Sent By Client:
//| 0xAD - Unicode Speech Request
//| UI08 cmd (0xAD)
//| short msgsize 1,2
//| byte type (0=say, 2=emote, 8=whisper, 9=yell) 3
//| short color 4,5
//| short font 6,7
//| UI08[4] lang (null terminated, "enu " for US english.) 8,9,10,11
//| wchar[?] text (null terminated, ?=(msgsize-12)/2) 13
//|
//| Message Sent By Server:
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
//| Unicode Speech message(Variable # of bytes)
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| <09> BYTE cmd 0
//| <09> BYTE[2] blockSize 1-2
//| <09> BYTE[4] ID 3-6
//| <09> BYTE[2] Model 7-8
//| <09> BYTE Type 9
//| <09> BYTE[2] Color 10-11
//| <09> BYTE[2] Font 12-13
//| <09> BYTE[4] Language 14-17 (3 byte unicode language, mirrored from client)
//| <09> BYTE[30] Name 18-47
//| <09> BYTE[?][2] Msg - Null Terminated (blockSize - 48) 48+?
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
2012-11-03 18:11:04 +00:00
bool CPITalkRequest : : Handle ( void )
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
if ( HandleCommon ( ) )
return true ;
2022-10-24 18:39:33 +08:00
CChar * mChar = tSock - > CurrcharObj ( ) ;
if ( ! ValidateObject ( mChar ) )
2012-11-03 18:11:04 +00:00
return true ;
2022-10-24 18:39:33 +08:00
char * asciiText = Text ( ) ;
if ( strlen ( asciiText ) = = 0 )
0.99.4x
Fixed an issue where the color of NPC corpse names would not always match up with the NPC's flag color
Fixed a bug where the baseRange and maxRange properties of ranged weapons would not get saved to world files. These values are now saved in the format of RANGE=baseRange,maxRange
Changed the way items are added to containers, to ensure that the order in which the items are displayed to the player always reflects the order in which they were added; now the most recent item added/moved in a container will always be rendered on top of older items.
Made adjustments to how items are randomly added to containers; should use more of a given container gump's available area now
Exposed Item property to JS engine, which contains serial of the creator of an item:
.creator // contains serial of the creator of an item. If set, maker's marks will show up in the item's tooltip
Fixed an issue where JS engine would lose track of script context if one script used CreateDFNItem() or SpawnNPC() functions and the new objects had events that triggered upon creation. UOX3 now restores the original script context at the tail end of these functions.
Added new JS Event to allow inserting custom tooltip text for objects, which will be displayed in tooltips right after the object name. Any text returned from the event will be displayed, and the text can make use of the same HTML tags as gumps to make changes to color, font, etc.
onTooltip( myObj ) // Triggers for objects right before the object's tooltip properties are sent to client
Updated 'tweak and 'set commands to refresh item being modified if movable state of item changes, so the change is reflected in nearby clients
Fixed an issue with NPC vendors and items bought from players not being properly removed from the vendor's "bought container" when players buy them again
Ported Item Identification skill from code to JS (js/skill/itemid.js) and removed hard-coded version
Implemented magic item generator in JS (js/item/magic_item.js). When this script is attached to an NPC, it has a chance to generate magic weapons, armors, wands/staffs and rings as loot on the NPC's corpse when slain. The chance of getting quality magical items increases with the fame level of the NPC in question. The types of magical items generated follows the pattern of such items as implemented in UO prior to the AoS expansion.
Examples:
exceedingly accurate war hammer of vanquishing
substantial, accurate axe of power and Daemon's Breath
silver long sword
massive platemail arms of Protection
metal shield of defense
durable ringmail tunic of guarding
All magic items have a chance to have spell effects attached (with rings/wands being guaranteed to have these), with a limited amount of charges available. For weapons, these effects activate on successful hits in combat, while for armors they activate on equip, and then periodically as long as the item is worn. Rings and wands/staffs have to be manually activated and targeted - with the exception of rings of invisibility, which activate the moment you equip them!
Related scripts:
js/item/magic_armor_equipeffects.js
js/item/magic_weapon_accbonus.js
js/item/magic_weapon_equip.js
js/item/magic_weapon_spell_attack.js
The magic item loot generation script has been attached to a number of different NPCs, all of which now have a chance to drop magic items as loot when defeated.
A bonus magical item - the glacial staff - has also been implemented (js/item/magic_glacial_staff.js), and has a chance to drop as loot from Giant Ice Serpents!
Fixed an issue with CustomTarget where the target message would not be displayed if the cursorType parameter was provided
Fixed bug with 'rename command, which referenced a non-existing variable that caused a script crash
Added additional object properties to 'get and 'set commands:
.shouldSave // Determines if an item should be saved in worldfiles or not
.baseRange // Determines the base range of a ranged weapon, less than which it becomes less effective
.maxRange // Determines the max range of a ranged weapon, beyond which it cannot reach its target
The feature that allows stats like Strength, Dexterity and Intelligence to provide bonuses to skill checks has been turned into a UOX.INI setting, which is disabled by default. The bonuses have also been nerfed; they will no longer contribute more to the success of a skill check than the actual skill being checked!
STATSAFFECTSKILLCHECKS=0/1 // If enabled, stats can provide bonuses to skill checks based on the weighting for those stats as setup in dfndata/skills/skills.dfn
Updated damage tracking code to include the type of damage that was dealt (PHYSICAl vs HEAT vs COLD, etc)
Updated Character JS Method Damage() to include a new parameter that can specify the type of damage that was dealt to the character. The new parameter must always be included if other optional parameters are used. Note that updates might be required for scripts making use of this method.Updated syntax:
.Damage( amount )
.Damage( amount, damageType )
.Damage( amount, damageType, attacker )
.Damage( amount, damageType, attacker, doRepsys )
Supported damageTypes:
PHYSICAL = 1
LIGHT = 2
RAIN = 3
COLD = 4
HEAT = 5
LIGHTNING = 6 // magic damage
POISON = 7
SNOW = 8
Updated JS Event OnDamage to include an additional parameter that describes the type of damage that was dealt. New syntax:
onDamage( damaged, attacker, damageValue, damageType )
Updated JS Event OnSpellTarget to allow rejecting a spell being cast on a target by returning a value of 2 from the script
Split the character priv flag for magic reflection into a temporary one (one-time magic reflection spell) and a permanent one (innate permanent reflection ability). The temporary effect is put in place by Magic Reflection spell, and is removed after a successful spell reflect. The permanent one is an innate ability of a character and is not removed even after a spell is reflected.
Added new Character JS property to get/set state of a character's permanent magic reflect ability:
.permanentMagicReflect // 0 = disable, 1 = enable
Added special abilities/effects for the following NPCs:
Acid Elementals now have a chance to damage the melee weapons of their attackers
Dull Copper Elementals now explode on death
Shadow Iron Elemental is immune to targeted spell damage
Copper Elementals have permanent magic reflect, and reflect some physical damage back at their attacker
Bronze Elementals deal passive area damage to nearby players every 5 to 10 seconds
Valorite Elementals have permanent magic reflect, reflect some physical damage back at their attacker
Snow/Ice Elementals deal passive area damage to nearby players every 5 to 10 seconds
Lava Serpents deal passive area damage to nearby players every 5 to 10 seconds
Phoenixes deal passive area damage to nearby players every 5 to 10 seconds
Pixies have a chance to cast a random spell upon receiving a death blow:
Bless (target)
Curse (target)
Explosion (target)
Greater Poison (target)
Greater Heal (self, prevents death)
Ethereal Warriors will now resurrect dead players with positive karma
Ethereal Warriors now have a chance to drain target's health, stamina or mana on hit
Fire Breath special ability added to the following NPCs, with the random ability damage scaling with the NPCs current health:
Hell Cat, 5 to 8 dmg at max health
Fire Steed, 6 to 9 dmg at max health
Hell Hounds, 8 to 11 dmg at max health
Lava Lizard, 8 to 11 dmg at max health
Predator Hell Cat, 9 to 14 dmg at max health
Sea Serpent, 11 to 17 dmg at max health
Swamp Dragon, 15 to 22 dmg at max health
Armored Swamp Dragon, 15 to 22 dmg at max health
Fire Gargoyle, 20 to 30 dmg at max health
Deep Sea Serpent, 21 to 32 dmg at max health
Serpentine Dragon, 22 to 32 dmg at max health
Drake (Gray), 22 to 32 dmg at max health
Drake (Red), 22 to 32 dmg at max health
Nightmare, 26 to 39 dmg at max health
Dark Steed, 26 to 39 dmg at max health
Silver Steed, 26 to 39 dmg at max health
Kraken, 39 to 59 dmg at max health
Dragon (Red), 41 to 62 dmg at max health
Dragon (Gray), 41 to 62 dmg at max health
Shadow Wyrm, 50 to 75 dmg at max health
Reptalon, 51 to 77 dmg at max health
Skeletal Dragon, 52 to 77 dmg at max health
Ancient Wyrm, 60 to 90 dmg at max health
Update stats, skills and loot for all currently implemented NPCs
Removed an ancient piece of code that prevented corpses from being generated for various elementals and blade spirits on death. This was originally put in place because these creatures had no corpses, and would replace it with a backpack instead, but these creatures now all have corpses in all client versions supported by UOX3
Updated potions script (js/item/potion.js) with updated formula for amount of hitpoints healed by healing potions, and added restrictions for using them when at full health and/or if poisoned (Dragon Slayer)
Fixed a bug where creatures (and humans, if FORCENEWANIMATIONPACKET was disabled in uox.ini) would play animations with wrong frame count, causing the animations to either freeze for a few frames at the end, or get cut off a couple of frames early
Implemented bonus hit chance for Archery skill, based on mention of such a bonus in Publish 5 patch notes and related UO House of Commons chat. This has been exposed as a UOX.INI setting where this bonus can be tweaked:
ARCHERYHITBONUS=10 // Bonus hit chance for Archery skill added to regular hit chance in combat. Defaults to 10%
Implemented optional extra delay between moving and being able to shoot with ranged weapons in combat (in addition to whatever delay is there due to speed of the ranged weapon). This is exposed as a UOX.INI setting:
ARCHERYSHOOTDELAY=0.5 // Minimum delay in seconds from a player stops moving until they can start to fire their ranged weapon. Defaults to 0.5s
Fixed a bug where players who never entered combat mode could fire ranged weapons while moving
Updated Add-menu with some improvements for usability:
Menu now directly on the Objects (previously "Shard") tab for quicker access, with a small welcome text and quick-link button for UOX3 docs
Settings tab contains some (persistent, will be saved with character) options for how the Add-menu behaves, along with a few quick-access buttons to some useful commands. Available options:
Option to add chosen item at specific location instead of in GM's backpack
Option to add chosen item repeatedly until cancelled
Option to automatically reopen Add-menu on last menu that was open when a selection is made
Option to force decayable state of all added items to either off (doesn't decay), on (decays) or nothing (use item default)
Option to force movable state of all added items to either off (not movable), on (movable) or nothing (use item default)
Added a Home button at the bottom of the menu, that takes the user back to the front page of the Add-menu regardless of which menu page they're on
Updated Character/Socket JS Method SysMessage() with an optional parameter to specify the color used to display the system message. Updated syntax:
.SysMessage( "Text" ) // Display "Text" to user as a system message with default system message color from ini
.SysMessage( "Text %s %s", txtArg1, txtArg2 ) // Display "Text" to player with string arguments injected into text
.SysMessage( txtColor, "Text" ) // Display "Text" to user with a specified color
.SysMessage( txtColor, "Text %s %s", txtArg1, txtArg2 ) // Combination of text color, text and string arguments
Fixed a bug where hair/beard items could show up inside corpses
Fixed a bug where items could sometimes vanish (visually) from containers when bouncing back because player was not able to pick them up
Fixed a bug where players would be unable to pick up a freely movable item from a locked down container
Updated handling of item bouncing on pickup to use UOX3 dictionary messages instead of hard-coded client messages
Added support for new Dictionary language:
dictionary.POL - Polish (SERVERLANGUAGE=8 in uox.ini, or client language 83 if SERVERLANGUAGE is set to 0)
Added taming restrictions for Unicorn, Ki-Rin and Cu Sidhe (js/skill/taming.js)
Added modification of some creatures stats after they've been tamed (js/skill/taming.js)
Added restrictions for who can ride certain creatures (Unicorn, Ki-Rin, Cu Sidhe)
Updated words of power for Meteor Swarm spell to follow the same logic as other spells using Kal (Summon): Kal Des Flam Ylem
Added new Item/Character JS Methods to get/set temporary custom tags which don't persist across worldsaves (or across reconnects, for players):
.GetTempTag( "tagName" )
.SetTempTag( "tagName", tagValue )
When applying HPMAX, STAMINAMAX AND MANAMAX DFN tags to new NPCs, their current HP, STAMINA and MANA properties will now be automatically updated to match
Fixed a server crash caused by empty speech messages sent from certain clients
Fixed a bug that prevented teleport locations in Felucca/Trammel from working properly
Updated calculations in code for duration and damage of existing poison strengths (1 - Lesser, 2 - Normal, 3 - Greater, 4 - Deadly) to match with ~Publish 15 (LBR/pre-AoS), and added another poison strength for monster usage (5 - Lethal)
The strength of the Poison and Poison Field spells is now based on the average of the caster's Magery and Poisoning skills, the distance from the target (Poison spell only) and the target's Resisting Spells skill. If caster is further away than 2 tiles from target, the poison strength always equals Lesser Poison, otherwise the following rules apply:
If caster's combined skill is higher than 100.0, poison strength equals Greater Poison, with 5% chance of Deadly Poison (if Poison spell) or Deadly Poison (if Poison Field spell)
If caster's combined skill is higher than 70.2, poison strength equals Greater Poison
If caster's combined skill is higher than 30.2, poison strength equals Normal Poison
If caster's combined skill is 30.2 or lower, poison strength equals Lesser Poison
If target resists spell, poison strength is reduced by 1 level, unless it's already at the lowest level
Fixed an issue that would would let players move faster than they should have been allowed to
Fixed misc issues with Party System:
Mana and Stamina should now update for Party Members when added to the party, when going in/out of range and when their stats update while in range
Players who get disconnected or relog should now find themselves back in the same party they were in previously
Added system messages to inform party members about updates to their party, and to let invited players know they've successfully joined a party (or rejoined, if relogging)
World saves now operate on the principle of only saving changes done since the last world save. Combined with the fact that NPCs in UOX3 are only active if there are players in the same/neighbouring map regions, shard owners may expect to see a decrease in world save times ranging from ~11% to ~99%, depending on how active and how spread out their player base is. If no changes have taken place since last save, saves are virtually instantaneous!
2021-09-20 21:35:17 +08:00
return true ;
Minor JS revamp - multiple scripts per object!
Added TryParseJSVal() helper function in cScript.cpp, used to parse jsval values returned from script events. Provides results matching 0 (0, false), 1 (1, true) or any specific int value returned from script.
JS events updated to use new TryParseJSVal helper function (no change in behaviour):
onDecay, onResurrect, onCommand, onBuyFromVendor, onSellToVendor, onPickup, onCharDoubleClick, onSkillGump, onUseBandageMacro, onCombatStart, onCombatEnd, onDeathBlow, onBuy, onSell
JS events with slight change of behaviour after update to use TryParseJSVal:
onDrop, onDropItemOnItem, onDropItemOnNpc - previously, a blank or non-existent return value would be treated the same as a return true. This will now be treated as a return false. Update scripts accordingly!
JS events updated to support return values from scripts:
onCollide, onTalk, onSnooped, OnHungerChange
Return false or nothing to prevent hard code from running
Return true to allow hard code to run like normal
onStolenFrom, onAISliver, onLightChange, onVirtueGumpPress, onQuestGump, onSpecialMove, onSwing, onClick, onHouseCommand, onSellToVendor, onSkillCheck, onSpellGain, onSpellLoss
Return false to allow hard code and other scripts with event to run like normal
Return true to prevent hard code and other scripts with event from running
onSteal
Return false or nothing to allow hard code and other scripts with event to run like normal
Return true to prevent hard code and onStolenFrom event from running (theft failed?)
Return 2 to prevent hard code, but allow onStolenFrom event to run (theft succeeded, but handled in script?)
onLeaving, onEntrance, onEquip, onUnequip, onEnterEvadeState, onSoldToVendor, onBoughtFromVendor, onSpellSuccess, onSpellTarget, onFlagChange, onDeath
Return false or nothing to allow other scripts with event to run like normal
Return true to prevent other scripts with event from running
Added new JS events that run prior to items being equipped/unequipped, with support for return values:
onEquipAttempt( pEquipper, iEquipping )
onUnequipAttempt( pEquipper, iUnequipping )
Return false or nothing to reject attempt to equip/unequip item, and prevent hard-code or other scripts with event from running
Return true to allow hard code to run like normal
Added new JS event that runs prior to onSnooped event, for character doing the snooping:
onSnoopAttempt( snooped, snooper )
Return false or nothing to prevent hard code and other snooping-related events from running
Return true to allow hard code and other snooping-related events to run like normal
Updated onSnooped JS event to accept return values:
Return true when success state is true to prevent other scripts with event from running
Return true when success state is false to prevent hard code and other scripts with event from running
Updated onClick JS event to also run for characters with event attached (return 1 to prevent showing hard-coded name for whatever object is clicked)
Updated onSteal JS event to include a third parameter, an object reference for the target of the theft
Added support for assigning multiple JS scripts per object (item, multi, char, region).
Any time a scriptID is added to an object, the list of such IDs for that object will be sorted from lowest to highest scriptID, which also determines the execution order for the scripts. Note that if the same JS event is present in several scripts assigned to an object, each of those events will trigger, unless the rules about return values for said event prevent this
DFNs for Items, Multis, Characters and Regions can now contain multiple SCRIPT=scriptID tags per definition. Each such SCRIPT tag will be applied to the object in question, then sorted from lowest to highest scriptID by server.
Added new JS property for Items, Multis, Characters and Regions:
.scriptTriggers // If used to get property, will return array object with all script IDs assigned to object. If used to set property, will add script ID to existing list of script IDs for object.
Modified JS property for Items, Multis, Characters and Regions, which for backwards compatibility functions similar to in older versions:
.scripttrigger // If used to get property, will return last script ID in list of script IDs assigned to object. If used to set property, will clear list of script IDs and assign only the new ID
Added new JS Methods for Items, Multis, Characters and Regions:
.AddScriptTrigger( scriptID ) // Adds a new scriptID to list of scripts assigned to object
.RemoveScriptTrigger( scriptID ) // Remove a specific scriptID from object (0 = remove all)
Moved SETSCPTRIG command from code to JS (js/commands/targeting/scptrig.js), and supplemented it with some additional commands:
GETSCPTRIG // List out all scriptIDs assigned to object
SETSCPTRIG scriptID // Clears list of scriptIDs for object, then assigns the specified scriptID
ADDSCPTRIG scriptID // Adds specified scriptID to list of scriptsIDs assigned to object
REMOVESCPTRIG scriptID // Removes specified scriptID from list of scriptIDs assigned to object (0 = remove all)
2021-05-25 19:37:52 +08:00
std : : vector < UI16 > scriptTriggers = mChar - > GetScriptTriggers ( ) ;
for ( auto scriptTrig : scriptTriggers )
2002-04-07 21:27:53 +00:00
{
Minor JS revamp - multiple scripts per object!
Added TryParseJSVal() helper function in cScript.cpp, used to parse jsval values returned from script events. Provides results matching 0 (0, false), 1 (1, true) or any specific int value returned from script.
JS events updated to use new TryParseJSVal helper function (no change in behaviour):
onDecay, onResurrect, onCommand, onBuyFromVendor, onSellToVendor, onPickup, onCharDoubleClick, onSkillGump, onUseBandageMacro, onCombatStart, onCombatEnd, onDeathBlow, onBuy, onSell
JS events with slight change of behaviour after update to use TryParseJSVal:
onDrop, onDropItemOnItem, onDropItemOnNpc - previously, a blank or non-existent return value would be treated the same as a return true. This will now be treated as a return false. Update scripts accordingly!
JS events updated to support return values from scripts:
onCollide, onTalk, onSnooped, OnHungerChange
Return false or nothing to prevent hard code from running
Return true to allow hard code to run like normal
onStolenFrom, onAISliver, onLightChange, onVirtueGumpPress, onQuestGump, onSpecialMove, onSwing, onClick, onHouseCommand, onSellToVendor, onSkillCheck, onSpellGain, onSpellLoss
Return false to allow hard code and other scripts with event to run like normal
Return true to prevent hard code and other scripts with event from running
onSteal
Return false or nothing to allow hard code and other scripts with event to run like normal
Return true to prevent hard code and onStolenFrom event from running (theft failed?)
Return 2 to prevent hard code, but allow onStolenFrom event to run (theft succeeded, but handled in script?)
onLeaving, onEntrance, onEquip, onUnequip, onEnterEvadeState, onSoldToVendor, onBoughtFromVendor, onSpellSuccess, onSpellTarget, onFlagChange, onDeath
Return false or nothing to allow other scripts with event to run like normal
Return true to prevent other scripts with event from running
Added new JS events that run prior to items being equipped/unequipped, with support for return values:
onEquipAttempt( pEquipper, iEquipping )
onUnequipAttempt( pEquipper, iUnequipping )
Return false or nothing to reject attempt to equip/unequip item, and prevent hard-code or other scripts with event from running
Return true to allow hard code to run like normal
Added new JS event that runs prior to onSnooped event, for character doing the snooping:
onSnoopAttempt( snooped, snooper )
Return false or nothing to prevent hard code and other snooping-related events from running
Return true to allow hard code and other snooping-related events to run like normal
Updated onSnooped JS event to accept return values:
Return true when success state is true to prevent other scripts with event from running
Return true when success state is false to prevent hard code and other scripts with event from running
Updated onClick JS event to also run for characters with event attached (return 1 to prevent showing hard-coded name for whatever object is clicked)
Updated onSteal JS event to include a third parameter, an object reference for the target of the theft
Added support for assigning multiple JS scripts per object (item, multi, char, region).
Any time a scriptID is added to an object, the list of such IDs for that object will be sorted from lowest to highest scriptID, which also determines the execution order for the scripts. Note that if the same JS event is present in several scripts assigned to an object, each of those events will trigger, unless the rules about return values for said event prevent this
DFNs for Items, Multis, Characters and Regions can now contain multiple SCRIPT=scriptID tags per definition. Each such SCRIPT tag will be applied to the object in question, then sorted from lowest to highest scriptID by server.
Added new JS property for Items, Multis, Characters and Regions:
.scriptTriggers // If used to get property, will return array object with all script IDs assigned to object. If used to set property, will add script ID to existing list of script IDs for object.
Modified JS property for Items, Multis, Characters and Regions, which for backwards compatibility functions similar to in older versions:
.scripttrigger // If used to get property, will return last script ID in list of script IDs assigned to object. If used to set property, will clear list of script IDs and assign only the new ID
Added new JS Methods for Items, Multis, Characters and Regions:
.AddScriptTrigger( scriptID ) // Adds a new scriptID to list of scripts assigned to object
.RemoveScriptTrigger( scriptID ) // Remove a specific scriptID from object (0 = remove all)
Moved SETSCPTRIG command from code to JS (js/commands/targeting/scptrig.js), and supplemented it with some additional commands:
GETSCPTRIG // List out all scriptIDs assigned to object
SETSCPTRIG scriptID // Clears list of scriptIDs for object, then assigns the specified scriptID
ADDSCPTRIG scriptID // Adds specified scriptID to list of scriptsIDs assigned to object
REMOVESCPTRIG scriptID // Removes specified scriptID from list of scriptIDs assigned to object (0 = remove all)
2021-05-25 19:37:52 +08:00
cScript * toExecute = JSMapping - > GetScript ( scriptTrig ) ;
2021-06-12 07:30:23 -04:00
if ( toExecute ! = nullptr )
Minor JS revamp - multiple scripts per object!
Added TryParseJSVal() helper function in cScript.cpp, used to parse jsval values returned from script events. Provides results matching 0 (0, false), 1 (1, true) or any specific int value returned from script.
JS events updated to use new TryParseJSVal helper function (no change in behaviour):
onDecay, onResurrect, onCommand, onBuyFromVendor, onSellToVendor, onPickup, onCharDoubleClick, onSkillGump, onUseBandageMacro, onCombatStart, onCombatEnd, onDeathBlow, onBuy, onSell
JS events with slight change of behaviour after update to use TryParseJSVal:
onDrop, onDropItemOnItem, onDropItemOnNpc - previously, a blank or non-existent return value would be treated the same as a return true. This will now be treated as a return false. Update scripts accordingly!
JS events updated to support return values from scripts:
onCollide, onTalk, onSnooped, OnHungerChange
Return false or nothing to prevent hard code from running
Return true to allow hard code to run like normal
onStolenFrom, onAISliver, onLightChange, onVirtueGumpPress, onQuestGump, onSpecialMove, onSwing, onClick, onHouseCommand, onSellToVendor, onSkillCheck, onSpellGain, onSpellLoss
Return false to allow hard code and other scripts with event to run like normal
Return true to prevent hard code and other scripts with event from running
onSteal
Return false or nothing to allow hard code and other scripts with event to run like normal
Return true to prevent hard code and onStolenFrom event from running (theft failed?)
Return 2 to prevent hard code, but allow onStolenFrom event to run (theft succeeded, but handled in script?)
onLeaving, onEntrance, onEquip, onUnequip, onEnterEvadeState, onSoldToVendor, onBoughtFromVendor, onSpellSuccess, onSpellTarget, onFlagChange, onDeath
Return false or nothing to allow other scripts with event to run like normal
Return true to prevent other scripts with event from running
Added new JS events that run prior to items being equipped/unequipped, with support for return values:
onEquipAttempt( pEquipper, iEquipping )
onUnequipAttempt( pEquipper, iUnequipping )
Return false or nothing to reject attempt to equip/unequip item, and prevent hard-code or other scripts with event from running
Return true to allow hard code to run like normal
Added new JS event that runs prior to onSnooped event, for character doing the snooping:
onSnoopAttempt( snooped, snooper )
Return false or nothing to prevent hard code and other snooping-related events from running
Return true to allow hard code and other snooping-related events to run like normal
Updated onSnooped JS event to accept return values:
Return true when success state is true to prevent other scripts with event from running
Return true when success state is false to prevent hard code and other scripts with event from running
Updated onClick JS event to also run for characters with event attached (return 1 to prevent showing hard-coded name for whatever object is clicked)
Updated onSteal JS event to include a third parameter, an object reference for the target of the theft
Added support for assigning multiple JS scripts per object (item, multi, char, region).
Any time a scriptID is added to an object, the list of such IDs for that object will be sorted from lowest to highest scriptID, which also determines the execution order for the scripts. Note that if the same JS event is present in several scripts assigned to an object, each of those events will trigger, unless the rules about return values for said event prevent this
DFNs for Items, Multis, Characters and Regions can now contain multiple SCRIPT=scriptID tags per definition. Each such SCRIPT tag will be applied to the object in question, then sorted from lowest to highest scriptID by server.
Added new JS property for Items, Multis, Characters and Regions:
.scriptTriggers // If used to get property, will return array object with all script IDs assigned to object. If used to set property, will add script ID to existing list of script IDs for object.
Modified JS property for Items, Multis, Characters and Regions, which for backwards compatibility functions similar to in older versions:
.scripttrigger // If used to get property, will return last script ID in list of script IDs assigned to object. If used to set property, will clear list of script IDs and assign only the new ID
Added new JS Methods for Items, Multis, Characters and Regions:
.AddScriptTrigger( scriptID ) // Adds a new scriptID to list of scripts assigned to object
.RemoveScriptTrigger( scriptID ) // Remove a specific scriptID from object (0 = remove all)
Moved SETSCPTRIG command from code to JS (js/commands/targeting/scptrig.js), and supplemented it with some additional commands:
GETSCPTRIG // List out all scriptIDs assigned to object
SETSCPTRIG scriptID // Clears list of scriptIDs for object, then assigns the specified scriptID
ADDSCPTRIG scriptID // Adds specified scriptID to list of scriptsIDs assigned to object
REMOVESCPTRIG scriptID // Removes specified scriptID from list of scriptIDs assigned to object (0 = remove all)
2021-05-25 19:37:52 +08:00
{
// If script returned false/0, prevent hard-code (and other scripts with event) from running
if ( toExecute - > OnTalk ( mChar , asciiText ) = = 0 )
{
return true ;
}
}
2002-04-07 21:27:53 +00:00
}
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
2022-10-24 18:39:33 +08:00
if ( ( asciiText [ 0 ] = = cwmWorldState - > ServerData ( ) - > ServerCommandPrefix ( ) ) | | ( ( asciiText [ 0 ] = = ' . ' ) & & ( asciiText [ 1 ] ! = ' . ' ) ) )
{
2012-11-03 18:11:04 +00:00
Commands - > Command ( tSock , mChar , & asciiText [ 1 ] ) ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
else
{
2012-11-03 18:11:04 +00:00
if ( mChar - > IsDead ( ) )
{
if ( ! mChar - > IsAtWar ( ) )
{
mChar - > SetWar ( true ) ;
}
}
2021-07-29 01:01:12 +08:00
if ( ( Type ( ) ! = WHISPER & & Type ( ) ! = ASCIIWHISPER ) & & ( mChar - > GetVisible ( ) = = VT_TEMPHIDDEN | | mChar - > GetVisible ( ) = = VT_INVISIBLE ) )
2022-10-24 18:39:33 +08:00
{
2002-04-07 21:27:53 +00:00
mChar - > ExposeToView ( ) ;
2022-10-24 18:39:33 +08:00
}
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
2022-10-24 18:39:33 +08:00
if ( ( Type ( ) = = YELL | | Type ( ) = = ASCIIYELL ) & & mChar - > CanBroadcast ( ) )
2012-11-03 18:11:04 +00:00
{
CSpeechEntry & toAdd = SpeechSys - > Add ( ) ;
toAdd . Speech ( asciiText ) ;
2022-10-24 18:39:33 +08:00
toAdd . Font ( static_cast < FontType > ( mChar - > GetFontType ( ) ) ) ;
2012-11-03 18:11:04 +00:00
toAdd . Speaker ( mChar - > GetSerial ( ) ) ;
toAdd . SpokenTo ( INVALIDSERIAL ) ;
toAdd . Type ( PROMPT ) ;
toAdd . At ( cwmWorldState - > GetUICurrentTime ( ) ) ;
toAdd . TargType ( SPTRG_BROADCASTPC ) ;
if ( mChar - > GetSayColour ( ) = = 0x1700 )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
toAdd . Colour ( 0x5A ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
else if ( mChar - > GetSayColour ( ) = = 0x0 )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
toAdd . Colour ( 0x5A ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
else
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
toAdd . Colour ( mChar - > GetSayColour ( ) ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
toAdd . Font ( FNT_BOLD ) ;
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
UOX3 0.99.6-RC6
Removed arbitrary and hidden restrictions on refreshing list of online players shown with 'wholist command
Fixed an issue where player ghosts that get teleported would not see themselves get updated to new location
Fixed a server crash from clients disconnecting while running server in debug mode
Improved how container updates are sent to players; now only sends to clients that have actually opened the container, and who are still within range
Added more information about UO data files being loaded during server startup
Enhanced the GM 'add menu to allow clicking directly on images of items/npcs to add them, and adjusted size of menus to accommodate this
Fixed an issue with fleeing NPCs that could cause them to attempt to flee across time and space, regardless of distance to target/attacker in combat
Added NPC AI that runs away from players if they get too close (even outside combat). Applied to hind, rabbits, squirrels, ferrets and various birds by default:
AI_ANIMAL_SCARED (aitype 12)
Fixed issues with NPCs fleeing forever, or getting stuck in flee/don't flee loop, by introducing max fleeing distance (50 tiles) and cooldown (30 sec) on fleeing
Updated onNameRequest JS Event to include third parameter with origin of name request, so script responses can be tailored appropriately:
onNameRequest( myObj, requestedBy, requestSource )
Potential values for requestSource:
0 - Speech/System Messages
1 - Guild Menus
2 - Stat Window (self)
3 - Stat Window (other)
4 - Tooltip
5 - Paperdoll Journal
6 - Paperdoll
7 - Single Click / All-Names
8 - System
9 - Secure Trade Window
Added Adaptive Performance System (APS) that dynamically adjust how often NPC AI/movement is checked based on overall shard performance. If performance drops below defined threshold, UOX3 gradually slows down checks for NPC AI/movement to prioritize player movement/speech/command responsiveness. If performance climbs back up above threshold, slowdowns are gradually removed. The following UOX.INI options have been added under [system] category to support this system:
APSPERFTHRESHOLD=50 // Performance threshold (measured in simulation cycles/sec) below which the APS kicks in
APSINTERVAL=100 // How often (in milliseconds) the APS checks performance and makes adjustments (if needed) to balance out shard performance
APSDELAYSTEP=50 // How much the delay timer is modified by (in milliseconds) each time APS makes adjustments
APSDELAYMAXCAP=2000 // Max amount of of delay APS can introduce for NPC AI/movement handling when attempting to restore shard performance
Added new JS Methods for Region objects:
.GetOrePrefs( oreType ) // Get ore preference data for ore type found in town region. Returned as an array containing the following data:
orePrefData -> [
oreName, // name of ore
color, // color of ore
minskill, // min skill to mine ore
ingotName, // name of ingot created from ore
makemenu, // makemenu entry for crafting something from ingot
oreChance, // default global chance of finding this ore type
scriptID // script attached to mined ore
],
orePrefChance // Chance of finding this ore type in given town region
.GetOreChance() // Get base chance of finding any ore in town region
Moved Mining skill plus gravedigging feature from hard code to scripts (js/skill/mining.js) to make it easier to maintain and/or customize, and removed hard coded variants
Gravedigging now relies on the ore resource system behind the scenes to restrict how often graves in a given area can be dug up
Fixed some incorrect references to .worldNumber Character property in misc scripts (should be .worldnumber)
Made some "hard-scripted" system messages in misc scripts use dictionary system instead
Added spawn region for banker NPCs in Serpent's Hold (dfndata/spawn/felucca/spawn_town_serpents_hold.dfn, dfndata/spawn/trammel/spawn_town_serpents_hold.dfn)
Fixed region definition of Ocllo to actually cover the entire town (dfndata/regions/regions.dfn)
Added numerous additional locations accessible with 'goplace # command, for key locations in Ilshenar, Malas, Tokuno Islands and Ter Mur (dfndata/location/location.dfn)
Revised travel-menu portion of GM menu (shortcut: 'travel) to include more travel options based on new locations (dfndata/items/travelmenu.dfn and travelmenu.bulk.dfn)
Fixed an issue where NPCs could attempt to attack targets in other worlds/instances
Added new JS Event that triggers for characters who are about to deal damage in combat. Complimentary to onDamage, which triggers for chars receiving damage:
onDamageDeal( dmgDealer, dmgReceiver, damageValue, damageType )
Added new JS Event that can trigger in global script upon creation of new player chars. Note that this will trigger in place of onCreateDFN event for player characters:
onCreatePlayer( pChar )
Added new JS Event that triggers for characters selecting a target with a spell. Complimentary to onSpellTarget, which triggers for targets selected with a spell:
onSpellTargetSelect( caster, target, spellNum )
Updated onCombatStart and onCombatEnd JS Events to also trigger for the other party in combat
Updated onPickup JS Event to include a third parameter - the potential container item was picked up from. Event now also triggers event in scripts attached to said containers:
onPickup( iPickedUp, pChar, iCont )
Added tracking of total playtime per individual character, and per account across all characters, and exposed these properties to JS engine:
.totalPlayTime // Account property, total playtime across all chars
.playTime // Character property, total playtime on given character only
Added new player-accessible command ('playtime) to spit out the playtime of current character/account as a whole (js/commands/playtime.js)
Implemented first version of Young Player System:
Replaced the UNUSED9 account flag with YOUNG, to be used by Young/New Player System
Added new JS Account property that gets/sets whether player account is considered Young:
.isYoung
Added new Char timers:
TIMER_YOUNGHEAL // Restricts how often Young players are healed by NPC healers
TIMER_YOUNGMESSAGE // Restricts how often Young players are warned about dangerous looking monsters in overworld
Updated GM commands 'get and 'set to get/set .isYoung property of player's account (js/commands/targeting/get.js and set.js)
Added new UOX.INI setting to enable/disable Young Player System (enabled by default):
YOUNGPLAYERSYSTEM=1
If Young Player System is enabled, all newly created player accounts are automatically marked with Young flag
Added new script to handle various restrictions and functions related to Young characters (js/player/young_player.js):
Young characters will have [Young] displayed over their head
Young characters will have their Young status checked and verified on every login + every stat/skill gain, to revoke the Young status if any of the following is true:
Account has a total playtime of more than 40 hours
Any character has more than 350 total (base) skill points
Any character has more than 70 skill points in a single skill
Any character has more than 150 total stat points
Any character has more than 80 stat points in a single stat
Young characters can renounce their Young status manually by saying the words "I renounce my young player status"
Young characters get two additional items upon creation:
a new player ticket (can be combined with any other players new player ticket for both players to get a reward)
a sextant (shows Young players directions to nearest moongate/bank regardless of where they are, as long as outdoors)
Young characters cannot target other player characters with hostile spells or skills
Young characters cannot be the target of other player characters' hostile spells or skills
Young characters can only cast beneficial spells upon themselves or other Young characters
Young characters can only be the target of beneficial spells from other Young players
Young players (and their pets/followers) cannot attack or harm any other players (or their pets/followers), nor themselves be attacked or harmed by any other players (or their pets/followers), whether from combat, spells, skills or items
Young players don't lose any of their items on death, and are teleported to the nearest healer upon death with all their items intact
Young players receive a warning upon entering dungeons that monsters there will be hostile
Updated global script (js/server/global.js) to:
Check/Verify Young status of players upon login
Attach young player script on login/creation for players on Young accounts
Give specific items to Young players upon creation
Added new script (js/item/corpse.js) that is assigned to all freshly created corpses. This script handles restrictions related to Young players interactions with corpses, and the interactions of other players with corpses of Young players
Updated JS Method .Carve() to return true/false depending on whether carving a corpse was successful
Updated Healer AI in code to heal nearby injured Young players
Updated Evil AI and Evil Caster AI in code to avoid selecting Young players as targets in combat outside of dungeons
Added a new section to UOX.INI - [young player starting locations] - that can be used to define starting locations for Young players. If only one such location is provided, all players start there. Otherwise, it matches the same starting location setup as the regular one - with one entry per town in Britannia.
Restricted transferring and/or friending of pets (code) and hirelings (hirelings.js) between Young and non-Young players
Restricted Young players from recalling or gating to Felucca facet
Young players can instantly logout from anywhere, at any time
2023-07-01 20:02:40 +08:00
std : : string mCharName = GetNpcDictName ( mChar , nullptr , NRS_SPEECH ) ;
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
toAdd . SpeakerName ( mCharName ) ;
2012-11-03 18:11:04 +00:00
}
2002-04-07 21:27:53 +00:00
else
{
2021-04-27 01:51:20 +08:00
std : : string text ( asciiText ) ;
2012-11-03 18:11:04 +00:00
if ( Type ( ) = = 0 )
2021-04-27 01:51:20 +08:00
{
2012-11-03 18:11:04 +00:00
mChar - > SetSayColour ( TextColour ( ) ) ;
2021-04-27 01:51:20 +08:00
}
2012-11-03 18:11:04 +00:00
if ( Type ( ) = = 2 )
2021-04-27 01:51:20 +08:00
{
2012-11-03 18:11:04 +00:00
mChar - > SetEmoteColour ( TextColour ( ) ) ;
2021-04-27 01:51:20 +08:00
}
2022-10-24 18:39:33 +08:00
if ( cwmWorldState - > ServerData ( ) - > ServerSpeechLog ( ) & & ! mChar - > IsNpc ( ) ) // Logging
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
auto temp = oldstrutil : : format ( " %s.log " , mChar - > GetName ( ) . c_str ( ) ) ;
auto temp2 = oldstrutil : : format ( " %s [%x %x %x %x] [%i]: %s \n " , mChar - > GetName ( ) . c_str ( ) , mChar - > GetSerial ( 1 ) , mChar - > GetSerial ( 2 ) , mChar - > GetSerial ( 3 ) , mChar - > GetSerial ( 4 ) , mChar - > GetAccount ( ) . wAccountIndex , asciiText ) ;
Console . Log ( temp , temp2 ) ;
2002-04-07 21:27:53 +00:00
}
2022-03-04 07:35:46 -05:00
std : : string upperText = oldstrutil : : upper ( text ) ;
Boat improvements
Updated LeaveBoat() function to use ValidSpawnLocation() instead of ValidMultiLocation() for more reliable disembarking from boats
Added support for the following boat commands (and their triggerword aliases):
raise anchor // Raise anchor, allowing boat to move
drop anchor // Drops anchor, preventing boat from moving
forward one // Moves boat one tile forward
backward one // Moves boat one tile backward
left one // Moves boat one tile in port direction
right one // Moves boat one tile in starboard direction
forward left // Moves boat forward left diagonally
forward right // Moves boat forward right diagonally
backward left // Moves boat backward left diagonally
backward right // Moves boat backward right diagonally
forward left one // Moves boat one tile diagonally, forward left
forward right one // Moves boat one tile diagonally, forward right
backward left one // Moves boat one tile diagonally, backward left
backward right one // Moves boat one tile diagonally, backward right
Added new enum BoatMoveType to keep track of all the additional boat movement types, and changed moveType from UI08 to SI08, in order to use -1 as a representation of an "anchored" and immovable boat
Boats now start out with anchor dropped when initially placed, and must also have anchor dropped before they can be packed up into model ships, while anchor must be raised in order for tiller man to accept orders to sail
Added support for two new DFN tags in houses.dfn, primarily for the use of boats/boat holds:
MAXITEMS=# // Max items that can be stored in a boat's hold
WEIGHTMAX=# // Max weight that a boat's hold can... hold (40000 = 400.00 stones)
Updated dfndata/house/house.dfn to include default MAXITEMS (125 items) and WEIGHTMAX (400 stones) values for boats
Fixed an issue where large dragon ships would be spawned with incorrect names due to server assuming they're houses
Fixed an issue where it was not possible to turn a boat around under certain circumstances
Tiller men on boats will now be named "a tiller man" if the boat is unnamed, and "The tiller man of [ship name]" if the ship has been named
Boats now cannot be dry-docked if there are items in the hold
Boats now cannot be dry-docked if either of the planks are open
Names of boats are now stored in the title property of ship models, and is used to reapply the boat's name when unpacking the boat, while the ship model itself is named after the boat with a [Dry Docked] tag slapped on at the end.
2021-05-07 04:51:31 +08:00
if ( upperText . find ( " DEVTEAM033070 " ) ! = std : : string : : npos )
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
std : : string temp3 = " RBuild: " + CVersionClass : : GetRealBuild ( ) + " PBuild: " + CVersionClass : : GetBuild ( ) + " --> Version: " + CVersionClass : : GetVersion ( ) ;
2022-10-24 18:39:33 +08:00
tSock - > SysMessage ( temp3 . c_str ( ) ) ;
2002-04-07 21:27:53 +00:00
}
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
2022-10-24 18:39:33 +08:00
if ( ! WhichResponse ( tSock , mChar , text ) )
2012-11-03 18:11:04 +00:00
return true ;
2002-04-07 21:27:53 +00:00
2021-06-12 07:30:23 -04:00
CPUOXBuffer * txtToSend = nullptr ;
CPUOXBuffer * ghostedText = nullptr ;
CPUnicodeSpeech * uniTxtToSend = nullptr ;
CPUnicodeSpeech * uniGhostedText = nullptr ;
CPacketSpeech * asciiTxtToSend = nullptr ;
CPacketSpeech * asciiGhostedText = nullptr ;
2002-04-07 21:27:53 +00:00
2012-11-03 18:11:04 +00:00
if ( IsUnicode ( ) )
{
uniTxtToSend = new CPUnicodeSpeech ( ) ;
2022-10-24 18:39:33 +08:00
uniTxtToSend - > Object ( * ( static_cast < CPITalkRequestUnicode * > ( this ) ) ) ;
2012-11-03 18:11:04 +00:00
uniTxtToSend - > Object ( * mChar ) ;
txtToSend = uniTxtToSend ;
2002-04-07 21:27:53 +00:00
2012-11-03 18:11:04 +00:00
uniGhostedText = new CPUnicodeSpeech ( ) ;
2022-10-24 18:39:33 +08:00
( * uniGhostedText ) = ( * uniTxtToSend ) ;
2012-11-03 18:11:04 +00:00
uniGhostedText - > GhostIt ( 0 ) ;
2002-04-07 21:27:53 +00:00
2012-11-03 18:11:04 +00:00
ghostedText = uniGhostedText ;
}
else
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
asciiTxtToSend = new CPacketSpeech ( * ( static_cast < CPITalkRequestAscii * > ( this ) ) ) ;
2012-11-03 18:11:04 +00:00
asciiTxtToSend - > SpeakerSerial ( mChar - > GetSerial ( ) ) ;
2022-10-24 18:39:33 +08:00
asciiTxtToSend - > SpeakerModel ( mChar - > GetId ( ) ) ;
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
UOX3 0.99.6-RC6
Removed arbitrary and hidden restrictions on refreshing list of online players shown with 'wholist command
Fixed an issue where player ghosts that get teleported would not see themselves get updated to new location
Fixed a server crash from clients disconnecting while running server in debug mode
Improved how container updates are sent to players; now only sends to clients that have actually opened the container, and who are still within range
Added more information about UO data files being loaded during server startup
Enhanced the GM 'add menu to allow clicking directly on images of items/npcs to add them, and adjusted size of menus to accommodate this
Fixed an issue with fleeing NPCs that could cause them to attempt to flee across time and space, regardless of distance to target/attacker in combat
Added NPC AI that runs away from players if they get too close (even outside combat). Applied to hind, rabbits, squirrels, ferrets and various birds by default:
AI_ANIMAL_SCARED (aitype 12)
Fixed issues with NPCs fleeing forever, or getting stuck in flee/don't flee loop, by introducing max fleeing distance (50 tiles) and cooldown (30 sec) on fleeing
Updated onNameRequest JS Event to include third parameter with origin of name request, so script responses can be tailored appropriately:
onNameRequest( myObj, requestedBy, requestSource )
Potential values for requestSource:
0 - Speech/System Messages
1 - Guild Menus
2 - Stat Window (self)
3 - Stat Window (other)
4 - Tooltip
5 - Paperdoll Journal
6 - Paperdoll
7 - Single Click / All-Names
8 - System
9 - Secure Trade Window
Added Adaptive Performance System (APS) that dynamically adjust how often NPC AI/movement is checked based on overall shard performance. If performance drops below defined threshold, UOX3 gradually slows down checks for NPC AI/movement to prioritize player movement/speech/command responsiveness. If performance climbs back up above threshold, slowdowns are gradually removed. The following UOX.INI options have been added under [system] category to support this system:
APSPERFTHRESHOLD=50 // Performance threshold (measured in simulation cycles/sec) below which the APS kicks in
APSINTERVAL=100 // How often (in milliseconds) the APS checks performance and makes adjustments (if needed) to balance out shard performance
APSDELAYSTEP=50 // How much the delay timer is modified by (in milliseconds) each time APS makes adjustments
APSDELAYMAXCAP=2000 // Max amount of of delay APS can introduce for NPC AI/movement handling when attempting to restore shard performance
Added new JS Methods for Region objects:
.GetOrePrefs( oreType ) // Get ore preference data for ore type found in town region. Returned as an array containing the following data:
orePrefData -> [
oreName, // name of ore
color, // color of ore
minskill, // min skill to mine ore
ingotName, // name of ingot created from ore
makemenu, // makemenu entry for crafting something from ingot
oreChance, // default global chance of finding this ore type
scriptID // script attached to mined ore
],
orePrefChance // Chance of finding this ore type in given town region
.GetOreChance() // Get base chance of finding any ore in town region
Moved Mining skill plus gravedigging feature from hard code to scripts (js/skill/mining.js) to make it easier to maintain and/or customize, and removed hard coded variants
Gravedigging now relies on the ore resource system behind the scenes to restrict how often graves in a given area can be dug up
Fixed some incorrect references to .worldNumber Character property in misc scripts (should be .worldnumber)
Made some "hard-scripted" system messages in misc scripts use dictionary system instead
Added spawn region for banker NPCs in Serpent's Hold (dfndata/spawn/felucca/spawn_town_serpents_hold.dfn, dfndata/spawn/trammel/spawn_town_serpents_hold.dfn)
Fixed region definition of Ocllo to actually cover the entire town (dfndata/regions/regions.dfn)
Added numerous additional locations accessible with 'goplace # command, for key locations in Ilshenar, Malas, Tokuno Islands and Ter Mur (dfndata/location/location.dfn)
Revised travel-menu portion of GM menu (shortcut: 'travel) to include more travel options based on new locations (dfndata/items/travelmenu.dfn and travelmenu.bulk.dfn)
Fixed an issue where NPCs could attempt to attack targets in other worlds/instances
Added new JS Event that triggers for characters who are about to deal damage in combat. Complimentary to onDamage, which triggers for chars receiving damage:
onDamageDeal( dmgDealer, dmgReceiver, damageValue, damageType )
Added new JS Event that can trigger in global script upon creation of new player chars. Note that this will trigger in place of onCreateDFN event for player characters:
onCreatePlayer( pChar )
Added new JS Event that triggers for characters selecting a target with a spell. Complimentary to onSpellTarget, which triggers for targets selected with a spell:
onSpellTargetSelect( caster, target, spellNum )
Updated onCombatStart and onCombatEnd JS Events to also trigger for the other party in combat
Updated onPickup JS Event to include a third parameter - the potential container item was picked up from. Event now also triggers event in scripts attached to said containers:
onPickup( iPickedUp, pChar, iCont )
Added tracking of total playtime per individual character, and per account across all characters, and exposed these properties to JS engine:
.totalPlayTime // Account property, total playtime across all chars
.playTime // Character property, total playtime on given character only
Added new player-accessible command ('playtime) to spit out the playtime of current character/account as a whole (js/commands/playtime.js)
Implemented first version of Young Player System:
Replaced the UNUSED9 account flag with YOUNG, to be used by Young/New Player System
Added new JS Account property that gets/sets whether player account is considered Young:
.isYoung
Added new Char timers:
TIMER_YOUNGHEAL // Restricts how often Young players are healed by NPC healers
TIMER_YOUNGMESSAGE // Restricts how often Young players are warned about dangerous looking monsters in overworld
Updated GM commands 'get and 'set to get/set .isYoung property of player's account (js/commands/targeting/get.js and set.js)
Added new UOX.INI setting to enable/disable Young Player System (enabled by default):
YOUNGPLAYERSYSTEM=1
If Young Player System is enabled, all newly created player accounts are automatically marked with Young flag
Added new script to handle various restrictions and functions related to Young characters (js/player/young_player.js):
Young characters will have [Young] displayed over their head
Young characters will have their Young status checked and verified on every login + every stat/skill gain, to revoke the Young status if any of the following is true:
Account has a total playtime of more than 40 hours
Any character has more than 350 total (base) skill points
Any character has more than 70 skill points in a single skill
Any character has more than 150 total stat points
Any character has more than 80 stat points in a single stat
Young characters can renounce their Young status manually by saying the words "I renounce my young player status"
Young characters get two additional items upon creation:
a new player ticket (can be combined with any other players new player ticket for both players to get a reward)
a sextant (shows Young players directions to nearest moongate/bank regardless of where they are, as long as outdoors)
Young characters cannot target other player characters with hostile spells or skills
Young characters cannot be the target of other player characters' hostile spells or skills
Young characters can only cast beneficial spells upon themselves or other Young characters
Young characters can only be the target of beneficial spells from other Young players
Young players (and their pets/followers) cannot attack or harm any other players (or their pets/followers), nor themselves be attacked or harmed by any other players (or their pets/followers), whether from combat, spells, skills or items
Young players don't lose any of their items on death, and are teleported to the nearest healer upon death with all their items intact
Young players receive a warning upon entering dungeons that monsters there will be hostile
Updated global script (js/server/global.js) to:
Check/Verify Young status of players upon login
Attach young player script on login/creation for players on Young accounts
Give specific items to Young players upon creation
Added new script (js/item/corpse.js) that is assigned to all freshly created corpses. This script handles restrictions related to Young players interactions with corpses, and the interactions of other players with corpses of Young players
Updated JS Method .Carve() to return true/false depending on whether carving a corpse was successful
Updated Healer AI in code to heal nearby injured Young players
Updated Evil AI and Evil Caster AI in code to avoid selecting Young players as targets in combat outside of dungeons
Added a new section to UOX.INI - [young player starting locations] - that can be used to define starting locations for Young players. If only one such location is provided, all players start there. Otherwise, it matches the same starting location setup as the regular one - with one entry per town in Britannia.
Restricted transferring and/or friending of pets (code) and hirelings (hirelings.js) between Young and non-Young players
Restricted Young players from recalling or gating to Felucca facet
Young players can instantly logout from anywhere, at any time
2023-07-01 20:02:40 +08:00
std : : string mCharName = GetNpcDictName ( mChar , nullptr , NRS_SPEECH ) ;
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
asciiTxtToSend - > SpeakerName ( mCharName ) ;
2012-11-03 18:11:04 +00:00
txtToSend = asciiTxtToSend ;
asciiGhostedText = new CPacketSpeech ( ) ;
2022-10-24 18:39:33 +08:00
( * asciiGhostedText ) = ( * asciiTxtToSend ) ;
2012-11-03 18:11:04 +00:00
asciiGhostedText - > GhostIt ( 0 ) ;
ghostedText = asciiGhostedText ;
2002-04-07 21:27:53 +00:00
}
2012-11-03 18:11:04 +00:00
tSock - > Send ( txtToSend ) ;
2022-10-24 18:39:33 +08:00
std : : vector < CSocket * > nearbyChars ;
2012-11-03 18:11:04 +00:00
// Distance at which other players can hear the speech depends on speech-type
2021-07-29 01:01:12 +08:00
if ( ( Type ( ) = = WHISPER | | Type ( ) = = ASCIIWHISPER ) & & ! mChar - > IsGM ( ) & & ! mChar - > IsCounselor ( ) )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
nearbyChars = FindNearbyPlayers ( mChar , 1 ) ;
2022-10-24 18:39:33 +08:00
}
2021-07-29 01:01:12 +08:00
else if ( ( Type ( ) = = WHISPER | | Type ( ) = = ASCIIWHISPER ) & & ( mChar - > IsGM ( ) | | mChar - > IsCounselor ( ) ) )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
nearbyChars = FindNearbyPlayers ( mChar , 3 ) ;
2022-10-24 18:39:33 +08:00
}
2021-07-29 01:01:12 +08:00
else if ( Type ( ) = = YELL | | Type ( ) = = ASCIIYELL )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
nearbyChars = FindNearbyPlayers ( mChar , ( DIST_SAMESCREEN * 1.5 ) ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
else
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
nearbyChars = FindNearbyPlayers ( mChar ) ;
2022-10-24 18:39:33 +08:00
}
for ( auto & tSock : nearbyChars )
{
2012-11-03 18:11:04 +00:00
CChar * tChar = tSock - > CurrcharObj ( ) ;
if ( mChar ! = tChar )
2002-04-07 21:27:53 +00:00
{
Housing Revamp and more
Updated JS SysMessage function to accept up to 10 extra, optional arguments, which can be used with dictionary messages that require additional parameters like %s or %i
Added new type of house privilege in cMultiObj.cpp to keep track of friends of the multi - HOUSEPRIV_FRIEND - which is stored during worldsaves as one or more Friend=<player serial> tags in house.wsc
Added new type of house privilege in cMultiObj.cpp to keep track of guests of the multi - HOUSEPRIV_GUEST - which is stored during worldsaves as one or more Guest=<player serial> tags in house.wsc
When items are created for houses upon house placement, a reference to the multi's serial is now stored in the house sign's MORE property to allow easier tracking of which house a particular sign belongs to
Added tracking of new, persistent properties for houses via cMultiObj.cpp/h:
lockdowns, secure containers, vendors, guests, friends, owners, ban location, public status, number of visits, timestamps
Added a multitude of new methods in cMultiObj.cpp/h to assist in improving the functionality of houses
Added new tags for houses in house.dfn (default values applied if tag not specified):
MAXSECURECONTAINERS=4 - Max amount of secure containers allowed in a multi
MAXLOCKDOWNS=256 - Max amount of lockdowns allowed in a multi
MAXVENDORS=10 - Max amount of vendors allowed in a multi
MAXBANS=50 - Max amount of bans in a multi's ban list
MAXFRIENDS=50 - Max amount of friends in a multi's friend list
MAXGUESTS=50 - Max amount of guests in a multi's guest list
MAXOWNERS=8 - Max amount of owners and co-owners in a multi's owner list
MAXTRASHCONTAINERS=1 - Max amount of trash containers allowed in multi
SCRIPT=<scriptID> - Assign a JS script-ID directly to a multi
FRONTDOOR - indicates that a door is the front door of a house. Cannot be locked in public houses!
INTERIORDOOR - indicates that a door is an interior door of a house. Can be locked in public houses.
BANX - Location X offset for multi's ban location, if not used, will try to use SE corner of multi instead
BANY - Location Y offset for multi's ban location, if not used, will try to use SE corner of multi instead
Added JS Event:
onHouseCommand( tSock, multiObj, cmdID ) - For handling spoken house commands via JS scripts attached to multi.
Updated JS Events:
onEntrance() - can now trigger both for multi being entered and/or object entering
onLeaving() - can now trigger both for multi being left and/or object entering
onSpeech() - can now also trigger for items (in addition to chars) with event & script attached, if UOX.INI setting ITEMSDETECTSPEECH is enabled
Added JS Multi methods:
.IsBoat() - Returns whether the item (or multi) is a boat
.IsOwner( playerToCheck ) - Returns whether a player is the owner of a multi
.IsOnOwnerList( playerToCheck ) - Returns whether a player is on the (co-)owner list of a multi
.IsOnFriendList( playerToCheck ) - Returns whether a player is on the friend list of a multi
.IsOnGuestList( playerToCheck ) - Returns whether a player is on the guest list of a multi
.IsOnBanList( playerToCheck ) - Returns whether a player is on the ban list of a multi
.AddToFriendList( playertoAdd ) - Adds player to the friend list of a multi
.RemoveFromFriendList( playertoRemove ) - Removes player from the friend list of a multi
.AddToGuestList( playertoAdd ) - Adds player to the guest list of a multi
.RemoveFromGuestList( playertoRemove ) - Removes player from the guest list of a multi
.ClearOwnerList() - Clears all entries from a multi's (co-)owner list
.ClearFriendList() - Clears all entries from a multi's friend list
.ClearGuestList() - Clears all entries from a multi's guest list
.ClearBanList() - Clears all entries from a multi's ban list
.SecureContainer( itemToSecure ) - Secures a container in a multi
.UnsecureContainer( itemToUnsecure ) - Unsecures a container in a multi
.IsSecureContainer( itemToCheck ) - Checks if specified item is a secure container in a multi
.LockDownItem( itemToLockDown) - Locks down an item in a multi
.ReleaseItem( itemToRelease ) - Releases a locked down item in a multi
.KillKeys() - Deletes ALL keys associated with a multi
.AddTrashCont( itemToAdd ) - Add trash container to multi's list of trash containers
.RemoveTrashCont( itemToRemove ) - Remove trash container from multi's list of trash containers
Added JS Item (Multi only) properties:
.lockdowns - Get the number of lockdowns in a multi
.maxLockdowns - Get/Set the max number of lockdowns allowed in a multi
.secureContainers - Get the number of secure containers in a multi
.maxSecureContainers - Get/Set the max number of secure containers allowed in a multi
.trashContainers - Get the number of trash containers in a multi
.maxTrashContainers - Get/Set the max number of trash containers allowed in a multi
.friends - Get the number of friends in a multi's friend list
.maxFriends - Get/Set the max number of friends allowed in a multi's friend list
.guests - Get the number of guests in a multi's guest list
.maxGuests - Get/Set the max number of guests allowed in a multi's guest list
.owners - Get the number of owners in a multi's owner list
.maxOwners - Get/Set the max number of owners allowed in a multi's owner list
.bans - Get the number of banned players in a multi's ban list
.maxBans - Get/Set the max number of banned players allowed in a multi's ban list
.vendors - Get the number of player vendors in a multi
.maxVendors - Get the max number of player vendors allowed in a multi
.deed - Get the item sectionID for deed used to place multi
.isPublic - Get/Set the private/public state of a multi
.buildTimestamp - Get the timestamp for when the house was originally placed
.tradeTimestamp - Get the timestamp for when the house was last traded to another player
.banX - Get/Set the ban location X offset for the multi
.banY - Get/Set the ban location Y offset for the multi
Added JS Character properties:
.multi = Get/Set the multi object the character is in
.accountNum = Get the account number the character belongs to
.housesOwned = Get a count of houses owned by the character
.housesCoOwned = Get a count of houses co-owned by the character
Updated JS cBaseObject Methods .FirstItem(), .NextItem() and .FinishedItems() to also support iterating through items in multis
Updated JS multi Methods .FirstChar(), .NextChar() and .FinishedChars() to support an additional parameter to specify what kind of characters to loop through:
"default" or no parameter - all characters inside the multi
"owner" - players on multi's owner list
"friend" - players on multi's friend list
"guest" - players on multi's guest list
"banned" - players on multi's ban list
Added new INI tags to a new section of uox.ini called [houses]
DECAYTIMERINHOUSE=3600 // Decay timer in seconds for non-locked down items inside houses
PROTECTPRIVATEHOUSES=1 // Toggles whether private houses will automatically boot unauthorized visitors (1) or not (0)
TRACKHOUSESPERACCOUNT=1 // Toggles whether to track (and restrict) house ownership per account (1) or per character (0)
MAXHOUSESOWNABLE=1 // Specifies the max amount of houses a player can own per account/char, depending on how house ownership is tracked
MAXHOUSESCOOWNABLE=10 // Specifies the max amount of houses a player can co-own per character
CANOWNANDCOOWNHOUSES=1 // Toggles whether players can own and co-own houses at the same time
COOWNHOUSESONSAMEACCOUNT=1 // Toggles whether characters on same account as house owner will be treated as co-owners
Added new INI tags in [settings] section of uox.ini:
ITEMSDETECTSPEECH=0 // If enabled, server will search for nearby items with onSpeech JS event running whenever a character speaks. Disabled by default.
MAXPLAYERPACKITEMS=125 // Defines max item capacity for player (and NPC) backpacks. Defaults to 125.
Moved most of the existing house functionality to JS and expanded upon it to reach feature parity with houses in regular UO around Publish 15/16, with various extras thrown in for good measure and all functionality being customizable:
js/server/house/house.js (15000) - handles detection of house commands and characters entering/leaving houses
js/server/house/houseSign.js (15001) - contains and handles all house-related gumps/menus and what is shown when players interact with house sign
js/server/house/houseCommands.js (15002) - handles functionality of house commands and other functionality such as transfer of ownership, demolishing house, etc.
js/server/house/houseDeed.js (15003) - handles initial rules that allow/disallow placement of additional houses for players
All house-related menus now fully handled through JS
All house commands and other functionality now fully handled through JS
Removed redundant hard-coded house functionality
Implemented Co-owners, friends, guests for houses, with access rules in place for entry, lockdowns, house commands, etc.
Implemented Private and Public houses
Implemented Secure Containers and Trash Barrels
Definable max lockdowns, secure containers, player vendors, bans, friends, guests, owners, trash containers and more - per house type
JS scripts can now be attached directly to houses
Doors in houses can be marked as front doors or interior doors, and will be treated differently with regards to private and public houses
Added new item to dfndata/items/containers/misc.dfn - [trashbarrel]
Added new JS script (js/items/trashbarrel.js) with trash barrel functionality for houses. Trash barrels that are marked as secure containers are only accessible by owners, co-owners and friends of the house. Various options available at top of script.
Updated js/items/axe.js to support chopping up trash barrels and house add-ons in houses owned by the player
Fixed an issue with house doors being left behind after demolishing houses while their doors were open
Fixed an issue where GMs could be banned from player houses
Added Line of Sight checks to speech, to give players some privacy in their own homes
Updated house placement code to more accurately check for other multis, dynamic and static objects when placing houses; now requires free space around each house that cannot be blocked by other houses or items that can block player movement, and disallows placement of houses on roads
Updated house placement code to move characters blocking house placement to SE corner of the house
Updated house placement code to disallow placing houses in guarded regions, or in dungeons
Added new DFN tag for regions to enable/disable player houses in specific regions: HOUSING=0/1
Added new region (247) that covers path to Valley of Eodon in Felucca
Added new region (248) that covers Valley of Eodon in Ter-Mur, with player housing disabled
Added new region (249) that covers entire T2A lands, with player housing disabled
Updated SPACEX and SPACEY values for all houses in dfndata/house/house.dfn to match updated house placement code
Added new JS property to Regions that can be used to determine or change state of player housing in a region: .canPlaceHouse()
Updated rules for usage of dye tubs to dye locked down items; now only house owners or co-owners may dye locked down items
Updated rules for usage of the following locked down items in a house, which are now only usable by house owners and co-owners
Dyes, Guildstone Deeds, Recall Runes (renaming), Rename Deeds, Townstone Deeds, House Deeds, Boat Models, Player Vendor Deeds, Ore, Hair Dye
Updated rules for usage of the following locked down items in a house, which are now only usable by house owners, co-owners and friends:
Keys, Dye Tubs, Magic Scrolls, Fireworks Wands, Magic Wands, Smithing Tools, Mining Tools, Fishing Poles
Updated item lockdown rules to allow locking down (and releasing) items in a container as long as the container is locked down, and to only allow releasing a locked down container if it's empty of locked down items
Updated item lockdown rules to only allow locking down movement-blocking items further than 2 tiles away from doors
Updated rules for releasing items in houses - now the house owner can release any locked down items, co-owners can release items locked down by themselves or by friends, while friends can release only items locked down by themselves
Added some feedback to player about why their attempted house placement failed
Items added by GMs directly into multis will now decay based on the house-specific decay timer instead of the regular one
Fixed an issue that could cause items to almost instantly decay after being released from lockdown in a house
Placing house add-ons now properly takes into account SPACEX and SPACEY values when checking if they can fit in selected area of houses
Re-added SPACEX and SPACEY values for Pentagram and Loom house add-ons
House add-ons can now be converted back into house add-on deeds by chopping them with an axe
Added new item type - IT_HOUSEADDON (201) - used by house add-ons placed in player houses
Fixed a bug where keys would stop working after being added to a keyring, and would turn into blank keys upon release from the keyring
Added visitor count for public player houses, which keeps track of how many visits a public house has received, with each player counted max 1 time every 24 hours
Fixed an issue with FindPlayersInOldVisrange() where it didn't take into account that players could see buildings further away than the standard update range. This could cause players to see ghost images of buildings if they were at the "right" distance when the building was being demolished
Added NODECAY tag to all signs and doors in dfndata/house/house.dfn
Added FRONTDOOR or INTERIORDOOR (as appropriate) to all doors in dfndata/house/house.dfn
Added BANX and BANY to specify ban location for some houses in dfndata/house/house.dfn instead of relying on finding SE corner automatically
Implemented strongboxes (js/server/house/strongbox.js) for co-owners of a house, which can be placed with the house command "i wish to place a strongbox". Max capacity is 25 items
Updated 'REMOVE command to take an optional parameter - itemID. If supplied, the command will remove all items with this itemID from a targeted container
Fixed a bug when checking if dynamic items were blocking valid spawn locations for NPCs, some function arguments were in the wrong order!
Improved code that finds valid spawn locations for items and NPCs spawned via spawn regions. As server gradually builds up lists of valid spawn locations per region over time, it will start using these lists more often, rather than always look for brand new spawn locations.
Fixed a bug with CMulHandler::CheckStaticFlag() that prevented NPCs from spawning inside buildings with no static floors!
Fixed an issue with repeating commands that prevented GMs from being able to cancel them when using the ClassicUO client
Exposed character property .accountNum to JS engine
Extended CDataList class to include a Clear() method for clearing lists
Updated JS File method .Open() to support an optional, third argument - subFolderName - that defines in which sub-folder of UOX3/shared/ to store/look for a file. If no third argument is supplied, UOX3 will default to using the shared folder itself.
Updated JS File method .Length() to return a value of -1 for files that don't exist
Added new code function, exposed to JS engine with same parameters, which simply checks if a given tile ID has a specific flag
bool CheckTileFlag( UI16 itemID, TILEFLAG flagToCheck )
Added JS function used to find the root container of an item (if any)
FindRootContainer( itemSerial )
FindRootContainer( item )
Added new JS function that allows deleting files from UOX3/shared/ folder or subfolders of shared folder. If no subFolderName is provided, looks for file directly in shared folder itself. Restrictions on file- and folder-names apply.
bool DeleteFile( fileName, subFolderName )
Added new JS functions for checking if a specific client or server feature is enabled. See documentation for full list of client/server features.
GetClientFeature( bitNum ) // Returns true if specified client feature is enabled on server
GetServerFeature( bitNum ) // Returns true if specified server feature is enabled on server
Added new JS function for returning the value of almost any server setting from UOX.INI
GetServerSetting( settingNameInDoubleQuotes )
Updated JS function DoesDynamicBlock() with two new parameters - checkOnlyMultis and checkOnlyNonMultis
Updated JS function DoesMapBlock() with two new parameters - checkMultiPlacement and checkForRoad
Fixed an issue where a LoS check would prevent players from accessing containers in their own backpack
Added new functions in findfuncs.cpp to make it easier to find items near another object or location:
findNearbyItems( object, distance )
findNearbyItems( x, y, worldNumber, instanceID, distance )
Added new Item property - maxItems - used by containers to determine their max item capacity
Added new Item property - totalItemCount - used to get total item count in a container (including sub-containers)
Added check for max item capacity when creating new items that are added to a character's backpack - items will be created below character's feet if backpack is full!
Added new DFN tag for items, used by containers to determine item capacity for a given container:
MAXITEMS=# // 125 is the default for all containers if not set
Added new JS Item properties:
.maxItems // gets/sets item capacity for a given container
.totalItemCount // gets total item count in a container, including sub-containers
Updated item tooltips for containers to show accurate total item count, as well as to display max item capacity
Fixed a bug where picking up items from a non-locked down pile of items on the floor inside a multi could cause the remaining pile to be seen as no longer inside the multi, disallowing locking it back down and causing it to decay based on regular decay timer instead of house-specific one
Updated JS command set to allow setting poison-level on items ('set poison #) and hunger-level on characters ('set hunger #)
Fixed an issue with js/item/food.js that prevented poisoned food from poisoning characters when eaten
Fixed an issue with js/skill/poisoning.js that prevented players from poisoning food!
Updated various JS scripts and hardcoded targeting functions to disallow the targeting of locked down resources using skills and tools
Updated JS Method TextMessage() to support three extra, optional parameters. Note that if one optional parameter is included, all preceding optional parameters are also required!
speechTarget - What kind of target is this message intended for?
0 - Only visible for sender and receiver of message
1 - Visible to all players in range
2 - Visible to all NPCs and players in range
3 - Visible to all PCs everywhere + NPCs in range
4 - Visible to all PCs everywhere (broadcast)
5 - Only visible for the receiver of the message
speechTargetSerial - The serial of the receiver of the message, used if speechTarget is 0 or 5
speechFontType - The type of font to display the text in. Defaults to normal.
0 - Bold
1 - Normal with shadow
2 - Bold with shadow
3 - Normal
4 - Gothic
5 - Italic
6 - Small, dark
7 - Colourful
8 - Runic (only works with CAPS)
9 - Small, light
Added timestamp to worldsaves in console, to make it easier to see when a particular world-save was done
Added info about compiler/environment displayed at the top of the UOX3 console during startup
Updated dictionary files with new messages primarily related to housing
2020-11-04 02:00:37 +08:00
// Line of Sight check!
Small update
Fixed an issue with an internal movement check that prevented characters from moving in valid map areas in Felucca/Trammel from X 6144 to X 7168
Fixed an issue where .instanceID property was misspelled in 'xgo GM command script, causing characters to be teleported to an out of bounds area where they would no longer be saved (js/commands/targeting/x.js)
Added some additional error-checking to .Teleport()/.SetLocation() JS Method to prevent script-accidents from sending characters out of bounds.
Updated Poisoning skill to add poison-charges to weapons being poisoned. Charges are consumed when applying poison in combat (js/skill/poisoning.js)
Updated combat code to consume poison-charges if a poisoned weapon is used to poison an opponent
Updated shoplists for Blacksmiths and Weaponsmiths - they now buy/sell longswords (dfndata/items/shoplist.dfn)
Updated MageShopping shoplist for mage vendors - they now buy/sell mass curse scrolls (dfndata/items/shoplist.dfn)
Added new Spawn Region DFN tag that can specify which era or eras of UO (Multiple comma-separated entries supported) a given spawn region is valid for. Spawn region not valid for core shard era will be ignored. Syntax:
ERAS=UO,T2A,UOR,LBR,AOS,SE,ML,SA,HS,TOL
Added new Spawn Region DFN tag that allows using another spawn region as a "parent". All properties of this parent will be inherited except for these, which are ignored: ERAS, NPCLIST, ITEMLIST, NPC and ITEM. Syntax for new tag:
GET=# // Inherit a specified spawn region
Added spawn region for animal trainer vendor in Vesper stable
Added spawn region for fur trader/tanner vendors in The Best Hides of Britain
Added spawn region for spinner vendor in The Lord's Clothier's and The Right Fit shops in Britain
Added spawn region for tanner NPC to Nujel'm Tannery (and fixed leatherworker spawn region for same area)
Added spawn regions for banker NPCs in East Bank of Britain, First Bank of Moonglow, Jhelom Bank and Jeweler, Bank of Skara Brae
Added spawn regions for stables, tailor and blacksmith inside Castle British
Added spawn regions for mage shops, mage guilds and farm houses in Moonglow
Added spawn regions for misc vendors and townfolk in multiple cities
Added spawn regions for Fire Island
Updated spawn regions for Dagger Isle/Ice Island
Added spawn regions for forests and jungles in southern Britannia and on various islands including Bucc's Den, Moonglow, Serpent's Hold, and misc unpopulated islands
Added spawn regions for area east of Skara Brae, around Hedge Maze and south of Britain
Added spawn regions for wandering healers outside every dungeon entrance in Britannia and Lost Lands
Re-integrated ocean spawn regions for ocean creatures (dolphin, walrus, water elemental, sea serpent) from the original community-based spawn file
Added reagent spawns in overworld spawn regions in Britannia/Lost Lands
Added special reagent spawns in swamp areas
Added additional overworld spawn regions in Britannia/Lost Lands
Added spawn regions for Khaldun dungeon that spawn some new and some old NPCs:
Old: Zombies, skeletons, skeletal mages, skeletal knights, ancient liches
New: Cursed (and named) NPCs, shadowfiends, zealots of khaldun (knights/summoners), tentacles of the harrower
Updated size and positions of some existing overworld spawn regions
Fixed incorrect spawn region size for small island south of Trinsic
Added switch/door puzzle functionality in Khaldun dungeon using new switch/door combo script (js/item/dungeons/switch_door_combo.js)
Added "smart objects" in Khaldun dungeon that activate when you come close enough (js/item/dungeons/smart_activate_item.js)
Added teleport locations within Khaldun dungeon (js/teleport.scp)
Added custom AIs to existing NPC spawning in Khaldun dungeon:
Ancient Lich (summons other undead, and can turn into one of them for disguise)
Added DFN entries for new NPCs spawning in Khaldun dungeon, some with custom AIs:
[tentacles_of_the_harrower] -> Tentacles of the Harrower (life steal)
[shadowfiend] -> Shadowfiends (seek out and reveal hidden players)
[zealot_knight]/[zealot_summoner] -> Zealots of Khaldun (turn into undead on death, male/female variants)
[cursed] -> Cursed (male/female variants)
[spectralarmor] -> Spectral Armor
Added DFN entries for new (named) NPCs spawning in Khaldun dungeon:
[lysander_gathenwale] -> Lysander Gathenwale
[grimmoch_drummel] -> Grimmoch Drummel
[morg_bergen] -> Morg Bergen
[tavara_sewel] -> Tavara Sewel
Added new NPC DFN entries:
[leatherworker] -> alias for male/female leatherworker vendors
[mapmaker] -> alias for male/female mapmaker vendors
Added new Race DFN entries:
[RACE 29] -> Cursed (enemies of RACE 30)
[RACE 30] -> Zealots (enemies of RACE 29)
Added new book DFN entries for Khaldun journals of Lysander, Tavara and Grimmoch - available as loot from the respective NPCs (dfndata/misc/books.dfn and dfndata/items/misc/books.dfn)
Added 25% chance for hit-animations and hit-SFX to play for targets in combat, instead of playing every time - can get very spammy
Monsters with actual weapons equipped (like Ophidian Enforcer with Halberd/Bardiche) will now get appropriate combat SFX for hitting with that weapon
Updated Healing skill to base cure/resurrection skill requirements on the calculated skill, rather than base skill (js/skill/healing.js)
Fixed an issue where healing with bandages and dying in the process would not properly reset the healing-related tags and skills used
Updated healing script to show a resurrection confirmation menu for players targeted with bandages for resurrect (js/skill/healing.js)
All skill usage states now reset on death, to prevent cases of players being "busy" while trying to use skills that got stuck due to script bugs.
The 'regspawn GM command now supports a new parameter called "max". Updated command syntax:
'regspawn # // perform a single respawn cycle in a specific spawn region
'regspawn all // perform a single respawn cycle across all spawn regions
'regspawn max // respawn ALL spawn regions to MAX capacity in one go
Added new UOX.INI setting that determines the maximum range at which NPCs can initiate attacks on players/NPCs (the old MAXRANGE=10 setting now instead defines max range at which players can initiate attacks on players/NPCs):
MAXNPCAGGRORANGE=10
Optimized performance by significantly reducing the number of line-of-sight checks performed by characters, especially in combat scenarios, or when evaluating potential targets for NPC AIs. The amount of checks done is also affected by the new ini setting for max aggro range.
Fixed an issue where both NPC and player characters would instantly drop one hunger level (from 6 to 5) upon creation since hungerrate was not initialized until after first hunger-event
Updated character priv property from UI16 to UI32, and added a new flag that determines if fame/karma title is hidden for character:
HIDEFAMEKARMATITLE (0x10000)
NPCs will no longer aggro other NPCs if the Z difference between them is greater or equal to 20 (i.e. they're on different floors), unless both are using ranged weapons and both are in range
Fixed an issue where players could get discounts from shopkeepers even though neither player nor shopkeeper were members of a NPC guild (js/npc/ai/shopkeeper.js)
Fixed an issue where the "premium" a player would get when selling items to a shopkeeper in the same NPC guild as them would be 110% extra on top of the item's value, instead of the intended 10% (js/npc/ai/shopkeeper.js) (Thanks, cobrag0318!)
Added missing tall straw hat to tailoring crafting scripts (Thanks, Dragon Slayer!)
Improved error reporting during compilation of individual scripts being reloaded - will now show more context and line number
onCombatEnd JS Event now also triggers when NPCs ignore their target and/or evade during combat
Updated 'decorate command to support saving/loading custom tags on items for world templates. These are stored after a @ symbol in the world template, each custom tag separated by a | symbol, and with each custom tag saved using this syntax: key$type$value
Updated resource-harvesting scripts to use script-specific global (const) variables, to avoid interference between different scripts (js/server/resource/*)
Added new resource-harvesting scripts and added spawn regions for these in fields on farms all over Britannia/Lost Lands
cabbages (js/server/resource/cabbages.js)
canteloupes (js/server/resource/canteloupes.js)
carrots (js/server/resource/carrots.js)
garlic (js/server/resource/garlic.js)
gourds (js/server/resource/gourds.js)
honeydew melons (js/server/resource/honeydewmelon.js)
onions (js/server/resource/onions.js)
pumpkins (js/server/resource/pumpkins.js)
squashes (js/server/resource/squashes.js)
turnips (js/server/resource/turnips.js)
watermelons (js/server/resource/watermelon.js)
Updated CSpawnRegion::FindItemSpotToSpawn() function in cSpawnRegion.cpp to prevent duplicate spawning of exact same item in exact same location
Updated sectionid of all potion and scroll aliases to match main item, so they'll get correctly picked up by NPC shopkeepers (dfndata/items/magic/potions.dfn and scrolls.dfn)
Specified sectionid for backpacks, so it also gets applied to packs added using the alias [backpack] (dfndata/items/misc/provisions.dfn)
Fixed a code issue that prevented players from selling empty containers to NPC shopkeepers willing to buy such containers
Fixed an issue where field-spells (wall of stone, poison field, etc) would ignore dynamic/static items that should block these
Fixed an issue where field-spells could be cast into houses from the outside by standing next to a wall and targeting self
Fixed a War/Peace-mode desync between client and server by having server always notify client (using war-toggle packet) when the "at war" flag is toggled for player character
Fixed an issue with hiding skill that wouldn't allow player to hide after having acquired self as target in combat (through spellcasting, for instance) (Thanks, Dragon Slayer!)
Fixed an issue where mana/reagents were consumed and skillcheck performed before all spellcast-validations had succeeded, resulting in the occasional loss of reagents/mana when spellcasting was disallowed (code and js/magic/clumsy.js and level1targ.js)
Fixed an issue with lack of criminal-flagging for casting of hostile spells scripted in JS (clumsy, magic arrow, feeblemind) vs blue targets (js/magic/clumsy.js and level1targ.js)
Fixed some issues with Line-of-Sight checking code that returned incorrect results, which amongst other things affected spellcasting in areas with uneven terrain
Fixed some issues with movement code and climbing of ladders, in particular the rope ladder in the 2-story log cabin. Code now sets a "is climbing" flag when character steps onto a rope ladder, and uses that to help resolve some edge cases, and then unsets it when they step off.
Renamed section headers of some map-items in DFNs from "locationname" to "locationnamemap" for clarity (example: "britain" to "britainmap")
Fixed broken "map wrapping" when sailing to edges of map in Felucca or Trammel
Fixed a server crash related to attempts at reading data from invalid map tiles
2025-06-27 08:40:02 +08:00
if ( ! tChar - > IsGM ( ) & & ! LineOfSight ( mChar - > GetSocket ( ) , tChar , mChar - > GetX ( ) , mChar - > GetY ( ) , mChar - > GetZ ( ) , WALLS_CHIMNEYS + DOORS + FLOORS_FLAT_ROOFING , false , 0 , false ) )
Housing Revamp and more
Updated JS SysMessage function to accept up to 10 extra, optional arguments, which can be used with dictionary messages that require additional parameters like %s or %i
Added new type of house privilege in cMultiObj.cpp to keep track of friends of the multi - HOUSEPRIV_FRIEND - which is stored during worldsaves as one or more Friend=<player serial> tags in house.wsc
Added new type of house privilege in cMultiObj.cpp to keep track of guests of the multi - HOUSEPRIV_GUEST - which is stored during worldsaves as one or more Guest=<player serial> tags in house.wsc
When items are created for houses upon house placement, a reference to the multi's serial is now stored in the house sign's MORE property to allow easier tracking of which house a particular sign belongs to
Added tracking of new, persistent properties for houses via cMultiObj.cpp/h:
lockdowns, secure containers, vendors, guests, friends, owners, ban location, public status, number of visits, timestamps
Added a multitude of new methods in cMultiObj.cpp/h to assist in improving the functionality of houses
Added new tags for houses in house.dfn (default values applied if tag not specified):
MAXSECURECONTAINERS=4 - Max amount of secure containers allowed in a multi
MAXLOCKDOWNS=256 - Max amount of lockdowns allowed in a multi
MAXVENDORS=10 - Max amount of vendors allowed in a multi
MAXBANS=50 - Max amount of bans in a multi's ban list
MAXFRIENDS=50 - Max amount of friends in a multi's friend list
MAXGUESTS=50 - Max amount of guests in a multi's guest list
MAXOWNERS=8 - Max amount of owners and co-owners in a multi's owner list
MAXTRASHCONTAINERS=1 - Max amount of trash containers allowed in multi
SCRIPT=<scriptID> - Assign a JS script-ID directly to a multi
FRONTDOOR - indicates that a door is the front door of a house. Cannot be locked in public houses!
INTERIORDOOR - indicates that a door is an interior door of a house. Can be locked in public houses.
BANX - Location X offset for multi's ban location, if not used, will try to use SE corner of multi instead
BANY - Location Y offset for multi's ban location, if not used, will try to use SE corner of multi instead
Added JS Event:
onHouseCommand( tSock, multiObj, cmdID ) - For handling spoken house commands via JS scripts attached to multi.
Updated JS Events:
onEntrance() - can now trigger both for multi being entered and/or object entering
onLeaving() - can now trigger both for multi being left and/or object entering
onSpeech() - can now also trigger for items (in addition to chars) with event & script attached, if UOX.INI setting ITEMSDETECTSPEECH is enabled
Added JS Multi methods:
.IsBoat() - Returns whether the item (or multi) is a boat
.IsOwner( playerToCheck ) - Returns whether a player is the owner of a multi
.IsOnOwnerList( playerToCheck ) - Returns whether a player is on the (co-)owner list of a multi
.IsOnFriendList( playerToCheck ) - Returns whether a player is on the friend list of a multi
.IsOnGuestList( playerToCheck ) - Returns whether a player is on the guest list of a multi
.IsOnBanList( playerToCheck ) - Returns whether a player is on the ban list of a multi
.AddToFriendList( playertoAdd ) - Adds player to the friend list of a multi
.RemoveFromFriendList( playertoRemove ) - Removes player from the friend list of a multi
.AddToGuestList( playertoAdd ) - Adds player to the guest list of a multi
.RemoveFromGuestList( playertoRemove ) - Removes player from the guest list of a multi
.ClearOwnerList() - Clears all entries from a multi's (co-)owner list
.ClearFriendList() - Clears all entries from a multi's friend list
.ClearGuestList() - Clears all entries from a multi's guest list
.ClearBanList() - Clears all entries from a multi's ban list
.SecureContainer( itemToSecure ) - Secures a container in a multi
.UnsecureContainer( itemToUnsecure ) - Unsecures a container in a multi
.IsSecureContainer( itemToCheck ) - Checks if specified item is a secure container in a multi
.LockDownItem( itemToLockDown) - Locks down an item in a multi
.ReleaseItem( itemToRelease ) - Releases a locked down item in a multi
.KillKeys() - Deletes ALL keys associated with a multi
.AddTrashCont( itemToAdd ) - Add trash container to multi's list of trash containers
.RemoveTrashCont( itemToRemove ) - Remove trash container from multi's list of trash containers
Added JS Item (Multi only) properties:
.lockdowns - Get the number of lockdowns in a multi
.maxLockdowns - Get/Set the max number of lockdowns allowed in a multi
.secureContainers - Get the number of secure containers in a multi
.maxSecureContainers - Get/Set the max number of secure containers allowed in a multi
.trashContainers - Get the number of trash containers in a multi
.maxTrashContainers - Get/Set the max number of trash containers allowed in a multi
.friends - Get the number of friends in a multi's friend list
.maxFriends - Get/Set the max number of friends allowed in a multi's friend list
.guests - Get the number of guests in a multi's guest list
.maxGuests - Get/Set the max number of guests allowed in a multi's guest list
.owners - Get the number of owners in a multi's owner list
.maxOwners - Get/Set the max number of owners allowed in a multi's owner list
.bans - Get the number of banned players in a multi's ban list
.maxBans - Get/Set the max number of banned players allowed in a multi's ban list
.vendors - Get the number of player vendors in a multi
.maxVendors - Get the max number of player vendors allowed in a multi
.deed - Get the item sectionID for deed used to place multi
.isPublic - Get/Set the private/public state of a multi
.buildTimestamp - Get the timestamp for when the house was originally placed
.tradeTimestamp - Get the timestamp for when the house was last traded to another player
.banX - Get/Set the ban location X offset for the multi
.banY - Get/Set the ban location Y offset for the multi
Added JS Character properties:
.multi = Get/Set the multi object the character is in
.accountNum = Get the account number the character belongs to
.housesOwned = Get a count of houses owned by the character
.housesCoOwned = Get a count of houses co-owned by the character
Updated JS cBaseObject Methods .FirstItem(), .NextItem() and .FinishedItems() to also support iterating through items in multis
Updated JS multi Methods .FirstChar(), .NextChar() and .FinishedChars() to support an additional parameter to specify what kind of characters to loop through:
"default" or no parameter - all characters inside the multi
"owner" - players on multi's owner list
"friend" - players on multi's friend list
"guest" - players on multi's guest list
"banned" - players on multi's ban list
Added new INI tags to a new section of uox.ini called [houses]
DECAYTIMERINHOUSE=3600 // Decay timer in seconds for non-locked down items inside houses
PROTECTPRIVATEHOUSES=1 // Toggles whether private houses will automatically boot unauthorized visitors (1) or not (0)
TRACKHOUSESPERACCOUNT=1 // Toggles whether to track (and restrict) house ownership per account (1) or per character (0)
MAXHOUSESOWNABLE=1 // Specifies the max amount of houses a player can own per account/char, depending on how house ownership is tracked
MAXHOUSESCOOWNABLE=10 // Specifies the max amount of houses a player can co-own per character
CANOWNANDCOOWNHOUSES=1 // Toggles whether players can own and co-own houses at the same time
COOWNHOUSESONSAMEACCOUNT=1 // Toggles whether characters on same account as house owner will be treated as co-owners
Added new INI tags in [settings] section of uox.ini:
ITEMSDETECTSPEECH=0 // If enabled, server will search for nearby items with onSpeech JS event running whenever a character speaks. Disabled by default.
MAXPLAYERPACKITEMS=125 // Defines max item capacity for player (and NPC) backpacks. Defaults to 125.
Moved most of the existing house functionality to JS and expanded upon it to reach feature parity with houses in regular UO around Publish 15/16, with various extras thrown in for good measure and all functionality being customizable:
js/server/house/house.js (15000) - handles detection of house commands and characters entering/leaving houses
js/server/house/houseSign.js (15001) - contains and handles all house-related gumps/menus and what is shown when players interact with house sign
js/server/house/houseCommands.js (15002) - handles functionality of house commands and other functionality such as transfer of ownership, demolishing house, etc.
js/server/house/houseDeed.js (15003) - handles initial rules that allow/disallow placement of additional houses for players
All house-related menus now fully handled through JS
All house commands and other functionality now fully handled through JS
Removed redundant hard-coded house functionality
Implemented Co-owners, friends, guests for houses, with access rules in place for entry, lockdowns, house commands, etc.
Implemented Private and Public houses
Implemented Secure Containers and Trash Barrels
Definable max lockdowns, secure containers, player vendors, bans, friends, guests, owners, trash containers and more - per house type
JS scripts can now be attached directly to houses
Doors in houses can be marked as front doors or interior doors, and will be treated differently with regards to private and public houses
Added new item to dfndata/items/containers/misc.dfn - [trashbarrel]
Added new JS script (js/items/trashbarrel.js) with trash barrel functionality for houses. Trash barrels that are marked as secure containers are only accessible by owners, co-owners and friends of the house. Various options available at top of script.
Updated js/items/axe.js to support chopping up trash barrels and house add-ons in houses owned by the player
Fixed an issue with house doors being left behind after demolishing houses while their doors were open
Fixed an issue where GMs could be banned from player houses
Added Line of Sight checks to speech, to give players some privacy in their own homes
Updated house placement code to more accurately check for other multis, dynamic and static objects when placing houses; now requires free space around each house that cannot be blocked by other houses or items that can block player movement, and disallows placement of houses on roads
Updated house placement code to move characters blocking house placement to SE corner of the house
Updated house placement code to disallow placing houses in guarded regions, or in dungeons
Added new DFN tag for regions to enable/disable player houses in specific regions: HOUSING=0/1
Added new region (247) that covers path to Valley of Eodon in Felucca
Added new region (248) that covers Valley of Eodon in Ter-Mur, with player housing disabled
Added new region (249) that covers entire T2A lands, with player housing disabled
Updated SPACEX and SPACEY values for all houses in dfndata/house/house.dfn to match updated house placement code
Added new JS property to Regions that can be used to determine or change state of player housing in a region: .canPlaceHouse()
Updated rules for usage of dye tubs to dye locked down items; now only house owners or co-owners may dye locked down items
Updated rules for usage of the following locked down items in a house, which are now only usable by house owners and co-owners
Dyes, Guildstone Deeds, Recall Runes (renaming), Rename Deeds, Townstone Deeds, House Deeds, Boat Models, Player Vendor Deeds, Ore, Hair Dye
Updated rules for usage of the following locked down items in a house, which are now only usable by house owners, co-owners and friends:
Keys, Dye Tubs, Magic Scrolls, Fireworks Wands, Magic Wands, Smithing Tools, Mining Tools, Fishing Poles
Updated item lockdown rules to allow locking down (and releasing) items in a container as long as the container is locked down, and to only allow releasing a locked down container if it's empty of locked down items
Updated item lockdown rules to only allow locking down movement-blocking items further than 2 tiles away from doors
Updated rules for releasing items in houses - now the house owner can release any locked down items, co-owners can release items locked down by themselves or by friends, while friends can release only items locked down by themselves
Added some feedback to player about why their attempted house placement failed
Items added by GMs directly into multis will now decay based on the house-specific decay timer instead of the regular one
Fixed an issue that could cause items to almost instantly decay after being released from lockdown in a house
Placing house add-ons now properly takes into account SPACEX and SPACEY values when checking if they can fit in selected area of houses
Re-added SPACEX and SPACEY values for Pentagram and Loom house add-ons
House add-ons can now be converted back into house add-on deeds by chopping them with an axe
Added new item type - IT_HOUSEADDON (201) - used by house add-ons placed in player houses
Fixed a bug where keys would stop working after being added to a keyring, and would turn into blank keys upon release from the keyring
Added visitor count for public player houses, which keeps track of how many visits a public house has received, with each player counted max 1 time every 24 hours
Fixed an issue with FindPlayersInOldVisrange() where it didn't take into account that players could see buildings further away than the standard update range. This could cause players to see ghost images of buildings if they were at the "right" distance when the building was being demolished
Added NODECAY tag to all signs and doors in dfndata/house/house.dfn
Added FRONTDOOR or INTERIORDOOR (as appropriate) to all doors in dfndata/house/house.dfn
Added BANX and BANY to specify ban location for some houses in dfndata/house/house.dfn instead of relying on finding SE corner automatically
Implemented strongboxes (js/server/house/strongbox.js) for co-owners of a house, which can be placed with the house command "i wish to place a strongbox". Max capacity is 25 items
Updated 'REMOVE command to take an optional parameter - itemID. If supplied, the command will remove all items with this itemID from a targeted container
Fixed a bug when checking if dynamic items were blocking valid spawn locations for NPCs, some function arguments were in the wrong order!
Improved code that finds valid spawn locations for items and NPCs spawned via spawn regions. As server gradually builds up lists of valid spawn locations per region over time, it will start using these lists more often, rather than always look for brand new spawn locations.
Fixed a bug with CMulHandler::CheckStaticFlag() that prevented NPCs from spawning inside buildings with no static floors!
Fixed an issue with repeating commands that prevented GMs from being able to cancel them when using the ClassicUO client
Exposed character property .accountNum to JS engine
Extended CDataList class to include a Clear() method for clearing lists
Updated JS File method .Open() to support an optional, third argument - subFolderName - that defines in which sub-folder of UOX3/shared/ to store/look for a file. If no third argument is supplied, UOX3 will default to using the shared folder itself.
Updated JS File method .Length() to return a value of -1 for files that don't exist
Added new code function, exposed to JS engine with same parameters, which simply checks if a given tile ID has a specific flag
bool CheckTileFlag( UI16 itemID, TILEFLAG flagToCheck )
Added JS function used to find the root container of an item (if any)
FindRootContainer( itemSerial )
FindRootContainer( item )
Added new JS function that allows deleting files from UOX3/shared/ folder or subfolders of shared folder. If no subFolderName is provided, looks for file directly in shared folder itself. Restrictions on file- and folder-names apply.
bool DeleteFile( fileName, subFolderName )
Added new JS functions for checking if a specific client or server feature is enabled. See documentation for full list of client/server features.
GetClientFeature( bitNum ) // Returns true if specified client feature is enabled on server
GetServerFeature( bitNum ) // Returns true if specified server feature is enabled on server
Added new JS function for returning the value of almost any server setting from UOX.INI
GetServerSetting( settingNameInDoubleQuotes )
Updated JS function DoesDynamicBlock() with two new parameters - checkOnlyMultis and checkOnlyNonMultis
Updated JS function DoesMapBlock() with two new parameters - checkMultiPlacement and checkForRoad
Fixed an issue where a LoS check would prevent players from accessing containers in their own backpack
Added new functions in findfuncs.cpp to make it easier to find items near another object or location:
findNearbyItems( object, distance )
findNearbyItems( x, y, worldNumber, instanceID, distance )
Added new Item property - maxItems - used by containers to determine their max item capacity
Added new Item property - totalItemCount - used to get total item count in a container (including sub-containers)
Added check for max item capacity when creating new items that are added to a character's backpack - items will be created below character's feet if backpack is full!
Added new DFN tag for items, used by containers to determine item capacity for a given container:
MAXITEMS=# // 125 is the default for all containers if not set
Added new JS Item properties:
.maxItems // gets/sets item capacity for a given container
.totalItemCount // gets total item count in a container, including sub-containers
Updated item tooltips for containers to show accurate total item count, as well as to display max item capacity
Fixed a bug where picking up items from a non-locked down pile of items on the floor inside a multi could cause the remaining pile to be seen as no longer inside the multi, disallowing locking it back down and causing it to decay based on regular decay timer instead of house-specific one
Updated JS command set to allow setting poison-level on items ('set poison #) and hunger-level on characters ('set hunger #)
Fixed an issue with js/item/food.js that prevented poisoned food from poisoning characters when eaten
Fixed an issue with js/skill/poisoning.js that prevented players from poisoning food!
Updated various JS scripts and hardcoded targeting functions to disallow the targeting of locked down resources using skills and tools
Updated JS Method TextMessage() to support three extra, optional parameters. Note that if one optional parameter is included, all preceding optional parameters are also required!
speechTarget - What kind of target is this message intended for?
0 - Only visible for sender and receiver of message
1 - Visible to all players in range
2 - Visible to all NPCs and players in range
3 - Visible to all PCs everywhere + NPCs in range
4 - Visible to all PCs everywhere (broadcast)
5 - Only visible for the receiver of the message
speechTargetSerial - The serial of the receiver of the message, used if speechTarget is 0 or 5
speechFontType - The type of font to display the text in. Defaults to normal.
0 - Bold
1 - Normal with shadow
2 - Bold with shadow
3 - Normal
4 - Gothic
5 - Italic
6 - Small, dark
7 - Colourful
8 - Runic (only works with CAPS)
9 - Small, light
Added timestamp to worldsaves in console, to make it easier to see when a particular world-save was done
Added info about compiler/environment displayed at the top of the UOX3 console during startup
Updated dictionary files with new messages primarily related to housing
2020-11-04 02:00:37 +08:00
continue ;
2022-10-24 18:39:33 +08:00
if ( mChar - > IsDead ( ) & & tChar - > GetCommandLevel ( ) < CL_CNS & & tSock - > GetTimer ( tPC_SPIRITSPEAK ) = = 0 ) // GM/Counselors can see ghosts talking always Seers?
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
if ( mChar - > IsDead ( ) & & ! tChar - > IsDead ( ) ) // Ghost can talk normally to other ghosts
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
tSock - > Send ( ghostedText ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
else
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
tSock - > Send ( txtToSend ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
}
UOX3 0.99.5b
Fixed an issue where karma titles would inadvertently have the space behind the title trimmed before being displayed in paperdoll, resulting in erroneous display of title + name there
Fixed an issue with a cooking script (js/skill/cooking/cooking.js) where sweet dough would not get consumed properly on cooking (Dragon Slayer)
Updated C++ function calcRegionFromXY to work with CBaseObject instead of CChar, so it also works for Items
Items now have current town region stored as an object property during runtime. This is calculated on load, when container property is updated, and when an item is picked up or dropped. The region is also accessible via the (read-only) JS Item property .region
Added new JS Event to allow capturing button presses from the old-school gump displayed by client via packet 0x76, which was originally used by the old-school crafting menus in T2A. The requirement for this to work is that the gump in question must have a gumpID between 0x4000 and 0xffff (which can be set when manually creating a packet with this ID via JS), and the Event itself must be in the global script:
onScrollingGumpPress( pSock, gumpID, buttonID )
Added new JS Event to allow better control over which names UOX3 sends to the client for characters:
onNameRequest( myObj, requestedBy ) // return custom string, or return empty string/nothing/true/false to use default name
Updated JS Events to also work for Items (previously only worked for Characters)
onLightChange( myObj, lightLevel )
onTempChange( myObj, temp )
onWeatherChange( myObj, weatherType )
Adjusted default temperature for town regions with no weather systems defined from 0 to 20 degrees Celsius
Updated some JS scripts (fishing.js, baking.js and cooking.js) to make use of GetTempTag/SetTempTag rather than GetTag/SetTag
Added cancel-checks to targeting functions in command script for add-commands (js/commands/targeting/add.js)
Updated get command script (js/commands/targeting/get.js) to allow retrieving region ID and name using 'get region
Updated misc command script (js/commands/custom/misc-cmd.js) to add 'gettemptag and 'settemptag commands, used to retrieve/set temporary custom tags from/on objects
Fixed a bug where Spirit Speak skill would be checked for race languages even if the race had LANGUAGEMIN defined as 0 (or not defined at all)
Fixed an issue where players using regular UO client would get stuck in a black void after teleporting between worlds, by adding an additional character refresh after the teleport
Fixed an issue where crafting tools for Blacksmithing and Carpentry would attempt to fetch the value of an incorrectly named INI setting to handle durability loss for the tools
Added new setting under [settings] section of UOX.INI to control whether it should be possible to craft weapons from coloured ingots or not:
CRAFTCOLOUREDWEAPONS=0/1 // If enabled(1), players can craft coloured weapons. Defaults to disabled(0)
Fixed an issue where the correct ingots were not consumed when attempting to craft items using colored ingots
Fixed a rogue debug message leftover in the scissor script
2022-02-13 22:49:37 +08:00
else if ( tChar - > GetRace ( ) ! = mChar - > GetRace ( ) & & ! tChar - > IsGM ( ) & & ! tChar - > IsCounselor ( ) )
2012-11-03 18:11:04 +00:00
{
UOX3 0.99.5b
Fixed an issue where karma titles would inadvertently have the space behind the title trimmed before being displayed in paperdoll, resulting in erroneous display of title + name there
Fixed an issue with a cooking script (js/skill/cooking/cooking.js) where sweet dough would not get consumed properly on cooking (Dragon Slayer)
Updated C++ function calcRegionFromXY to work with CBaseObject instead of CChar, so it also works for Items
Items now have current town region stored as an object property during runtime. This is calculated on load, when container property is updated, and when an item is picked up or dropped. The region is also accessible via the (read-only) JS Item property .region
Added new JS Event to allow capturing button presses from the old-school gump displayed by client via packet 0x76, which was originally used by the old-school crafting menus in T2A. The requirement for this to work is that the gump in question must have a gumpID between 0x4000 and 0xffff (which can be set when manually creating a packet with this ID via JS), and the Event itself must be in the global script:
onScrollingGumpPress( pSock, gumpID, buttonID )
Added new JS Event to allow better control over which names UOX3 sends to the client for characters:
onNameRequest( myObj, requestedBy ) // return custom string, or return empty string/nothing/true/false to use default name
Updated JS Events to also work for Items (previously only worked for Characters)
onLightChange( myObj, lightLevel )
onTempChange( myObj, temp )
onWeatherChange( myObj, weatherType )
Adjusted default temperature for town regions with no weather systems defined from 0 to 20 degrees Celsius
Updated some JS scripts (fishing.js, baking.js and cooking.js) to make use of GetTempTag/SetTempTag rather than GetTag/SetTag
Added cancel-checks to targeting functions in command script for add-commands (js/commands/targeting/add.js)
Updated get command script (js/commands/targeting/get.js) to allow retrieving region ID and name using 'get region
Updated misc command script (js/commands/custom/misc-cmd.js) to add 'gettemptag and 'settemptag commands, used to retrieve/set temporary custom tags from/on objects
Fixed a bug where Spirit Speak skill would be checked for race languages even if the race had LANGUAGEMIN defined as 0 (or not defined at all)
Fixed an issue where players using regular UO client would get stuck in a black void after teleporting between worlds, by adding an additional character refresh after the teleport
Fixed an issue where crafting tools for Blacksmithing and Carpentry would attempt to fetch the value of an incorrectly named INI setting to handle durability loss for the tools
Added new setting under [settings] section of UOX.INI to control whether it should be possible to craft weapons from coloured ingots or not:
CRAFTCOLOUREDWEAPONS=0/1 // If enabled(1), players can craft coloured weapons. Defaults to disabled(0)
Fixed an issue where the correct ingots were not consumed when attempting to craft items using colored ingots
Fixed a rogue debug message leftover in the scissor script
2022-02-13 22:49:37 +08:00
SKILLVAL raceLangMin = Races - > LanguageMin ( mChar - > GetRace ( ) ) ;
2025-02-10 23:43:54 -06:00
if ( raceLangMin > 0 & & Skills - > CheckSkill ( tChar , SPIRITSPEAK , Races - > LanguageMin ( mChar - > GetRace ( ) ) , mChar - > GetSkillCap ( SPIRITSPEAK ) ) ! = 1 )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
tSock - > Send ( ghostedText ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
else
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
tSock - > Send ( txtToSend ) ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
}
2012-11-03 18:11:04 +00:00
else
2002-04-07 21:27:53 +00:00
{
UOX3 0.99.6-RC6
Removed arbitrary and hidden restrictions on refreshing list of online players shown with 'wholist command
Fixed an issue where player ghosts that get teleported would not see themselves get updated to new location
Fixed a server crash from clients disconnecting while running server in debug mode
Improved how container updates are sent to players; now only sends to clients that have actually opened the container, and who are still within range
Added more information about UO data files being loaded during server startup
Enhanced the GM 'add menu to allow clicking directly on images of items/npcs to add them, and adjusted size of menus to accommodate this
Fixed an issue with fleeing NPCs that could cause them to attempt to flee across time and space, regardless of distance to target/attacker in combat
Added NPC AI that runs away from players if they get too close (even outside combat). Applied to hind, rabbits, squirrels, ferrets and various birds by default:
AI_ANIMAL_SCARED (aitype 12)
Fixed issues with NPCs fleeing forever, or getting stuck in flee/don't flee loop, by introducing max fleeing distance (50 tiles) and cooldown (30 sec) on fleeing
Updated onNameRequest JS Event to include third parameter with origin of name request, so script responses can be tailored appropriately:
onNameRequest( myObj, requestedBy, requestSource )
Potential values for requestSource:
0 - Speech/System Messages
1 - Guild Menus
2 - Stat Window (self)
3 - Stat Window (other)
4 - Tooltip
5 - Paperdoll Journal
6 - Paperdoll
7 - Single Click / All-Names
8 - System
9 - Secure Trade Window
Added Adaptive Performance System (APS) that dynamically adjust how often NPC AI/movement is checked based on overall shard performance. If performance drops below defined threshold, UOX3 gradually slows down checks for NPC AI/movement to prioritize player movement/speech/command responsiveness. If performance climbs back up above threshold, slowdowns are gradually removed. The following UOX.INI options have been added under [system] category to support this system:
APSPERFTHRESHOLD=50 // Performance threshold (measured in simulation cycles/sec) below which the APS kicks in
APSINTERVAL=100 // How often (in milliseconds) the APS checks performance and makes adjustments (if needed) to balance out shard performance
APSDELAYSTEP=50 // How much the delay timer is modified by (in milliseconds) each time APS makes adjustments
APSDELAYMAXCAP=2000 // Max amount of of delay APS can introduce for NPC AI/movement handling when attempting to restore shard performance
Added new JS Methods for Region objects:
.GetOrePrefs( oreType ) // Get ore preference data for ore type found in town region. Returned as an array containing the following data:
orePrefData -> [
oreName, // name of ore
color, // color of ore
minskill, // min skill to mine ore
ingotName, // name of ingot created from ore
makemenu, // makemenu entry for crafting something from ingot
oreChance, // default global chance of finding this ore type
scriptID // script attached to mined ore
],
orePrefChance // Chance of finding this ore type in given town region
.GetOreChance() // Get base chance of finding any ore in town region
Moved Mining skill plus gravedigging feature from hard code to scripts (js/skill/mining.js) to make it easier to maintain and/or customize, and removed hard coded variants
Gravedigging now relies on the ore resource system behind the scenes to restrict how often graves in a given area can be dug up
Fixed some incorrect references to .worldNumber Character property in misc scripts (should be .worldnumber)
Made some "hard-scripted" system messages in misc scripts use dictionary system instead
Added spawn region for banker NPCs in Serpent's Hold (dfndata/spawn/felucca/spawn_town_serpents_hold.dfn, dfndata/spawn/trammel/spawn_town_serpents_hold.dfn)
Fixed region definition of Ocllo to actually cover the entire town (dfndata/regions/regions.dfn)
Added numerous additional locations accessible with 'goplace # command, for key locations in Ilshenar, Malas, Tokuno Islands and Ter Mur (dfndata/location/location.dfn)
Revised travel-menu portion of GM menu (shortcut: 'travel) to include more travel options based on new locations (dfndata/items/travelmenu.dfn and travelmenu.bulk.dfn)
Fixed an issue where NPCs could attempt to attack targets in other worlds/instances
Added new JS Event that triggers for characters who are about to deal damage in combat. Complimentary to onDamage, which triggers for chars receiving damage:
onDamageDeal( dmgDealer, dmgReceiver, damageValue, damageType )
Added new JS Event that can trigger in global script upon creation of new player chars. Note that this will trigger in place of onCreateDFN event for player characters:
onCreatePlayer( pChar )
Added new JS Event that triggers for characters selecting a target with a spell. Complimentary to onSpellTarget, which triggers for targets selected with a spell:
onSpellTargetSelect( caster, target, spellNum )
Updated onCombatStart and onCombatEnd JS Events to also trigger for the other party in combat
Updated onPickup JS Event to include a third parameter - the potential container item was picked up from. Event now also triggers event in scripts attached to said containers:
onPickup( iPickedUp, pChar, iCont )
Added tracking of total playtime per individual character, and per account across all characters, and exposed these properties to JS engine:
.totalPlayTime // Account property, total playtime across all chars
.playTime // Character property, total playtime on given character only
Added new player-accessible command ('playtime) to spit out the playtime of current character/account as a whole (js/commands/playtime.js)
Implemented first version of Young Player System:
Replaced the UNUSED9 account flag with YOUNG, to be used by Young/New Player System
Added new JS Account property that gets/sets whether player account is considered Young:
.isYoung
Added new Char timers:
TIMER_YOUNGHEAL // Restricts how often Young players are healed by NPC healers
TIMER_YOUNGMESSAGE // Restricts how often Young players are warned about dangerous looking monsters in overworld
Updated GM commands 'get and 'set to get/set .isYoung property of player's account (js/commands/targeting/get.js and set.js)
Added new UOX.INI setting to enable/disable Young Player System (enabled by default):
YOUNGPLAYERSYSTEM=1
If Young Player System is enabled, all newly created player accounts are automatically marked with Young flag
Added new script to handle various restrictions and functions related to Young characters (js/player/young_player.js):
Young characters will have [Young] displayed over their head
Young characters will have their Young status checked and verified on every login + every stat/skill gain, to revoke the Young status if any of the following is true:
Account has a total playtime of more than 40 hours
Any character has more than 350 total (base) skill points
Any character has more than 70 skill points in a single skill
Any character has more than 150 total stat points
Any character has more than 80 stat points in a single stat
Young characters can renounce their Young status manually by saying the words "I renounce my young player status"
Young characters get two additional items upon creation:
a new player ticket (can be combined with any other players new player ticket for both players to get a reward)
a sextant (shows Young players directions to nearest moongate/bank regardless of where they are, as long as outdoors)
Young characters cannot target other player characters with hostile spells or skills
Young characters cannot be the target of other player characters' hostile spells or skills
Young characters can only cast beneficial spells upon themselves or other Young characters
Young characters can only be the target of beneficial spells from other Young players
Young players (and their pets/followers) cannot attack or harm any other players (or their pets/followers), nor themselves be attacked or harmed by any other players (or their pets/followers), whether from combat, spells, skills or items
Young players don't lose any of their items on death, and are teleported to the nearest healer upon death with all their items intact
Young players receive a warning upon entering dungeons that monsters there will be hostile
Updated global script (js/server/global.js) to:
Check/Verify Young status of players upon login
Attach young player script on login/creation for players on Young accounts
Give specific items to Young players upon creation
Added new script (js/item/corpse.js) that is assigned to all freshly created corpses. This script handles restrictions related to Young players interactions with corpses, and the interactions of other players with corpses of Young players
Updated JS Method .Carve() to return true/false depending on whether carving a corpse was successful
Updated Healer AI in code to heal nearby injured Young players
Updated Evil AI and Evil Caster AI in code to avoid selecting Young players as targets in combat outside of dungeons
Added a new section to UOX.INI - [young player starting locations] - that can be used to define starting locations for Young players. If only one such location is provided, all players start there. Otherwise, it matches the same starting location setup as the regular one - with one entry per town in Britannia.
Restricted transferring and/or friending of pets (code) and hirelings (hirelings.js) between Young and non-Young players
Restricted Young players from recalling or gating to Felucca facet
Young players can instantly logout from anywhere, at any time
2023-07-01 20:02:40 +08:00
std : : string mCharName = GetNpcDictName ( mChar , nullptr , NRS_SPEECH ) ;
0.99.4v
Added JS command to reload dictionaries
'reloaddictionaries
Fixed a server crash related to casting of spells
Fixed some issues with Line-of-Sight checks related to items under/above ground, LoS checks between different floors of buildings, etc.
Updated handling of skill-training keywords to be based on language-independent keyword IDs rather than trying to match player-input text to specific skill-names
Updated animal-trainer/stablemasterscript (js/npc/ai/stablemaster.js) with several changes:
Fixed an issue where the same pet would be stabled in all available slots if payment was taken from player's bank account instead of their backpack
Fixed an issue where stablemaster would not pause walking for a while when a player interacts with them
Converted all system messages and text messages in stablemaster script to dictionary entries
Added new NPC AI type to source - AI_STABLEMASTER (9) - and assigned this to animal trainers. This is used to identify this type of NPCs for the purpose of displaying relevant context menus
Reworked banker AI script (js/npc/ai/banker.js) to use triggerwords from client instead of hard-defined strings, to work better with multiple languages (and work with all relevant triggerwords)
Fixed a bug with banker AI script (js/npc/ai/banker.js) that prevented players from using the "withdraw" command
Re-added NPC AI 8 to banker NPCs (dfndata/npc/male_vendors.dfn and female_vendors.dfn) so code can check for presence of this AI when handling context menus
Removed remaining hard-coded banking functionality - all handled by script anyway
Added new context menu option for NPC bankers - Open Bankbox
Updated code handling of context menus to only show context menus when relevant:
Open Paperdoll - Shows for all characters with a paperdoll
Open Backpack - Shows for player's character, pack animals and hirelings
Open Bankbox - Shows for banker NPCs (if within 8 tiles)
Buy/Sell - Shows for vendor NPCs (if within 8 tiles, and if they have anything for sale/are buying anything)
Added new context menu entries for pets, which can be used if player is within 12 tiles of pet:
Command: Kill
Command: Stop
Command: Follow
Command: Stay
Command: Guard
Add Friend
Remove Friend
Transfer
Release
Added new context menu entries for stablemasters/animal trainers:
Claim All Pets
Stable Pet
Added new context menu entries for Escort Quest NPCs
Ask Destination (if within 3 tiles)
Accept Escort (if within 3 tiles)
Abandon Escort
Added new context menus for NPCs that can teach skills to players (limited to max 10 per NPC)
Train [skillName]
Added new AI script for NPC hirelings (3204=js/npc/ai/hireling.js), who can be hired to follow the player around for a limited amount of time, and function the same way as pets. In addition to the regular pet commands, these speech commands are supported:
hire // The hireling will respond with the cost to hire them
dismiss // Replaces the "release" command for pets; will dismiss the hireling
patrol // The hireling will patrol between it's current location and a second targeted location nearby
move // The hireling will try to shuffle out of the way
fetch // The hireling will try to fetch a targeted item
drop // The hireling will drop to the ground all loot they're currently carrying
report // The hireling will report on the remaining time they're hired for
Added new NPC DFN tag used by code to detect hireling NPCs for the purpose of displaying context menus:
HIRELING // No additional value/data needed for tag
Added new context menu entries for Hireling NPCs, in addition to the ones for regular pets:
Hire // Can be used within 3 steps of the hireling, who will respond with cost to hire them
Dismiss // Replaces the "release" command for pets, will dismiss the hireling
Added HIRELING tag and SCRIPT=3204 to and updated stats of various NPCs that will be hireable:
m_fighter, f_fighter, m_beggar, f_beggar, m_peasant, f_peasant, m_sailor, f_sailor, m_pirate, f_pirate
Added new hireling NPC:
m_paladin, f_paladin
Added new UOX ini setting to enable/disable context menus
CONTEXTMENUS=1/0 (defaults to 1)
Added new Item JS Method to check if an item's ID is on a specified food list
.IsOnFoodList( foodList ) // Returns true/false if item's ID is on specified foodList
Added new OMNIVORE food list and assigned it to [basehuman] DFN section
Added new Character JS Properties
.isGuarded // Gets/Sets whether character is guarded by a pet/hireling
.guarding // Gets/Sets the object (if any) being guarded by a pet/hireling
Fixed multiple issues with health bars, flagging and character highlighting
Added some crash protection for invalid data used with CUSTOMINTTAG and CUSTOMSTRINGTAG DFN tags for Items, NPCs and Multis
Fixed an issue which prevented hard-coded checks from running when using items
Added new global js object (Timer) to make the use of character timers in JS more robust, with properties matching timer names from enum in source.
Properties:
.TIMEOUT // Time until next attack can be done in combat
.INVIS // Time until invisible character becomes visible
.HUNGER // Time until character grows more hungry
.THIRST // Time until character grows more thirsty
.POISONTIME // Time until next tick of poison damage
.POISONTEXT // Time until next message about suffering from poison
.POISONWEAROFF // Time until poison wears off
.SPELLTIME // Time until spell cast is completed. Can be set to 0 to interrupt
.ANTISPAM // Time until next speech message can be sent (for anti spam purposes)
.CRIMFLAG // Time until criminal flag runs out
.MURDERRATE // Time until next murder count decay
.PEACETIMER // Time until character can re-enter combat after being affected by peacemaking
.FLYINGTOGGLE // Time until next time flying ability can be toggled for gargoyles
.MOVETIME // Time until NPC can move again
.SPATIMER // Time until next time NPC can cast a spell
.SUMMONTIME // Time until a summoned NPC will vanish
.EVADETIME // Time until an NPC will exit evade state
.LOGOUT // Time it takes for a player char to vanish after logout
Examples of use:
var hungerTimer = myChar.GetTimer( Timer.HUNGER )
myChar.SetTimer( Timer.HUNGER, 15000 )
Added new Character JS Methods to add, remove and list friends of a pet/hireling:
.AddFriend( playerToAdd ) // Adds player to friend list
.RemoveFriend( playerToRemove ) // Removes player from friend list
.GetFriendList() // Gets list of friends
.ClearFriendList() // Clears list of friends
Added new Character JS Method to fetch a player character's list of pets/followers
.GetPetList() // Gets list of pets/followers
Added new persistent NPC property to keep track of a pet's previous owners, whether those tamed the pet or had it transferred to them. Every time a pet is tamed, or is transferred to a new owner, this list is updated:
GenericList< CChar * > petOwnerList
Added new Character JS Method to check if a player is on a pet's owner list as a previous owner:
.HasBeenOwner( mChar )
Previous owners of a pet can re-tame it with guaranteed chance of success
Updated JS Method Refresh() to be usable with both items or characters, to send updated state of object to nearby players
Added character tooltip [Guarded] for characters being guarded by a pet/hireling
Pets/hirelings that are transferred will now immediately start following their new master instead of wandering freely
Pets/hirelings can no longer be transferred between players as long as either party is flagged as a criminal
Pets/hirelings can no longer be transferred to dead players
Pets/hirelings can no longer be transferred to NPCs
Summoned creatures can no longer be transferred to other players
Summoned creatures can no longer have friends
Friend lists of pets/hirelings are now cleared when the pet/hireling is transferred to another player
Added new UOX.INI settings to control how many pets players can have active:
MAXCONTROLSLOTS=0 // Maximum number of pet control slots available to player. Disabled if 0
MAXFOLLOWERS=5 // Maximum pets/followers a player can have active at the same time. Used if control slots are disabled
MAXPETOWNERS=5 // Maximum number of different owners a pet can have over its lifetime before it becomes impossible to retame
Added new NPC property and NPC DFN tag that keeps track of how many pet control slots an NPC would take up if owned by a player:
UI08 controlSlots // source property
CONTROLSLOTS=# // DFN tag
Added new Character JS properties:
.ownerCount // Get the total number of owners a pet/hireling has had, based on NPC's petOwnerList
.controlSlots // Get/Set number of pet control slots an NPC will occupy
.controlSlotsUsed // Get/Set the number of control slots used by a player
Updated get (js/commands/targeting/get.js) and set (js/commands/targeting/set.js) commands to support getting/setting the following character properties:
deaths
ownerCount (read only)
controlSlots
controlSlotsUsed
Updated NPC DFNs with default CONTROLSLOT=# tags
Increased the max distance from player that onSpeech JS event will trigger from 7 to 12
Updated how "all attack" and "all follow" commands for pets are handled. Now loops through all pets owned by character and executes command for each eligible pet
Fixed an issue where NPCs could follow characters in different worlds/instances than them selves
Updated default max amount of items that can be sold to NPC vendors from 5 to 250
Guards can no longer train players in skills
Updated equipment itemlists (dfndata/items/itemlists/itemlists.dfn) with blank entries to introduce some more variety in the type of clothes NPCs wear in general
Added new NPCs to DFNs (dfndata/npc/undead.dfn) and added them to undead npclist:
[skeletalmage] // variation of [bonemage]
[skeletalknight] // variation of [boneknight]
Updated Titles (dfndata/titles/titles.dfn) with up-to-date titles for skills around Pub 15, and added titles for skills added after that. Also added "Elder" and "Legendary" titles for 110 and 120 skillpoints
Updated EQUIPITEM tag in newbie.dfn (dfndata/newbie/newbie.dfn) to support an optional hue parameter (EQUIPITEM=id,hue)
Updated starting equipment for new characters (dfndata/newbie/newbie.dfn), with commented out practice weapons. Uncomment to use
Added item definitions for practice weapons (dfndata/items/gear/weapons/practice_weapons.dfn):
practice_skinning_knife
practice_hatchet
practice_axe
practice_mace
practice_longsword
practice_spear
practice_bow
practice_club
practice_crook
practice_gnarled_staff
Updated mount statues DFN (dfndata/items/misc/mount-statues.dfn) and JS (js/npc/pets/*.js) files to include pet control slot related stuff
Pets now inherit the karma of their owners, but revert to their original karma upon release
Pets and hirelings will no longer follow the ghosts of their dead owners, but stay to guard their corpse
Added optional 9th parameter for JS Function CreateDFNItem to specify a color for item created. This comes before the other optional parameters - worldNumber and instanceID (which are only used if character is NULL):
CreateDFNItem( mSock, mChar, sectionName, inPack, iAmount, itemType, iColor, worldNumber, instanceID )
Added ID of Giant Beetle to various pack animal checks
Pack animals will now drop any newbie/blessed items stored in their packs upon death
Added new NPC properties to track pet loyalty, and exposed these as Character JS properties, and NPC DFN tags:
JS Properties
.maxLoyalty // Defaults to 100
.loyalty // Starts at 25
DFN Tags
MAXLOYALTY=# // Defaults to 100
LOYALTY=# // Starts at 25
Updated TriggerEvent JS function to support return values (int, bool, string, object) from called script
Updated various JS scripts to make use of new TriggerEvent functionality and reduce reliance on custom tags:
js/item/archerybutte.js
js/item/trainingdummy.js
js/server/data/combatanims.js
js/server/data/weapontypes.js
Updated archerybutte script to use dictionary for system and text messages
Updated archerybutte script to support increased range, distance penalty and dex/str bonuses when calculating score
Added new UOX.INI settings under [pets and hirelings] section related to pet control and loyalty:
CHECKPETCONTROLDIFFICULTY=1 // Enable/Disable pet control difficulty system
PETLOYALTYGAINONSUCCESS=1 // Amount of pet loyalty gained on successful pet command use
PETLOYALTYLOSSONFAILURE=3 // Amount of pet loyalty lost on failed pet command use
PETLOYALTYRATE=900 // Amount of seconds between each time pet loyalty is automatically reduced by 1. Takes 25 hours to deplete completely from max
Added new persistent NPC property that keeps track of the difficulty of taming and controlling a pet, and exposed it as a Character JS property:
.orneriness
Every time a tamed pet is released or goes wild, its "orneriness" increases, making it more difficult for other players to tame, and more difficult for anyone to control.
Updated CBasePetResponse::canControlPet() function to use pet control difficulty system if enabled, which checks player's animal taming/animal lore skill vs a pet's "orneriness" to determine chance of pet accepting a given pet command
On successful use of pet command, increases pet loyalty by value defined in PETLOYALTYGAINONSUCCESS ini setting
On failed use of pet command, decreases pet loyalty by value defined in PETLOYALTYLOSSONFAILURE ini setting
Added new Character JS Method to calculate chance of a player successfully controlling the pet:
.CalculateControlChance( mChar ) // Returns value between 0 and 1000 indicating chance of success
Feeding a pet will now restore its loyalty to maximum
Pets will now lose loyalty on hunger checks when at maximum hunger
Pets that are maximum hungry will now only have a chance to go wild if loyalty has dropped to zero
Added new DFN tag for creatures.dfn - TYPE - which contains a string describing the type of creature
Added secure pet trading. Players who trade pets will now see a pet transfer deed appear in a secure trade window with the name and type of creature, and upon completion of the trade the associated pet will be instantly transferred to the other player
Updated resource JS scripts (js/server/resource/*) to use dictionaries for all system messages
Updated skill JS scripts (js/skill/*) to use dictionaries for all system messages
Updated housing JS scripts (js/server/house/*) to use dictionaries for all system messages
Updated item JS scripts (js/item/*) to use dictionaries for all system messages
Updated magic JS scripts (js/magic/*) to use dictionaries for all system messages
Updated NPC AI JS scripts (js/npc/ai/*) to use dictionaries for all system messages
Updated command JS scripts (js/commands/*) to use dictionaries for all system messages, gump tooltips, etc
Updated code to use dictionaries for all system messages
Fixed incorrect spelling for UOX.INI setting HIDEW(H)ILEMOUNTED and updated hiding skill (js/skill/hiding.js) to actually allow/disallow hiding while mounted based on this setting
Added new Character JS Method to make it easier to make one NPC initiate combat with another:
.InitiateCombat( targetChar ) // Character attempts to initiate combat with target character
Updated parrying portion of combat code to be in line with Pub15/pre-AoS parrying mechanics. High AR shields now absorb more damage on a successful parry, while low AR shields have a higher chance of parrying. Shields are also now more effective against archery attacks (full absorption potential) than melee attacks (half absorption potential).
Updated combat damage calculations to be in line with Pub15/pre-AoS damage calculations
Adjusted default value of COMBATNPCDAMAGERATE ini setting (damage divisor when target is a player) from 2 to 1 to account for these changes.
Removed dictionary.UNK, and made dictionary.ZRO the default dictionary used for all unsupported languages
Added dictionary support for additional languages: Portuguese, Italian, Czech
Updated default dictionaries for the following languages: English, French
Added default dictionaries for the following languages: German, Spanish, Portuguese, Italian, Czech (note that translations have been provided by automatic services and will contain inaccuracies!)
Added new UOX.INI setting to allow specifying a default dictionary language for server, which if set will force that language for all dictionary messages, regardless of client settings:
SERVERLANGUAGE=0 // Set default server dictionary language. Supported languages: 0 - None/language used by each client, 1 - English, 2 - German, 3 - Spanish, 5 - French, 6 - Portuguese, 7 - Italian, 8 - Czech
Added new function in combat.cpp - AdjustArmorClassDamage() - which adjusts the damage dealt in combat based on whether armour class (AC DFN tag or .ac JS property) of weapon and armour equipped on hit location of target match up. A weapon with armour class 1 would essentially be doubly effective against armour of armour class 1. Allows setting up things like piercing weapons being better against some armor types than mace weapons, etc.
Added new UOX.INI setting under [combat] to enable/disable double damage from armour class bonuses:
ARMORCLASSDAMAGEBONUS=0/1 //defaults to 0)
2021-07-28 16:02:56 +08:00
2012-11-03 18:11:04 +00:00
if ( mChar - > GetVisible ( ) = = VT_TEMPHIDDEN | | mChar - > GetVisible ( ) = = VT_INVISIBLE | | mChar - > GetVisible ( ) = = VT_PERMHIDDEN )
2002-04-07 21:27:53 +00:00
{
2021-07-29 01:01:12 +08:00
if ( ( tChar - > IsGM ( ) | | tChar - > IsCounselor ( ) ) | | ( Type ( ) = = WHISPER | | Type ( ) = = ASCIIWHISPER ) )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
tSock - > SysMessage ( 1794 , mCharName . c_str ( ) ) ; // (Whisper from %s)
2012-11-03 18:11:04 +00:00
tSock - > Send ( txtToSend ) ;
2002-04-07 21:27:53 +00:00
}
}
2012-11-03 18:11:04 +00:00
else
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
if ( ( Type ( ) = = YELL | | Type ( ) = = ASCIIYELL ) & & ! ObjInRange ( tChar , mChar , DIST_SAMESCREEN ) )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
tSock - > SysMessage ( 1795 , mCharName . c_str ( ) ) ; // (Yelled by %s)
2012-11-03 18:11:04 +00:00
tSock - > Send ( txtToSend ) ;
2002-04-07 21:27:53 +00:00
}
2012-11-03 18:11:04 +00:00
else
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
tSock - > Send ( txtToSend ) ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
}
}
}
}
2012-11-03 18:11:04 +00:00
delete uniTxtToSend ;
delete asciiTxtToSend ;
delete uniGhostedText ;
delete asciiGhostedText ;
2002-04-07 21:27:53 +00:00
}
}
2012-11-03 18:11:04 +00:00
return true ;
2002-04-07 21:27:53 +00:00
}
2012-11-03 18:11:04 +00:00
CSpeechQueue : : CSpeechQueue ( ) : pollTime ( 100 ) , runAsThread ( false )
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
speechList . resize ( 0 ) ;
2022-06-22 07:35:21 -04:00
//InitializeLookup();
}
2022-10-24 18:39:33 +08:00
auto CSpeechQueue : : Startup ( ) - > void
{
2002-04-07 21:27:53 +00:00
InitializeLookup ( ) ;
}
CSpeechQueue : : ~ CSpeechQueue ( )
{
2012-11-03 18:11:04 +00:00
for ( SPEECHLIST_ITERATOR slIter = speechList . begin ( ) ; slIter ! = speechList . end ( ) ; + + slIter )
{
2022-10-24 18:39:33 +08:00
delete ( * slIter ) ;
( * slIter ) = nullptr ;
2012-11-03 18:11:04 +00:00
}
speechList . clear ( ) ;
2002-04-07 21:27:53 +00:00
}
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
//| Function - CSpeechQueue::SayIt()
//o------------------------------------------------------------------------------------------------o
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| Purpose - Sends out specified speech entry to users
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
2012-11-03 18:11:04 +00:00
void CSpeechQueue : : SayIt ( CSpeechEntry & toSay )
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
CPacketSpeech toSend = toSay ;
2021-06-12 07:30:23 -04:00
CChar * thisChar = nullptr ;
CItem * thisItem = nullptr ;
CBaseObject * thisObj = nullptr ;
CSocket * thisSock = nullptr ;
2012-11-03 18:11:04 +00:00
if ( toSay . Speaker ( ) > BASEITEMSERIAL )
2003-03-05 01:51:10 +00:00
{
2022-10-24 18:39:33 +08:00
thisItem = CalcItemObjFromSer ( toSay . Speaker ( ) ) ;
2012-11-03 18:11:04 +00:00
thisObj = thisItem ;
2003-03-05 01:51:10 +00:00
}
else
{
2022-10-24 18:39:33 +08:00
thisChar = CalcCharObjFromSer ( toSay . Speaker ( ) ) ;
2012-11-03 18:11:04 +00:00
thisObj = thisChar ;
2003-03-05 01:51:10 +00:00
}
2021-06-12 07:30:23 -04:00
CChar * sChar = nullptr ;
CSocket * mSock = nullptr ;
2012-11-03 18:11:04 +00:00
switch ( toSay . TargType ( ) )
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
case SPTRG_INDIVIDUAL : // aimed at individual person
2022-10-24 18:39:33 +08:00
if ( ValidateObject ( thisChar ) )
2012-11-03 18:11:04 +00:00
{
thisSock = thisChar - > GetSocket ( ) ;
2021-06-12 07:30:23 -04:00
if ( thisSock ! = nullptr )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
thisSock - > Send ( & toSend ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
}
2022-10-24 18:39:33 +08:00
sChar = CalcCharObjFromSer ( toSay . SpokenTo ( ) ) ;
2012-11-03 18:11:04 +00:00
if ( ValidateObject ( sChar ) & & sChar ! = thisChar )
{
mSock = sChar - > GetSocket ( ) ;
2021-06-12 07:30:23 -04:00
if ( mSock ! = nullptr )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
mSock - > Send ( & toSend ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
}
2002-04-07 21:27:53 +00:00
break ;
2012-11-03 18:11:04 +00:00
case SPTRG_PCNPC : // all NPCs and PCs in range
case SPTRG_PCS : // all PCs in range
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
if ( ! ValidateObject ( thisObj ) )
2012-11-03 18:11:04 +00:00
break ;
2022-10-24 18:39:33 +08:00
2021-06-12 07:30:23 -04:00
if ( ValidateObject ( thisItem ) & & thisItem - > GetCont ( ) ! = nullptr ) // not on ground, can't guarantee speech
2012-11-03 18:11:04 +00:00
break ;
2022-06-06 14:24:41 -04:00
2022-10-24 18:39:33 +08:00
for ( auto & mSock : FindPlayersInVisrange ( thisObj ) )
{
2002-04-07 21:27:53 +00:00
CChar * mChar = mSock - > CurrcharObj ( ) ;
2022-10-24 18:39:33 +08:00
if ( ValidateObject ( mChar ) )
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
if ( mChar - > GetCommandLevel ( ) > = toSay . CmdLevel ( ) )
2022-10-24 18:39:33 +08:00
{
2002-04-07 21:27:53 +00:00
mSock - > Send ( & toSend ) ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
}
}
2012-11-03 18:11:04 +00:00
break ;
2002-04-07 21:27:53 +00:00
}
2012-11-03 18:11:04 +00:00
case SPTRG_BROADCASTPC : // ALL PCs everywhere + NPCs in range
case SPTRG_BROADCASTALL :
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
{
2022-10-24 18:39:33 +08:00
for ( auto & mSock : Network - > connClients )
{
if ( mSock )
{
2022-06-07 13:50:49 -04:00
auto mChar = mSock - > CurrcharObj ( ) ;
2022-10-24 18:39:33 +08:00
if ( ValidateObject ( mChar ) )
{
if ( mChar - > GetCommandLevel ( ) > = toSay . CmdLevel ( ) )
{
2012-11-03 18:11:04 +00:00
mSock - > Send ( & toSend ) ;
2022-06-07 13:50:49 -04:00
}
2012-11-03 18:11:04 +00:00
}
2002-04-07 21:27:53 +00:00
}
}
2012-11-03 18:11:04 +00:00
break ;
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
}
2012-11-03 18:11:04 +00:00
case SPTRG_ONLYRECEIVER : // only the receiver gets the message
2022-10-24 18:39:33 +08:00
sChar = CalcCharObjFromSer ( toSay . SpokenTo ( ) ) ;
2012-11-03 18:11:04 +00:00
if ( ValidateObject ( sChar ) & & sChar ! = thisChar )
{
mSock = sChar - > GetSocket ( ) ;
2021-06-12 07:30:23 -04:00
if ( mSock ! = nullptr )
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
mSock - > Send ( & toSend ) ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
}
break ;
2021-06-03 14:22:50 +08:00
case SPTRG_NULL :
break ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
}
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| Function - bool InternalPoll( void )
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
Instance-support and misc code cleanup
Misc code and documentation cleanup:
Updated and standardized function comment blocks throughout entire codebase
Grouped getters and setters together in pairs and documented them as one
Removed empty and/or non-useful information from comment blocks
Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
SpawnRegion JS Functions
IterateOverSpawnRegions()
GetSpawnRegion( spawnRegNum )
GetSpawnRegionCount()
SpawnRegion JS Properties
name
regionNum
itemList
npcList
item
npc
maxItems
maxNpcs
itemCount
npcCount
onlyOutside
prefZ
x1
y1
x2
y2
world
instanceID
minTime
maxTime
call
2020-08-08 13:57:15 +08:00
//| Purpose - Sends out any pending speech, returning true if entries were sent
2022-10-24 18:39:33 +08:00
//o------------------------------------------------------------------------------------------------o
2012-11-03 18:11:04 +00:00
bool CSpeechQueue : : InternalPoll ( void )
2002-04-07 21:27:53 +00:00
{
bool retVal = false ;
2021-06-12 07:30:23 -04:00
CSpeechEntry * toCheck = nullptr ;
2002-04-07 21:27:53 +00:00
2012-11-03 18:11:04 +00:00
SPEECHLIST_ITERATOR slIter = speechList . begin ( ) ;
while ( slIter ! = speechList . end ( ) )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
toCheck = ( * slIter ) ;
2012-11-03 18:11:04 +00:00
2025-05-27 08:40:00 +10:00
if ( toCheck - > At ( ) = = - 1 | | toCheck - > At ( ) < = cwmWorldState - > GetUICurrentTime ( ) )
2002-04-07 21:27:53 +00:00
{
retVal = true ;
2022-10-24 18:39:33 +08:00
SayIt ( ( * toCheck ) ) ;
2002-04-07 21:27:53 +00:00
2022-10-24 18:39:33 +08:00
delete ( * slIter ) ;
( * slIter ) = nullptr ;
2002-04-07 21:27:53 +00:00
2012-11-03 18:11:04 +00:00
slIter = speechList . erase ( slIter ) ;
}
else
2022-10-24 18:39:33 +08:00
{
2012-11-03 18:11:04 +00:00
+ + slIter ;
2022-10-24 18:39:33 +08:00
}
2012-11-03 18:11:04 +00:00
}
2002-04-07 21:27:53 +00:00
return retVal ;
}
bool CSpeechQueue : : Poll ( void )
{
if ( RunAsThread ( ) )
{
while ( RunAsThread ( ) )
{
InternalPoll ( ) ;
Misc fixes - 0.99.3a
Undid dictionary rename from ENG to ENU and FRE to FRA; these are not actual language codes, but groups of language codes - ENU covers all English language codes, FRA covers all French ones.
Refined build notes
Updated Debug Information Format for Debug x64 platform in VS project properties to Program Database for Edit and Continue
Minor fix for a half-broken system (automatic adding of items to add-menu) that needs to be revamped or removed
Commented out some thread-locking code that was causing UOX3 to crash under certain circumstances
Fixed a few cases of threads sleeping for microseconds instead of milliseconds
Replaced all calls to UOXSleep with direct call to std::this_thread::sleep_for(), and removed UOXSleep function from funcdecl.h
Fixed an issue with "Gold" ore/ingot type, which was mislabelled as "Golden" in the ORE_LIST section of skills.dfn
Fixed an issue where crafting skills might consume the wrong resource if additional resources of the same ID but different color were present in player's backpack
Improved AmbientFootsteps feature so footstep sounds are played more in tune with character movement
AmbientFootsteps now also play for NPC movement
Changed how code handles randomizing between MINTIME and MAXTIME values from region spawners; now multiplies values by 60 (to get seconds) before randomizing, instead of after, to make use of full range of seconds between the values (which are in minutes)
Adjusted default global NPC movement speeds in [speedup} section of uox.ini to use less extreme values
Added a DEBUGMOVEMULTIPLIER define in cChar.cpp used to multiply NPC movement delays by the specified value (1.75 by default) when running UOX3 in debug mode, due to reduced server performance in debug mode
Documentation updates:
Added section on DFN tags for Character, Item, Region, SpawnRegion and Weather DFNs.
Added Feature documentation for Mining and customizable ores
Added More details in feature documentation for Spawn Regions
Updated feature documentation for Dictionaries
Added more details in UOX3 history section
2020-09-16 02:51:20 +08:00
std : : this_thread : : sleep_for ( std : : chrono : : milliseconds ( pollTime ) ) ; // so that it's never 0 (and number of milliseconds)
2002-04-07 21:27:53 +00:00
}
return true ;
}
else
2022-10-24 18:39:33 +08:00
{
2002-04-07 21:27:53 +00:00
return InternalPoll ( ) ;
2022-10-24 18:39:33 +08:00
}
2002-04-07 21:27:53 +00:00
}
2022-10-24 18:39:33 +08:00
CSpeechEntry & CSpeechQueue : : Add ( void ) // Make space in queue, and return pointer to new entry
2002-04-07 21:27:53 +00:00
{
2012-11-03 18:11:04 +00:00
size_t iSize = speechList . size ( ) ;
speechList . push_back ( new CSpeechEntry ) ;
2022-10-24 18:39:33 +08:00
return ( * speechList [ iSize ] ) ;
2002-04-07 21:27:53 +00:00
}
Code cleanup
Embraced the usage of R32, R64, SI16, UI16, SI32, UI32, SI64 and UI64 typedef aliases as replacement for built-in types throughout the sourcecode:
typedef float R32;
typedef double R64;
typedef signed char SI08;
typedef unsigned char UI08;
typedef signed short int SI16;
typedef unsigned short int UI16;
typedef signed int SI32;
typedef unsigned int UI32;
typedef signed long long SI64;
typedef unsigned long long UI64;
As part of this process, UI32 was redefined from unsigned long int to unsigned int, and SI32 from signed long int to signed int to ensure the size of variables using these remain the same (32bit) across both Windows, Linux and MacOS for both 32bit and 64bit platforms
Replaced instances of toLong() with toInt(), and toULong() to toUInt()
Replaced instances of "long" and "int" with SI32 where possible
Replaced instances of "unsigned long" and "unsigned int" with UI32 where possible
Replaced instances of "float" with R32 where possible
2020-08-12 23:46:33 +08:00
SI32 CSpeechQueue : : PollTime ( void ) const
2002-04-07 21:27:53 +00:00
{
return pollTime ;
}
Code cleanup
Embraced the usage of R32, R64, SI16, UI16, SI32, UI32, SI64 and UI64 typedef aliases as replacement for built-in types throughout the sourcecode:
typedef float R32;
typedef double R64;
typedef signed char SI08;
typedef unsigned char UI08;
typedef signed short int SI16;
typedef unsigned short int UI16;
typedef signed int SI32;
typedef unsigned int UI32;
typedef signed long long SI64;
typedef unsigned long long UI64;
As part of this process, UI32 was redefined from unsigned long int to unsigned int, and SI32 from signed long int to signed int to ensure the size of variables using these remain the same (32bit) across both Windows, Linux and MacOS for both 32bit and 64bit platforms
Replaced instances of toLong() with toInt(), and toULong() to toUInt()
Replaced instances of "long" and "int" with SI32 where possible
Replaced instances of "unsigned long" and "unsigned int" with UI32 where possible
Replaced instances of "float" with R32 where possible
2020-08-12 23:46:33 +08:00
void CSpeechQueue : : PollTime ( SI32 value )
2002-04-07 21:27:53 +00:00
{
pollTime = value ;
}
bool CSpeechQueue : : RunAsThread ( void ) const
{
return runAsThread ;
}
void CSpeechQueue : : RunAsThread ( bool value )
{
runAsThread = value ;
}
void CSpeechQueue : : DumpInFile ( void )
{
2022-10-24 18:39:33 +08:00
std : : string speechFile = cwmWorldState - > ServerData ( ) - > Directory ( CSDDP_LOGS ) + " speechdump.txt " ;
2012-11-03 18:11:04 +00:00
std : : ofstream speechDestination ( speechFile . c_str ( ) ) ;
Numerous changes with focus on feature and stability parity across Windows, Linux and MacOS platforms
Added new Makefile that handles compiling UOX3 and Spidermonkey on both Linux and MacOS (punt)
Added VS solution (SpiderMonkey.sln) and VC++ project files for compiling SpiderMonkey on Windows (Xuri)
Updated SpiderMonkey from v1.6.0 to v1.7.0
Added optimization flag -O2 for release build in CMakeLists.txt in project root (Xuri)
Added StringUtility file with general common string manipulation functions (punt)
Updated RandomNum function to use a "seedless" random number generator from C++11 instead of the old C rand() function. (punt)
Overall code cleanup to remove/replace platform-dependent code (punt)
Replaced potentially unsafe usage of C string stuff like sprintf, vsprintf, vsnprintf, strncat, strcpy and strlen throughout the code with calls to a format() function containing only a single, safe use of vsnprintf, ensuring there's a single place of failure if there's anything to fix and and making it easy to potentially replace this with std::format from C++20 when the time comes. (punt)
Replaced usage of char in many places with std::string (punt)
Started process of replacing UString usage with functions provided through StringUtility instead (punt)
Replaced platform specific fileIO handling in Windows/Linux with cross-platform C++17 standard std::filesystem (punt)
Replaced platform specific time handling by using cross-platform chrono library (punt)
Removed UOX namespace to reduce complexity (punt)
Elimitated template code approach to singletons for more modern c++ constructs, removing dependices in the process (punt)
Removed ODBC support; it hasn't been touched since the initial implementation in 2008, and there is a lack of someone to maintain the code. (punt)
Removed some platform specific files like uoxlinux.h, which is no longer required (punt)
Removed legacy crash protection code, and removed support for cluox (punt)
Removed legacy "support" for Borland compiler (punt)
Removed legacy VC++ 6 Workspace/Project files, VS2005 Solution/Project files, as these are no longer supported (Xuri)
Removed legacy BUILD folder with outdated compilation instructions (Xuri)
Removed old Changelog file (merged into Changelog.txt) (Xuri)
Fixed a pointer bug for items in multis on world load (punt)
Fixed a dictionary related issue that caused segmentation faults on Linux/MacOS (punt)
Fixed an issue with callbacks to JS scripts that caused segmentation faults on Linux/MacOS (punt)
Paths in uox.ini should now load properly on all platforms regardless of whether those paths use slashes or backslashes, and whether or not they end in a slash/backslash. (punt)
Moved to c++17 style of threading, and got rid of threadsafeobject.cpp/h (punt)
Replaced parsing of UOX.INI tags with a system that's more easily maintainable (punt)
Added some new commands to js/commands/custom/misc-cmd.js (Xuri)
cont // Targeted item will be made a container, set to nondecay and movable 2
endfight // Targeted character (and character being fought) will stop fighting
getmulti // Get multiObject for targeted item
finditem // Find item at layer X
movespeed // Set movement speed of target player (0x0 Normal, 0x1 Mounted, 0x2 Slow (walk only), 0x3 Hybrid ("jog"?), 0x4 Frozen)
Added new HTML based documentation in docs folder, and removed many old legacy docs that are either incorporated into this document already or no longer relevant for the current UOX3 version (Xuri)
Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-09-07 18:09:55 +08:00
if ( ! speechDestination )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
Console . Error ( oldstrutil : : format ( " Failed to open %s for writing " , speechFile . c_str ( ) ) ) ;
2002-04-07 21:27:53 +00:00
return ;
}
2012-11-03 18:11:04 +00:00
SPEECHLIST_ITERATOR toWrite ;
for ( toWrite = speechList . begin ( ) ; toWrite ! = speechList . end ( ) ; + + toWrite )
2002-04-07 21:27:53 +00:00
{
2022-10-24 18:39:33 +08:00
speechDestination < < " Time: " < < ( * toWrite ) - > At ( ) < < std : : endl ;
speechDestination < < " nColour: " < < ( * toWrite ) - > Colour ( ) < < std : : endl ;
speechDestination < < " nFont: " < < ( * toWrite ) - > Font ( ) < < std : : endl ;
speechDestination < < " nLanguage: " < < ( * toWrite ) - > Language ( ) < < std : : endl ;
speechDestination < < " nSpeech: " < < ( * toWrite ) - > Speech ( ) < < std : : endl ;
speechDestination < < " nSpeaker: " < < ( * toWrite ) - > SpeakerName ( ) < < std : : endl < < std : : endl ;
2002-04-07 21:27:53 +00:00
}
2012-11-03 18:11:04 +00:00
speechDestination . close ( ) ;
2002-04-07 21:27:53 +00:00
}