uox3/source/cmdtable.cpp

1605 lines
58 KiB
C++
Raw Permalink Normal View History

//
// This code is an attempt to clean up the messy "if/then/else" routines
// currently in use for GM commands, as well as adding more functionality
// and more potential for functionality.
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
//
// Current features:
// - Actual table of commands to execute, what perms are required, dialog
// messages for target commands, etc handled by a central system
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 "uox3.h"
#include "commands.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 "msgboard.h"
#include "townregion.h"
#include "cWeather.hpp"
#include "cServerDefinitions.h"
#include "wholist.h"
#include "cSpawnRegion.h"
#include "PageVector.h"
#include "speech.h"
#include "cHTMLSystem.h"
#include "CGump.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 "cEffects.h"
#include "classes.h"
#include "regions.h"
#include "CPacketSend.h"
#include "teffect.h"
#include "magic.h"
#include "ObjectFactory.h"
#include "cRaces.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"
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 "Dictionary.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
void CollectGarbage( void );
void EndMessage( SI32 x );
void HandleGumpCommand( CSocket *s, std::string cmd, std::string data );
void Restock( bool stockAll );
void SysBroadcast( const std::string& txt );
void HandleHowTo( CSocket *sock, SI32 cmdNumber );
//o------------------------------------------------------------------------------------------------o
//| Function - CloseCall()
//o------------------------------------------------------------------------------------------------o
//| Purpose - Closes an open call in the Que
//o------------------------------------------------------------------------------------------------o
void CloseCall( CSocket *s, bool isGM )
{
CChar *mChar = s->CurrcharObj();
if( mChar->GetCallNum() != 0 )
{
UI16 sysMessage = 1285; // Call removed from the GM queue.
2021-06-12 07:30:23 -04:00
PageVector *tmpVector = nullptr;
if( isGM )
{
tmpVector = GMQueue;
}
else
{
tmpVector = CounselorQueue;
++sysMessage;
}
if( tmpVector->GotoPos( tmpVector->FindCallNum( mChar->GetCallNum() )))
{
tmpVector->Remove();
mChar->SetCallNum( 0 );
s->SysMessage( sysMessage );
}
}
else
{
s->SysMessage( 1287 ); // You are currently not on a call.
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - CurrentCall()
//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 - Send GM/Counselor to the current call in the queue
//o------------------------------------------------------------------------------------------------o
void CurrentCall( CSocket *s, bool isGM )
{
CChar *mChar = s->CurrcharObj();
if( mChar->GetCallNum() != 0 )
{
2021-06-12 07:30:23 -04:00
PageVector *tmpVector = nullptr;
if( isGM )
{
tmpVector = GMQueue;
}
else
{
tmpVector = CounselorQueue;
}
if( tmpVector->GotoPos( tmpVector->FindCallNum( mChar->GetCallNum() )))
{
CHelpRequest *currentPage = tmpVector->Current();
CChar *i = CalcCharObjFromSer( currentPage->WhoPaging() );
if( ValidateObject( i ))
{
s->SysMessage( 73 ); // Transporting to your current call.
mChar->SetLocation( i );
}
currentPage->IsHandled( true );
}
else
{
s->SysMessage( 75 ); // No such call exists
}
}
else
{
s->SysMessage( 72 ); // You are not currently on a call.
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - NextCall()
//o------------------------------------------------------------------------------------------------o
//| Purpose - Send GM/Counsellor to next call in the que
//o------------------------------------------------------------------------------------------------o
void NextCall( CSocket *s, bool isGM )
{
CChar *mChar = s->CurrcharObj();
if( mChar->GetCallNum() != 0 )
{
CloseCall( s, isGM );
}
if( isGM )
{
if( !GMQueue->AnswerNextCall( s, mChar ))
{
s->SysMessage( 347 ); // The GM queue is currently empty.
}
}
else //Player is a counselor
{
if( !CounselorQueue->AnswerNextCall( s, mChar ))
{
s->SysMessage( 348 ); // The Counselor queue is currently empty.
}
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - FixSpawnFunctor()
//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 - Replaces legacy spawner objects that have incorrect item type
//o------------------------------------------------------------------------------------------------o
bool FixSpawnFunctor( CBaseObject *a, [[maybe_unused]] UI32 &b, [[maybe_unused]] void *extraData )
{
bool retVal = true;
if( ValidateObject( a ))
{
CItem *i = static_cast<CItem *>( a );
ItemTypes iType = i->GetType();
if( iType == IT_ITEMSPAWNER || iType == IT_NPCSPAWNER || iType == IT_SPAWNCONT ||
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
iType == IT_LOCKEDSPAWNCONT || iType == IT_UNLOCKABLESPAWNCONT ||
iType == IT_AREASPAWNER || iType == IT_ESCORTNPCSPAWNER )
{
if( i->GetObjType() != OT_SPAWNER )
{
CSpawnItem *spawnItem = static_cast<CSpawnItem *>(i->Dupe( OT_SPAWNER ));
if( ValidateObject( spawnItem ))
{
spawnItem->SetInterval( 0, static_cast<UI08>( i->GetTempVar( CITV_MOREY )));
spawnItem->SetInterval( 1, static_cast<UI08>( i->GetTempVar( CITV_MOREX )));
spawnItem->SetSpawnSection( i->GetDesc() );
spawnItem->IsSectionAList( i->IsSpawnerList() );
}
i->Delete();
}
}
}
return retVal;
}
void command_fixspawn( void )
{
UI32 b = 0;
ObjectFactory::GetSingleton().IterateOver( OT_ITEM, b, nullptr, &FixSpawnFunctor );
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_AddAccount()
//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 - GM command for adding new user accounts while in-game
//o------------------------------------------------------------------------------------------------o
void Command_AddAccount( CSocket *s)
{
VALIDATESOCKET( s );
if( Commands->NumArguments() > 1 )
{
Fixes for Console behaviour on Linux and Windows, addition of JS properties for user accounts Fixed long-standing issue with UOX3 console not resetting terminal properly after shutdown on Linux, after updating cConsole.cpp/h to conform to standard unix terminal commands/settings for certain features (punt) Fixed an issue that could cause a crash on Windows when attempting to broadcast system messages from the UOX3 console (punt) Fixed an issue that prevented text input in UOX3 console for system broadcasts from being displayed on Linux and MacOS (punt) Added support for new JS Object - IUE_ACCOUNT - which can be accessed via character property .account. The following account properties have been exposed to the JS engine: .id // Account ID (Read-Only) .username // Account Username (Read-Only) .flags // Flags set on account (Read-Only) .comment // Comment/contact info .character1 // Character in account slot 1 (Read-Only) .character2 // Character in account slot 2 (Read-Only) .character3 // Character in account slot 3 (Read-Only) .character4 // Character in account slot 4 (Read-Only) .character5 // Character in account slot 5 (Read-Only) .character6 // Character in account slot 6 (Read-Only) .character7 // Character in account slot 7 (Read-Only) .currentChar // Currently logged in character (if any) (Read-Only) .lastIP // Last IP used to connect to account (Read-Only) // Flag shortcuts .isBanned // Is account banned? .isSuspended // Is account suspended? .isPublic // Is comment/contact info to be considered public info? .isOnline // Is account online? .isSlot1Blocked // Is character slot 1 blocked? .isSlot2Blocked // Is character slot 2 blocked? .isSlot3Blocked // Is character slot 3 blocked? .isSlot4Blocked // Is character slot 4 blocked? .isSlot5Blocked // Is character slot 5 blocked? .isSlot6Blocked // Is character slot 6 blocked? .isSlot7Blocked // Is character slot 7 blocked? .unused9 // Unused flag .unused10 // Unused flag .isSeer // Is account marked as Seer account? .isCounselor // Is account marked as Counselor account? .isGM // Is account marked as GM account? Fixed 'addaccount command - can now once again be used to add a new user account to the server from in-game. See accounts.adm for info on available flags. Syntax: 'addaccount [username] [password] [(optional)flags] Updated 'get command to allow retrieving certain account properties for targeted player characters: username, flags, comment, character1, character2, character3, character4, character5, character6, character7, lastIP, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor and isGM Updated 'set command to allow setting certain account properties for targeted player characters: comment, password, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor, isGM Updated 'tweak command to allow viewing and modifying of certain account properties for targeted player characters Note that any changes to account properties will not go into effect until a worldsave or manual save of accounts via console has taken place. Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-16 21:14:50 +08:00
std::string newUsername = Commands->CommandString( 2, 2 );
std::string newPassword = Commands->CommandString( 3, 3 );
UI16 newFlags = 0x0000;
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
Fixes for Console behaviour on Linux and Windows, addition of JS properties for user accounts Fixed long-standing issue with UOX3 console not resetting terminal properly after shutdown on Linux, after updating cConsole.cpp/h to conform to standard unix terminal commands/settings for certain features (punt) Fixed an issue that could cause a crash on Windows when attempting to broadcast system messages from the UOX3 console (punt) Fixed an issue that prevented text input in UOX3 console for system broadcasts from being displayed on Linux and MacOS (punt) Added support for new JS Object - IUE_ACCOUNT - which can be accessed via character property .account. The following account properties have been exposed to the JS engine: .id // Account ID (Read-Only) .username // Account Username (Read-Only) .flags // Flags set on account (Read-Only) .comment // Comment/contact info .character1 // Character in account slot 1 (Read-Only) .character2 // Character in account slot 2 (Read-Only) .character3 // Character in account slot 3 (Read-Only) .character4 // Character in account slot 4 (Read-Only) .character5 // Character in account slot 5 (Read-Only) .character6 // Character in account slot 6 (Read-Only) .character7 // Character in account slot 7 (Read-Only) .currentChar // Currently logged in character (if any) (Read-Only) .lastIP // Last IP used to connect to account (Read-Only) // Flag shortcuts .isBanned // Is account banned? .isSuspended // Is account suspended? .isPublic // Is comment/contact info to be considered public info? .isOnline // Is account online? .isSlot1Blocked // Is character slot 1 blocked? .isSlot2Blocked // Is character slot 2 blocked? .isSlot3Blocked // Is character slot 3 blocked? .isSlot4Blocked // Is character slot 4 blocked? .isSlot5Blocked // Is character slot 5 blocked? .isSlot6Blocked // Is character slot 6 blocked? .isSlot7Blocked // Is character slot 7 blocked? .unused9 // Unused flag .unused10 // Unused flag .isSeer // Is account marked as Seer account? .isCounselor // Is account marked as Counselor account? .isGM // Is account marked as GM account? Fixed 'addaccount command - can now once again be used to add a new user account to the server from in-game. See accounts.adm for info on available flags. Syntax: 'addaccount [username] [password] [(optional)flags] Updated 'get command to allow retrieving certain account properties for targeted player characters: username, flags, comment, character1, character2, character3, character4, character5, character6, character7, lastIP, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor and isGM Updated 'set command to allow setting certain account properties for targeted player characters: comment, password, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor, isGM Updated 'tweak command to allow viewing and modifying of certain account properties for targeted player characters Note that any changes to account properties will not go into effect until a worldsave or manual save of accounts via console has taken place. Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-16 21:14:50 +08:00
if( Commands->NumArguments() > 2 )
{
newFlags = oldstrutil::value<UI16>( Commands->CommandString( 4, 4 ));
}
Fixes for Console behaviour on Linux and Windows, addition of JS properties for user accounts Fixed long-standing issue with UOX3 console not resetting terminal properly after shutdown on Linux, after updating cConsole.cpp/h to conform to standard unix terminal commands/settings for certain features (punt) Fixed an issue that could cause a crash on Windows when attempting to broadcast system messages from the UOX3 console (punt) Fixed an issue that prevented text input in UOX3 console for system broadcasts from being displayed on Linux and MacOS (punt) Added support for new JS Object - IUE_ACCOUNT - which can be accessed via character property .account. The following account properties have been exposed to the JS engine: .id // Account ID (Read-Only) .username // Account Username (Read-Only) .flags // Flags set on account (Read-Only) .comment // Comment/contact info .character1 // Character in account slot 1 (Read-Only) .character2 // Character in account slot 2 (Read-Only) .character3 // Character in account slot 3 (Read-Only) .character4 // Character in account slot 4 (Read-Only) .character5 // Character in account slot 5 (Read-Only) .character6 // Character in account slot 6 (Read-Only) .character7 // Character in account slot 7 (Read-Only) .currentChar // Currently logged in character (if any) (Read-Only) .lastIP // Last IP used to connect to account (Read-Only) // Flag shortcuts .isBanned // Is account banned? .isSuspended // Is account suspended? .isPublic // Is comment/contact info to be considered public info? .isOnline // Is account online? .isSlot1Blocked // Is character slot 1 blocked? .isSlot2Blocked // Is character slot 2 blocked? .isSlot3Blocked // Is character slot 3 blocked? .isSlot4Blocked // Is character slot 4 blocked? .isSlot5Blocked // Is character slot 5 blocked? .isSlot6Blocked // Is character slot 6 blocked? .isSlot7Blocked // Is character slot 7 blocked? .unused9 // Unused flag .unused10 // Unused flag .isSeer // Is account marked as Seer account? .isCounselor // Is account marked as Counselor account? .isGM // Is account marked as GM account? Fixed 'addaccount command - can now once again be used to add a new user account to the server from in-game. See accounts.adm for info on available flags. Syntax: 'addaccount [username] [password] [(optional)flags] Updated 'get command to allow retrieving certain account properties for targeted player characters: username, flags, comment, character1, character2, character3, character4, character5, character6, character7, lastIP, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor and isGM Updated 'set command to allow setting certain account properties for targeted player characters: comment, password, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor, isGM Updated 'tweak command to allow viewing and modifying of certain account properties for targeted player characters Note that any changes to account properties will not go into effect until a worldsave or manual save of accounts via console has taken place. Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-16 21:14:50 +08:00
if( newUsername == "" || newPassword == "" )
{
s->SysMessage( 9018 ); // Unable to add account, insufficient data provided (syntax: [username] [password] [flags])
return;
Fixes for Console behaviour on Linux and Windows, addition of JS properties for user accounts Fixed long-standing issue with UOX3 console not resetting terminal properly after shutdown on Linux, after updating cConsole.cpp/h to conform to standard unix terminal commands/settings for certain features (punt) Fixed an issue that could cause a crash on Windows when attempting to broadcast system messages from the UOX3 console (punt) Fixed an issue that prevented text input in UOX3 console for system broadcasts from being displayed on Linux and MacOS (punt) Added support for new JS Object - IUE_ACCOUNT - which can be accessed via character property .account. The following account properties have been exposed to the JS engine: .id // Account ID (Read-Only) .username // Account Username (Read-Only) .flags // Flags set on account (Read-Only) .comment // Comment/contact info .character1 // Character in account slot 1 (Read-Only) .character2 // Character in account slot 2 (Read-Only) .character3 // Character in account slot 3 (Read-Only) .character4 // Character in account slot 4 (Read-Only) .character5 // Character in account slot 5 (Read-Only) .character6 // Character in account slot 6 (Read-Only) .character7 // Character in account slot 7 (Read-Only) .currentChar // Currently logged in character (if any) (Read-Only) .lastIP // Last IP used to connect to account (Read-Only) // Flag shortcuts .isBanned // Is account banned? .isSuspended // Is account suspended? .isPublic // Is comment/contact info to be considered public info? .isOnline // Is account online? .isSlot1Blocked // Is character slot 1 blocked? .isSlot2Blocked // Is character slot 2 blocked? .isSlot3Blocked // Is character slot 3 blocked? .isSlot4Blocked // Is character slot 4 blocked? .isSlot5Blocked // Is character slot 5 blocked? .isSlot6Blocked // Is character slot 6 blocked? .isSlot7Blocked // Is character slot 7 blocked? .unused9 // Unused flag .unused10 // Unused flag .isSeer // Is account marked as Seer account? .isCounselor // Is account marked as Counselor account? .isGM // Is account marked as GM account? Fixed 'addaccount command - can now once again be used to add a new user account to the server from in-game. See accounts.adm for info on available flags. Syntax: 'addaccount [username] [password] [(optional)flags] Updated 'get command to allow retrieving certain account properties for targeted player characters: username, flags, comment, character1, character2, character3, character4, character5, character6, character7, lastIP, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor and isGM Updated 'set command to allow setting certain account properties for targeted player characters: comment, password, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor, isGM Updated 'tweak command to allow viewing and modifying of certain account properties for targeted player characters Note that any changes to account properties will not go into effect until a worldsave or manual save of accounts via console has taken place. Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-16 21:14:50 +08:00
}
// ok we need to add the account now. We will rely in the internalaccountscreation system for this
CAccountBlock_st &actbTemp = Accounts->GetAccountByName( newUsername );
Fixes for Console behaviour on Linux and Windows, addition of JS properties for user accounts Fixed long-standing issue with UOX3 console not resetting terminal properly after shutdown on Linux, after updating cConsole.cpp/h to conform to standard unix terminal commands/settings for certain features (punt) Fixed an issue that could cause a crash on Windows when attempting to broadcast system messages from the UOX3 console (punt) Fixed an issue that prevented text input in UOX3 console for system broadcasts from being displayed on Linux and MacOS (punt) Added support for new JS Object - IUE_ACCOUNT - which can be accessed via character property .account. The following account properties have been exposed to the JS engine: .id // Account ID (Read-Only) .username // Account Username (Read-Only) .flags // Flags set on account (Read-Only) .comment // Comment/contact info .character1 // Character in account slot 1 (Read-Only) .character2 // Character in account slot 2 (Read-Only) .character3 // Character in account slot 3 (Read-Only) .character4 // Character in account slot 4 (Read-Only) .character5 // Character in account slot 5 (Read-Only) .character6 // Character in account slot 6 (Read-Only) .character7 // Character in account slot 7 (Read-Only) .currentChar // Currently logged in character (if any) (Read-Only) .lastIP // Last IP used to connect to account (Read-Only) // Flag shortcuts .isBanned // Is account banned? .isSuspended // Is account suspended? .isPublic // Is comment/contact info to be considered public info? .isOnline // Is account online? .isSlot1Blocked // Is character slot 1 blocked? .isSlot2Blocked // Is character slot 2 blocked? .isSlot3Blocked // Is character slot 3 blocked? .isSlot4Blocked // Is character slot 4 blocked? .isSlot5Blocked // Is character slot 5 blocked? .isSlot6Blocked // Is character slot 6 blocked? .isSlot7Blocked // Is character slot 7 blocked? .unused9 // Unused flag .unused10 // Unused flag .isSeer // Is account marked as Seer account? .isCounselor // Is account marked as Counselor account? .isGM // Is account marked as GM account? Fixed 'addaccount command - can now once again be used to add a new user account to the server from in-game. See accounts.adm for info on available flags. Syntax: 'addaccount [username] [password] [(optional)flags] Updated 'get command to allow retrieving certain account properties for targeted player characters: username, flags, comment, character1, character2, character3, character4, character5, character6, character7, lastIP, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor and isGM Updated 'set command to allow setting certain account properties for targeted player characters: comment, password, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor, isGM Updated 'tweak command to allow viewing and modifying of certain account properties for targeted player characters Note that any changes to account properties will not go into effect until a worldsave or manual save of accounts via console has taken place. Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-16 21:14:50 +08:00
if( actbTemp.wAccountIndex == AB_INVALID_ID )
{
Fixes for Console behaviour on Linux and Windows, addition of JS properties for user accounts Fixed long-standing issue with UOX3 console not resetting terminal properly after shutdown on Linux, after updating cConsole.cpp/h to conform to standard unix terminal commands/settings for certain features (punt) Fixed an issue that could cause a crash on Windows when attempting to broadcast system messages from the UOX3 console (punt) Fixed an issue that prevented text input in UOX3 console for system broadcasts from being displayed on Linux and MacOS (punt) Added support for new JS Object - IUE_ACCOUNT - which can be accessed via character property .account. The following account properties have been exposed to the JS engine: .id // Account ID (Read-Only) .username // Account Username (Read-Only) .flags // Flags set on account (Read-Only) .comment // Comment/contact info .character1 // Character in account slot 1 (Read-Only) .character2 // Character in account slot 2 (Read-Only) .character3 // Character in account slot 3 (Read-Only) .character4 // Character in account slot 4 (Read-Only) .character5 // Character in account slot 5 (Read-Only) .character6 // Character in account slot 6 (Read-Only) .character7 // Character in account slot 7 (Read-Only) .currentChar // Currently logged in character (if any) (Read-Only) .lastIP // Last IP used to connect to account (Read-Only) // Flag shortcuts .isBanned // Is account banned? .isSuspended // Is account suspended? .isPublic // Is comment/contact info to be considered public info? .isOnline // Is account online? .isSlot1Blocked // Is character slot 1 blocked? .isSlot2Blocked // Is character slot 2 blocked? .isSlot3Blocked // Is character slot 3 blocked? .isSlot4Blocked // Is character slot 4 blocked? .isSlot5Blocked // Is character slot 5 blocked? .isSlot6Blocked // Is character slot 6 blocked? .isSlot7Blocked // Is character slot 7 blocked? .unused9 // Unused flag .unused10 // Unused flag .isSeer // Is account marked as Seer account? .isCounselor // Is account marked as Counselor account? .isGM // Is account marked as GM account? Fixed 'addaccount command - can now once again be used to add a new user account to the server from in-game. See accounts.adm for info on available flags. Syntax: 'addaccount [username] [password] [(optional)flags] Updated 'get command to allow retrieving certain account properties for targeted player characters: username, flags, comment, character1, character2, character3, character4, character5, character6, character7, lastIP, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor and isGM Updated 'set command to allow setting certain account properties for targeted player characters: comment, password, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor, isGM Updated 'tweak command to allow viewing and modifying of certain account properties for targeted player characters Note that any changes to account properties will not go into effect until a worldsave or manual save of accounts via console has taken place. Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-16 21:14:50 +08:00
Accounts->AddAccount( newUsername, newPassword, "NA", newFlags );
Console << "o Account added ingame: " << newUsername << ":" << newPassword << ":" << newFlags << myendl;
s->SysMessage( 9019, newUsername.c_str(), newPassword.c_str(), newFlags ); // Account Added: %s:%s:%i
}
else
{
Fixes for Console behaviour on Linux and Windows, addition of JS properties for user accounts Fixed long-standing issue with UOX3 console not resetting terminal properly after shutdown on Linux, after updating cConsole.cpp/h to conform to standard unix terminal commands/settings for certain features (punt) Fixed an issue that could cause a crash on Windows when attempting to broadcast system messages from the UOX3 console (punt) Fixed an issue that prevented text input in UOX3 console for system broadcasts from being displayed on Linux and MacOS (punt) Added support for new JS Object - IUE_ACCOUNT - which can be accessed via character property .account. The following account properties have been exposed to the JS engine: .id // Account ID (Read-Only) .username // Account Username (Read-Only) .flags // Flags set on account (Read-Only) .comment // Comment/contact info .character1 // Character in account slot 1 (Read-Only) .character2 // Character in account slot 2 (Read-Only) .character3 // Character in account slot 3 (Read-Only) .character4 // Character in account slot 4 (Read-Only) .character5 // Character in account slot 5 (Read-Only) .character6 // Character in account slot 6 (Read-Only) .character7 // Character in account slot 7 (Read-Only) .currentChar // Currently logged in character (if any) (Read-Only) .lastIP // Last IP used to connect to account (Read-Only) // Flag shortcuts .isBanned // Is account banned? .isSuspended // Is account suspended? .isPublic // Is comment/contact info to be considered public info? .isOnline // Is account online? .isSlot1Blocked // Is character slot 1 blocked? .isSlot2Blocked // Is character slot 2 blocked? .isSlot3Blocked // Is character slot 3 blocked? .isSlot4Blocked // Is character slot 4 blocked? .isSlot5Blocked // Is character slot 5 blocked? .isSlot6Blocked // Is character slot 6 blocked? .isSlot7Blocked // Is character slot 7 blocked? .unused9 // Unused flag .unused10 // Unused flag .isSeer // Is account marked as Seer account? .isCounselor // Is account marked as Counselor account? .isGM // Is account marked as GM account? Fixed 'addaccount command - can now once again be used to add a new user account to the server from in-game. See accounts.adm for info on available flags. Syntax: 'addaccount [username] [password] [(optional)flags] Updated 'get command to allow retrieving certain account properties for targeted player characters: username, flags, comment, character1, character2, character3, character4, character5, character6, character7, lastIP, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor and isGM Updated 'set command to allow setting certain account properties for targeted player characters: comment, password, isBanned, isSuspended, isPublic, isOnline, isSlot1Blocked, isSlot2Blocked, isSlot3Blocked, isSlot4Blocked, isSlot5Blocked, isSlot6Blocked, isSlot7Blocked, unused9, unused10, isSeer, isCounselor, isGM Updated 'tweak command to allow viewing and modifying of certain account properties for targeted player characters Note that any changes to account properties will not go into effect until a worldsave or manual save of accounts via console has taken place. Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-16 21:14:50 +08:00
Console << "o Account was not added, an account with that username already exists!" << myendl;
s->SysMessage( 9020 ); // Account not added, an account with that username already exists!
}
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_GetLight()
//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 - Displays current in-game light level as a system message
//o------------------------------------------------------------------------------------------------o
//| Notes - Needs redoing to support new (weather-based) lighting system
//o------------------------------------------------------------------------------------------------o
void Command_GetLight( CSocket *s )
{
VALIDATESOCKET( s );
CChar *mChar = s->CurrcharObj();
if( !ValidateObject( mChar ))
return;
CTownRegion *tRegion = mChar->GetRegion();
UI16 weatherId = tRegion->GetWeather();
CWeather *sys = Weather->Weather( weatherId );
2021-06-12 07:30:23 -04:00
if( sys != nullptr )
{
const R32 lightMin = sys->LightMin();
const R32 lightMax = sys->LightMax();
if( lightMin < 300 && lightMax < 300 )
{
R32 i = sys->CurrentLight();
if( Races->VisLevel( mChar->GetRace() ) > i )
{
s->SysMessage( 1632, 0 ); // Current light level is %i
}
else
{
0.99.6-RC6x Added dummy context restore function to additional scripts Updated 'go command to support specifying location to teleport to by name, mapped to locations from locations.dfn (Thanks Dragon Slayer!) Updated Smart Turn script for furniture (js/server/misc/furniture_smartturn.js) with more optimized code (Humility) Fixed latitude/longitude output of GetMapCoordinates helper function (js/server/data/map_coordinates.js), and updated scripts that relied on it Fixed an issue where trying to craft fletching tools would produce hatchets instead (js/skill/craft/fletching.js) Updated js/item/bankcheck.js to display value of checks using onTooltip JS Event, or onNameRequest JS Event if tooltips are disabled Fixed a couple of DFN formatting issues (thanks, punt) Fixed an issue where blank deeds (and bank checks) would be pileable if dropped on the same container (dfndata/items/tools/inscription.dfn) Added dedicated [bankcheck] DFN item (dfndata/items/misc/money.dfn) Updated Banker AI script (js/npc/ai/banker.js) to use dedicated [bankcheck] item instead of blank deeds as base for bank checks, and to have banker NPCs pause and turn towards player when talked to Fixed an issue with script for Healing/Veterinary (js/skill/healing.js) which incorrectly used Anatomy as supplementary skill for Veterinary instead of Animal Lore, and which checked dex of wrong character when calculating healing slips Added two missing tile flags to tileflag enum that threw order of such flags added with HS expansion out of order (thanks, punt) Fixed an issue with travel-commands in GM menu which handled travelling between facets incorrectly Added region spawners for dungeons, towns and overworld in Ilshenar facet Enabled Trammel and Ilshenar facet decorations/spawns by default in admin welcome script (js/server/misc/admin_welcome.js) Reworked portions of admin welcome gump to display optional "addon" decorations per facet, which might be client/era-specific (js/server/misc/admin_welcome.js) Added new NPCs to dfndata/npc/femalehuman.dfn: f_executioner, f_chaosdragoon, f_chaosdragoonelite, f_gypsybanker Added new NPCs to dfndata/npc/femalevendors.dfn: f_gypsymaiden, f_gypsyanimaltrainer, f_gypsyfortuneteller, f_vagabond, f_ironworker Added new NPCs to dfndata/npc/malehuman.dfn: m_executioner, m_chaosdragoon, m_chaosdragoonelite, m_gypsybanker Added new NPCs to dfndata/npc/malevendors.dfn: m_gypsyanimaltrainer, m_vagabond, m_ironworker Added new NPC to dfndata/npc/miscmonsters.dfn: darkwisp Added new NPC to dfndata/npc/undead.dfn: ancientlich Added new Item DFNs for "camps" that when spawned will create a camp with specific decorations ([ilsh_orc_camp], [ilsh_healer_camp], [ilsh_mage_camp], [ilsh_banker_camp]) Added scripts for camps (js/item/camps/ilsh_banker_camp.js, js/item/camps/ilsh_healer_camp.js, js/item/camps/ilsh_mage_camp.js, js/item/camps/ilsh_orc_camp.js) Added new colorlist to dfndata/colors/colors.dfn: [RANDOMCOLOR 33] (Bright Primary Colors) Fixed an issue with gargish cloth chest DFN which prevented LBR version from working properly (dfndata/items/gear/armor/gargish_armor/gargish_cloth.dfn) Added a bunch of new NPCLISTS in various npclist DFN files to support regional spawns in Ilshenar Added missing BACKPACK tag to [golem] NPC DFN (dfndata/npc/clockwork.dfn) Fixed misspelled section header for Fire Elemental NPC - from firele to fireele (dfndata/npc/elementals.dfn) Murderous brigand NPCs are no longer willing to teach players skills (dfndata/npc/femalehuman.dfn, dfndata/npc/malehuman.dfn) Corrected coordinates of Rock Dungeon region (dfndata/regions/regions.dfn) Added regions for Sea Market (Felucca/Trammel), Blackthorn Dungeon (Felucca/Trammel) and Lakeshire (Ilshenar) (dfndata/regions/regions.dfn) Fixed an issue with 'radditem and 'raddspawner GM commands which would not correctly set the Z of the added item/spawner to match target location (js/commands/custom/repeatingcmds.js) Added two new repeating commands (js/commands/custom/repeatingcmds.js): 'rmovable # // Repeats bringing up targeting cursor to set movable property on multiple objects 'rnodecay // Repeats bringing up targeting cursor to set decayable property to false on multiple objects Added new areacommand (js/commands/targeting/areacommand.js): 'areacommand name [string] // Sets name of all objects within targeted area to [string] Updated 'decorate command script to better handle flags passed in via admin welcome script for things like facet addons (js/commands/decorate.js) Updated fire breath script (js/npc/special/fire_breath.js) to get fire breath info per NPC based on their sectionID rather than their base body ID Updated facet ruleset script (js/server/misc/facetRuleset.js) with an override for GMs trying to snoop players even in places where snooping is disallowed Updated facet ruleset script (js/server/misc/facetRuleset.js) to allow damage that's not coming from a player/NPC source even in Trammel/Ilshenar Added teleport locations for entering/leaving Blackthorn Dungeon in Felucca/Trammel (js/teleport.scp) Updated 'remove and 'rremove commands to release any targeted objects from potential multis they are locked in to properly update lockdown count (js/commands/targeting/remove.js, js/commands/custom/repeatingcmds.js) Updated felucca/ilshenar world templates with decorations (js/jsdata/worldtemplates/felucca_*/ilshenar_*) Added world templates with decorations for Trammel (js/jsdata/worldtemplates/trammel_*) Added DFN entry for Power Generators, and spawn entries for these in Ilshenar (dfndata/item/puzzles/puzzles.dfn, dfndata/spawn/ilshenar/spawn_ilshenar_world_general.dfn) Added script for Power Generators, which initializes random puzzles on creation and rewards player with diamonds/arcane gems/shadow iron ore when solved, or lightning when failing to solve (js/item/power_generator.js) Added support for overriding newbie-state of items added to players via dfndata/newbie/newbie.dfn. Supported syntax: PACKITEM=sectionID[, amount[, newbieFlag]] // To use newbieFlag with PACKITEM, amount must also be specified. Flag can be 0/1 EQUIPITEM=sectionID[, itemHue[, newbieFlag] // To use newbieFlag with EQUIPITEM, itemHue must also be specified. Flag can be 0/1 Casting the Earthquake spell will no longer affect the caster, or cause them to become criminal when cast out of town with no impacted targets Fixed a bug where caster would remain frozen after finishing casting targetless spells like Earthquake Fixed a bug where caster would remain frozen if spellcast was cancelled half-ways through by picking up or equipping an item Fixed a bug where caster would remain frozen if spellcast was interrupted by losing concentration from taking melee damage in combat Fixed a bug where a paralyzed player would remain frozen even if taking magic or poison damage, which releases them from paralyzis Fixed a bug where target of Paralyze spell would not visually be shown as frozen in target's client Fixed a bug where a caster frozen while casting a spell could become unfrozen mid-cast because of incoming magic damage Address overflow issue in MultiMul.cpp (punt) Address various cast issues (punt) Corrected jscript project, to not include two files that where for stand alone programs (and resulted in main being added twice in the library (and once was incorrect all ready). (punt) Replaced RoundNumber with std::round (punt) The original physical appearance of characters targeted by 'make admin/gm/cns is now kept track of, and restored upon being targeted by 'make player Fixed an issue where the .HasSpell JS Method was off by 1 when looking for specific spells in player's spellbook, due to 0-based array indexing in code vs 1-based indexing for Spells in DFNs
2023-10-14 05:03:53 +08:00
s->SysMessage( 1632, static_cast<LIGHTLEVEL>(std::round( i - Races->VisLevel( mChar->GetRace() )))); // Current light level is %i
}
}
else
{
s->SysMessage( 1632, cwmWorldState->ServerData()->WorldLightCurrentLevel() ); // Current light level is %i
}
}
else
{
s->SysMessage( 1632, cwmWorldState->ServerData()->WorldLightCurrentLevel() ); // Current light level is %i
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_SetPost()
//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 - Sets bulletin board posting mode for user
//o------------------------------------------------------------------------------------------------o
void Command_SetPost( CSocket *s )
{
VALIDATESOCKET( s );
CChar *mChar = s->CurrcharObj();
if( !ValidateObject( mChar ))
return;
PostTypes type = PT_LOCAL;
std::string upperCommand = oldstrutil::upper( Commands->CommandString( 2, 2 ));
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( upperCommand == "GLOBAL" ) // user's next post appears in ALL bulletin boards
{
type = PT_GLOBAL;
}
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( upperCommand == "REGIONAL" ) // user's next post appears in all bulletin boards in current region
{
type = PT_REGIONAL;
}
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( upperCommand == "LOCAL" ) // user's next post appears only locally in the next bulletin board used
{
type = PT_LOCAL;
}
mChar->SetPostType( static_cast<UI08>( type ));
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
switch ( type )
{
case PT_LOCAL: s->SysMessage( 726 ); break; // Post type set to LOCAL.
case PT_REGIONAL: s->SysMessage( 727 ); break; // Post type set to REGION
case PT_GLOBAL: s->SysMessage( 728 ); break; // Post type set to GLOBAL.
default: s->SysMessage( 725 ); break; // Invalid post type.
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_GetPost()
//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 - Returns current bulletin board posting mode for user
//o------------------------------------------------------------------------------------------------o
void Command_GetPost( CSocket *s )
{
VALIDATESOCKET( s );
CChar *mChar = s->CurrcharObj();
if( !ValidateObject( mChar ))
return;
switch( mChar->GetPostType() )
{
case PT_LOCAL: s->SysMessage( 722 ); break; // Currently posting LOCAL messages.
case PT_REGIONAL: s->SysMessage( 723 ); break; // Currently posting REGIONAL messages.
case PT_GLOBAL: s->SysMessage( 724 ); break; // Currently posting GLOBAL messages.
default: s->SysMessage( 725 ); break; // Invalid post type.
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_ShowIds()
//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 - Display the serial number of every item on user's screen
//o------------------------------------------------------------------------------------------------o
auto Command_ShowIds( CSocket *s ) -> void
{
VALIDATESOCKET( s );
CChar *mChar = s->CurrcharObj();
CMapRegion *Cell = MapRegion->GetMapRegion( mChar );
if( Cell )
{
auto regChars = Cell->GetCharList();
for( auto &toShow : regChars->collection() )
{
if( ValidateObject( toShow ))
{
if( CharInRange( mChar, toShow ))
{
s->ShowCharName( toShow, true );
}
}
}
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Tile()
//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 - (h) Tiles the item specified over a square area.
//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
//| Notes - To find the hexidecimal ID code for an item to tile,
//| either create the item with /add or find it in the
//| world, and get /ISTATS on the object to get its ID code.
//o------------------------------------------------------------------------------------------------o
void Command_Tile( CSocket *s )
{
VALIDATESOCKET( s );
if( Commands->NumArguments() == 0 )
return;
UI16 targId = 0;
if( oldstrutil::upper( Commands->CommandString( 2, 2 )) == "STATIC" )
{
targId = static_cast<UI16>( Commands->Argument( 2 ));
}
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
else
{
targId = static_cast<UI16>( Commands->Argument( 1 ));
}
// Reset tempint2 on socket
s->TempInt2( 0 );
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
if( Commands->NumArguments() == 7 || Commands->NumArguments() == 8 )
{
// tile itemId x1 y1 x2 y2 z rndVal
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
SI32 rndVal = 0;
UI16 rndId = 0;
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
if( Commands->NumArguments() == 8 )
{
rndVal = static_cast<SI32>( Commands->Argument( 7 ));
}
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
// tile itemId x1 y1 x2 y2 z
SI16 x1 = static_cast<SI16>( Commands->Argument( 2 ));
SI16 x2 = static_cast<SI16>( Commands->Argument( 3 ));
SI16 y1 = static_cast<SI16>( Commands->Argument( 4 ));
SI16 y2 = static_cast<SI16>( Commands->Argument( 5 ));
SI08 z = static_cast<SI08>( Commands->Argument( 6 ));
for( SI16 x = x1; x <= x2; ++x )
{
for( SI16 y = y1; y <= y2; ++y )
{
rndId = targId + RandomNum( static_cast<UI16>( 0 ), static_cast<UI16>( rndVal ));
CItem *a = Items->CreateItem( nullptr, s->CurrcharObj(), rndId, 1, 0, OT_ITEM );
if( ValidateObject( a )) // crash prevention
{
a->SetLocation( x, y, z );
a->SetDecayable( false );
}
}
}
}
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
else if( Commands->NumArguments() == 4 )
{
// tile static itemId rndVal
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
s->ClickX( -1 );
s->ClickY( -1 );
s->TempInt2( static_cast<SI32>( Commands->Argument( 3 )));
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
s->AddId1( static_cast<UI08>( targId >> 8 ));
s->AddId2( static_cast<UI08>( targId % 256 ));
s->SendTargetCursor( 0, TARGET_TILING, 0, 24 );
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
}
else if( Commands->NumArguments() == 3 )
{
// tile itemId rndVal
// tile static itemId
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
s->ClickX( -1 );
s->ClickY( -1 );
if( oldstrutil::upper( Commands->CommandString( 2, 2 )) != "STATIC" )
{
s->TempInt2( static_cast<SI32>( Commands->Argument( 2 )));
}
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
s->AddId1( static_cast<UI08>( targId >> 8 ));
s->AddId2( static_cast<UI08>( targId % 256 ));
s->SendTargetCursor( 0, TARGET_TILING, 0, 24 );
0.99.4d Added new option in UOX.INI under [settings] section: MAPDIFFSENABLED=0/1 // If enabled, server will attempt to load diff files, and send "Enable Map-diff files" packet to client to also load these. Disabled by default. Server no longer loads map/statics diff files by default, nor does it send packet to client to request loading these files, as only client versions below 7.0.8.2 will actively load these files. Can be re-enabled with new UOX.INI setting mentioned above! Fixed incorrect ID for gargish dagger in CHandleCombat::getWeaponType() Added missing weapon entries in CHandleCombat::getWeaponType(): bladed whip, barbed whip, spiked whip, gargish talwar Fixed an issue that would show the end part of some tiledata names as garbled text instead of cutting off the text(!) at 20 characters Fixed an issue with advanced character creation template when using ClassicUO client, which sends a profession value of 255 instead of 0 when no profession template has been selected. Fixed an issue where clones of NPCs that can split in combat didn't get the NPC flag correctly set Guild titles are now removed for players who leave their guilds Enabled closing some hard-coded gump menus using right-click (howto, guild, towns, wholist, addmenu, craftmenu, info) Fixed an issue where adding base items using 'add [itemID] would sometimes get false positive hits from harditems.dfn, depending on the length of the itemID Fixed an issue where items added using 'add [itemID] would not get names applied properly from harditems.dfn Item/NPC DFN tag GET can now inherit a random parent by adding additional values separated by spaces. Syntax: GET=parent1 parent2 parent3 (etc) Fixed an issue where NPC backpacks would not have the max item capacity set properly Added new properties for CItem objects (also exposed as JS Item Properties): maxRange // max distance a ranged weapon can fire at (replaces ARCHERRANGE ini setting) baseRange // base distance throwing weapons (when implemented) can be used at Added support for new Item DFN tag that replaces global UOX.INI setting ARCHERRANGE: MAXRANGE=# // Specifies max range of ranged weapon Added support for new Item/NPC DFN tags to support randomizing elemental resistances: RESISTFIRE=#/# # // Set NPC's poison resistance; fixed or random value RESISTCOLD=#/# # // Set NPC's poison resistance; fixed or random value RESISTLIGHTNING=#/# # // Set NPC's poison resistance; fixed or random value RESISTPOISON=#/# # // Set NPC's poison resistance; fixed or random value Added support for two new DFN tags in dfndata/race/races.dfn that can be used to allow/ban lists of equipment for specific races ALLOWEQUIPLIST=# BANEQUIPLIST=# Added support for new section in dfndata/race/races.dfn - [EQUIPLIST #], which can be used to define lists of equipment that is whitelisted or banned for specific races. Fixed a bug that would report incorrect weight in tooltips for Item/NPC spawner objects ScriptSections are now reapplied for items bought by players from NPC vendors Fixed an issue where players could drop an item on the ground and other players would still see the item after it was picked up, because of a failed distance check vs old location coordinates (in pack) instead of vs current location on ground Fixed a bug with players being able to use last-target macro to target objects picked up and held by other players on their cursor Updated all references to "devinelock" to be "divinelock" instead - this includes the name of the JS Item property Fixed house commands triggering (useless) targeting cursors for players onboard boats Changed default statcap in UOX.INI from 325 to 225 Fixed a out-of-range error for players attempting to combine ore inside their own backpack Fixed various issues with distance checks and container checks when using/target objects Added optional 4th "hue" parameter to AddGump JS method Added JS Function to get total amount of accounts on server - GetAccountCount() Added JS Function to get total amount of players online - GetPlayerCount() onSwing JS Event can now trigger in scripts attached to items, not just items attached to characters Added some JS Functions to expose some hard-coded constants to JS scripts: BASEITEMSERIAL() // Base item serial INVALIDSERIAL() // Invalid serial INVALIDID() // Invalid ID INVALIDCOLOUR() // Invalid colour Fixed an issue where JS character property .colour would modify origSkin property instead of colour Fixed an issue where JS character property .guildTitle returned the name of the character instead of the guild title Character JS property .poison can now also be used to set a character's poisoned level, not just read it Exposed Item property to JS engine: .ac // armour class for item (0-128). Primarily used for setting race-restrictions for equippable items, i.e. race X cannot equip items of armour class Y. .def // defensive value of item (Physical resistance post-AoS, AR in older UO) // NOTE: The following properties don't actually do anything yet, but can still be used in custom JS scripts if desired .resistCold // Cold resistance of item 0-1000, where 1000 equals 100.0% .resistHeat // Heat/Fire resistance of item 0-1000, where 1000 equals 100.0% .resistLight // Light resistance of item 0-1000, where 1000 equals 100.0% .resistLightning // Energy/Lightning resistance of item 0-1000, where 1000 equals 100.0% .resistPoison // Poison resistance of item 0-1000, where 1000 equals 100.0% .resistRain // Rain resistance of item 0-1000, where 1000 equals 100.0% .resistSnow // Snow resistance of item 0-1000, where 1000 equals 100.0% .damageHeat // Weapon deals Heat/Fire elemental damage (true/false) .damageCold // Weapon deals Cold elemental damage (true/false) .damageLight // Weapon deals Light elemental damage (true/false) .damageLightning // Weapon deals Lightning elemental damage (true/false) .damagePoison // Weapon deals Poison elemental damage (true/false) .damageRain // Weapon deals Rain/Water elemental damage (true/false) .damageSnow // Weapon deals Snow/Ice elemental damage (true/false) Added new UOX.INI setting under [server] to enable/disable shard response to ConnectUO server polling (disabled by default) Sub-commands are no longer included when registering packets to be overloaded via RegisterPacket function, as that part was never fully implemented. Packet-hook scripts can be setup for specific packet IDs, but any sub-command checking will need to be done in the script itself JS Packet Method GetDWord() now uses JS_NewNumberValue instead of INT_TO_JSVAL to read from the socket buffer, to better handle large numbers, which could previously be returned with wrong values. JS Function CalcItemFromSer() now uses a JS_GetStringBytes() and str_value() combo instead of JSVAL_TO_INT() to read the data provided in the function argument. This allows JS scripts to provide item serials to the function directly without needing to split it into four parts first (though that still works) Fixed issue where JS properties for multis didn't always return correct values The 'set command can now be used to set the armour class of items ('set ac #) Reimplemented 'tweak command in JS engine (js/commands/targeting/tweak.js) - can be used to view and modify properties of characters, character skills, items, multis and regions (target ground) Added placeholder packet-hook script (js/server/network/0xf1_connectUoServerPoll.js) to handle responses to ConnectUO server polling. By default this script does nothing, but serves as a placeholder for drop-in replacement scripts generated specifically for each shard by the ConnectUO service. Updated some commands to support an alternate STATIC keyword (can also be ommitted) to add base items: 'add static itemID 'tile static itemID Updated some commands with support for randomization. Provided itemID will be randomized based on provided rndValue: /js/commands/targeting/add.js: 'add itemID rndValue cmdtable.cpp and targeting.cpp: 'tile itemID rndValue 'tile itemID x1 x2 y1 y2 z rndValue Updated js/commands/custom/repeatingcmds.js to support 'm delete as an alias for 'rremove Added 'props as an alias for the 'tweak command Added 'teleport as an alias for the 'tele command (js/commands/targeting/tele.js) Added 'shavehair and 'shavebeard as aliases for 'kill hair and 'kill beard (js/commands/targeting/kill.js) Added 'noinvul and 'mortal aliases for the 'invul false command (js/commands/custom/misc-cmds.js) Added 'immortal and 'invul (without parameter) as aliases for the 'invul true command Added 'bringtopack as an alias of 'movetobag command (js/commands/targeting/movetobag.js) Updated check for cancelling of target cursor in various JS scripts Minor updates to various JS scripts Fixed issue where some item definitions in dfndata/harditems/harditems.dfn and dfndata/items/building/lighting.dfn used comma instead of space as delimiter for the VALUE tag, which thus never got applied Updated all NPC definitions to let NPCs spawn facing in random directions
2021-03-22 05:59:20 +08:00
}
else if( Commands->NumArguments() == 2 )
{
// tile itemId
s->ClickX( -1 );
s->ClickY( -1 );
s->AddId1( static_cast<UI08>( targId >> 8 ));
s->AddId2( static_cast<UI08>( targId % 256 ));
s->SendTargetCursor( 0, TARGET_TILING, 0, 24 );
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Save()
//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 - Saves the current world data into .WSC files
//o------------------------------------------------------------------------------------------------o
void Command_Save( void )
{
if( cwmWorldState->GetWorldSaveProgress() != SS_SAVING )
{
cwmWorldState->SaveNewWorld( true );
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Dye()
//o------------------------------------------------------------------------------------------------o
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
//| Purpose - (h h/nothing) Dyes an item a specific color, or brings up
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
//| a dyeing menu if no color is specified.
//o------------------------------------------------------------------------------------------------o
void Command_Dye( CSocket *s )
{
VALIDATESOCKET( s );
s->DyeAll( 1 );
if( Commands->NumArguments() == 2 )
{
UI16 tNum = static_cast<SI16>( Commands->Argument( 1 ));
s->AddId1( static_cast<UI08>( tNum >> 8 ));
s->AddId2( static_cast<UI08>( tNum % 256 ));
}
else if( Commands->NumArguments() == 3 )
{
s->AddId1( static_cast<UI08>( Commands->Argument( 1 )));
s->AddId2( static_cast<UI08>( Commands->Argument( 2 )));
}
else
{
s->AddId1( 0xFF );
s->AddId2( 0xFF );
}
s->SendTargetCursor( 0, TARGET_DYE, 0, 31 );
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_SetTime()
//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 - (d d) Sets the current UO time in hours and minutes.
//o------------------------------------------------------------------------------------------------o
void Command_SetTime( void )
{
if( Commands->NumArguments() == 3 )
{
UI08 newhours = static_cast<UI08>( Commands->Argument( 1 ));
UI08 newminutes = static_cast<UI08>( Commands->Argument( 2 ));
if(( newhours < 25 ) && ( newhours > 0 ) && ( newminutes < 60 ))
{
cwmWorldState->ServerData()->ServerTimeAMPM(( newhours > 12 ));
if( newhours > 12 )
{
cwmWorldState->ServerData()->ServerTimeHours( static_cast<UI08>( newhours - 12 ));
}
else
{
cwmWorldState->ServerData()->ServerTimeHours( newhours );
}
cwmWorldState->ServerData()->ServerTimeMinutes( newminutes );
}
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Shutdown()
//o------------------------------------------------------------------------------------------------o
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
//| Purpose - (d) Shuts down the server. Argument is how many minutes
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
//| until shutdown.
//o------------------------------------------------------------------------------------------------o
void Command_Shutdown( void )
{
if( Commands->NumArguments() == 2 )
{
cwmWorldState->SetEndTime( BuildTimeValue( static_cast<R64>( Commands->Argument( 1 ))));
if( Commands->Argument( 1 ) == 0 )
{
cwmWorldState->SetEndTime( 0 );
SysBroadcast( Dictionary->GetEntry( 36 ));
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
}
else
{
EndMessage( 0 );
}
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Tell()
//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 - (d text) Sends an anonymous message to the user logged in under the specified slot.
//o------------------------------------------------------------------------------------------------o
void Command_Tell( CSocket *s )
{
VALIDATESOCKET( s );
if( Commands->NumArguments() > 2 )
{
CSocket *i = Network->GetSockPtr( Commands->Argument( 1 ));
std::string txt = Commands->CommandString( 3 );
2021-06-12 07:30:23 -04:00
if( i == nullptr || txt.empty() )
return;
CChar *mChar = i->CurrcharObj();
CChar *tChar = s->CurrcharObj();
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 temp = mChar->GetNameRequest( tChar, 0 ) + " tells " + tChar->GetNameRequest( mChar, NRS_SPEECH ) + ": " + txt;
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
if( cwmWorldState->ServerData()->UseUnicodeMessages() )
{
CPUnicodeMessage unicodeMessage;
unicodeMessage.Message( temp );
unicodeMessage.Font( static_cast<FontType>( mChar->GetFontType() ));
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
if( mChar->GetSayColour() == 0x1700 )
{
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
unicodeMessage.Colour( 0x5A );
}
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
else if( mChar->GetSayColour() == 0x0 )
{
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
unicodeMessage.Colour( 0x5A );
}
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
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
unicodeMessage.Colour( mChar->GetSayColour() );
}
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
unicodeMessage.Type( TALK );
unicodeMessage.Language( "ENG" );
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
unicodeMessage.Name( mChar->GetNameRequest( tChar, 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
unicodeMessage.ID( INVALIDID );
unicodeMessage.Serial( mChar->GetSerial() );
s->Send( &unicodeMessage );
}
else
{
CSpeechEntry& toAdd = SpeechSys->Add();
toAdd.Font( static_cast<FontType>( mChar->GetFontType() ));
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.Speech( temp );
toAdd.Speaker( mChar->GetSerial() );
toAdd.SpokenTo( tChar->GetSerial() );
toAdd.Type( TALK );
toAdd.At( cwmWorldState->GetUICurrentTime() );
toAdd.TargType( SPTRG_INDIVIDUAL );
if( mChar->GetSayColour() == 0x1700 )
{
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.Colour( 0x5A );
}
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
else if( mChar->GetSayColour() == 0x0 )
{
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.Colour( 0x5A );
}
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
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
toAdd.Colour( mChar->GetSayColour() );
}
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
}
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_GmMenu()
//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 - (d) Opens the specified GM Menu from dfndata/menus.dfn
//o------------------------------------------------------------------------------------------------o
void Command_GmMenu( CSocket *s )
{
VALIDATESOCKET( s );
if( Commands->NumArguments() == 2 )
{
CPIHelpRequest toHandle( s, static_cast<UI16>( Commands->Argument( 1 )));
toHandle.Handle();
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Command()
//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 - Executes a trigger scripting command.
//o------------------------------------------------------------------------------------------------o
void Command_Command( CSocket *s )
{
VALIDATESOCKET( s );
if( Commands->NumArguments() > 1 )
{
HandleGumpCommand( s, oldstrutil::upper( Commands->CommandString( 2, 2 )), oldstrutil::upper( Commands->CommandString( 3 )));
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_MemStats()
//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 - Display some information about cache and memory usage.
//o------------------------------------------------------------------------------------------------o
void Command_MemStats( CSocket *s )
{
VALIDATESOCKET( s );
size_t charsSize = ObjectFactory::GetSingleton().SizeOfObjects( OT_CHAR );
size_t itemsSize = ObjectFactory::GetSingleton().SizeOfObjects( OT_ITEM );
size_t spellsSize = 69 * sizeof( CSpellInfo );
size_t teffectsSize = sizeof( CTEffect ) * cwmWorldState->tempEffects.Num();
size_t regionsSize = sizeof( CTownRegion ) * cwmWorldState->townRegions.size();
size_t spawnregionsSize = sizeof( CSpawnRegion ) * cwmWorldState->spawnRegions.size();
size_t total = charsSize + itemsSize + spellsSize + regionsSize + spawnregionsSize + teffectsSize;
CGumpDisplay cacheStats( s, 350, 345 );
cacheStats.SetTitle( "UOX Memory Information (sizes in bytes)" );
cacheStats.AddData( "Total Memory Usage: ", static_cast<UI32>( total ));
cacheStats.AddData( " Characters: ", ObjectFactory::GetSingleton().CountOfObjects( OT_CHAR ));
cacheStats.AddData( " Allocated Memory: ", static_cast<UI32>( charsSize ));
cacheStats.AddData( " CChar: ", sizeof( CChar ));
cacheStats.AddData( " Items: ", ObjectFactory::GetSingleton().CountOfObjects( OT_ITEM ));
cacheStats.AddData( " Allocated Memory: ", static_cast<UI32>( itemsSize ));
cacheStats.AddData( " CItem: ", sizeof( CItem ));
cacheStats.AddData( " Spells Size: ", static_cast<UI32>( spellsSize ));
cacheStats.AddData( " TEffects: ", static_cast<UI32>( cwmWorldState->tempEffects.Num() ));
cacheStats.AddData( " Allocated Memory: ", static_cast<UI32>( teffectsSize ));
cacheStats.AddData( " TEffect: ", sizeof( CTEffect ));
cacheStats.AddData( " Regions Size: ", static_cast<UI32>( cwmWorldState->townRegions.size() ));
cacheStats.AddData( " Allocated Memory: ", static_cast<UI32>( regionsSize ));
cacheStats.AddData( " CTownRegion: ", sizeof( CTownRegion ));
cacheStats.AddData( " SpawnRegions ", static_cast<UI32>( cwmWorldState->spawnRegions.size() ));
cacheStats.AddData( " Allocated Memory: ", static_cast<UI32>( spawnregionsSize ));
cacheStats.AddData( " CSpawnRegion: ", sizeof( CSpawnRegion ));
cacheStats.Send( 0, false, INVALIDSERIAL );
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Restock()
//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 - (nothing / s) Forces a manual vendor restock
//o------------------------------------------------------------------------------------------------o
void Command_Restock( CSocket *s )
{
VALIDATESOCKET( s );
if( oldstrutil::upper( Commands->CommandString( 2, 2 )) == "ALL" )
{
Restock( true );
s->SysMessage( 55 ); // Restocking all shops to their maximums
}
else
{
Restock( false );
s->SysMessage( 54 ); // Manual shop restock has occurred.
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_SetShopRestockRate()
//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 - (d) Sets the universe's shop restock rate
//o------------------------------------------------------------------------------------------------o
void Command_SetShopRestockRate( CSocket *s )
{
VALIDATESOCKET( s );
if( Commands->NumArguments() == 2 )
{
cwmWorldState->ServerData()->SystemTimer( tSERVER_SHOPSPAWN, static_cast<UI16>( Commands->Argument( 1 )));
s->SysMessage( 56 ); // NPC shop restock rate changed.
}
else
s->SysMessage( 57 ); // Invalid number of parameters.
}
bool RespawnFunctor( CBaseObject *a, [[maybe_unused]] UI32 &b, [[maybe_unused]] void *extraData )
{
bool retVal = true;
if( ValidateObject( a ))
{
CItem *i = static_cast<CItem *>( a );
ItemTypes iType = i->GetType();
if( iType == IT_ITEMSPAWNER || iType == IT_NPCSPAWNER || iType == IT_SPAWNCONT ||
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
iType == IT_LOCKEDSPAWNCONT || iType == IT_UNLOCKABLESPAWNCONT ||
iType == IT_AREASPAWNER || iType == IT_ESCORTNPCSPAWNER )
{
if( i->GetObjType() == OT_SPAWNER )
{
CSpawnItem *spawnItem = static_cast<CSpawnItem *>( i );
if( !spawnItem->DoRespawn() )
{
spawnItem->SetTempTimer( BuildTimeValue( static_cast<R64>( RandomNum( spawnItem->GetInterval( 0 ) * 60, spawnItem->GetInterval( 1 ) * 60 ))));
}
}
else
{
i->SetType( IT_NOTYPE );
}
}
}
return retVal;
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Respawn()
//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 - Forces a respawn of all spawn regions
//o------------------------------------------------------------------------------------------------o
void Command_Respawn( void )
{
0.99.5a Improved overall performance of NPC pathfinding (by nearly 60%!) by eliminating some double-work done when checking for blocking dynamics and statics Optimized how the system for determining which internal map regions should have active NPCs; instead of there always being 9 active map regions surrounding any given player who's online, that number will now vary between 3 to 6 map regions, depending on how far the player is from boundaries between such map regions. This should reduce the amount of NPCs active and trying to pathfind at any given point when players are online. UOX3 now adapts the time between each time it checks Spawn Regions based on how "full" the Spawn Regions are on average - the nearer they are to max capacity, the longer time between each time Spawn Regions are checked Fixed an issue with reloading of spawn regions where UOX3 would forget about previously spawned NPCs/Items and respawn everything all over again. As part of the reload process, UOX3 now iterates over previously spawned objects and deletes these where appropriate Added two new races to races.dfn - Ophidian (RACE 25) and Terathan (RACE 26) - which have been setup as racial enemies Updated the race ID of relevant Ophidian and Terathan NPCs (dfndata/npc/arachnids.dfn and dfndata/npc/reptiles.dfn) Added support for NPCs engaging other NPCs in combat if they are marked as racial enemies via races.dfn Extended the amount of JS events supported by UOX3's JS engine from 96 to 192 Added new JS Event to allow overriding behaviour from Help button in paperdoll: onHelpGump( pChar ) // Overrides default gump menu when pressing Help button in paperdoll Added new JS Event to allow preventing characters from toggling on/off war/combat mode onWarModeToggle( p Char ) // return false to prevent war mode toggle Added new JS Event to allow overriding target selection in combat for default AI behaviours: onAICombatTarget( pAttacker, pTarget ) // return true to select current target, or false to skip and look for another Updated JS onDamage() JS event to allow returning false to override and prevent damage dealt to a character. Event must now return true to allow damage to go through Updated JS Event onSwing to work for characters with no weapon equipped (iSwinging will be null, in this case) Updated JS Object Method .KillTimers() to also work for Characters, not just Items Added JS script that renders characters it's attached to immune to physical damage (js/npc/special/physical_immunity.js) Renamed shadow_elemental.js to magical_immunity.js, as it's generic script that can be attached to any NPC Added more pre-defined books to dfndata/misc/books.dfn (and dfndata/items/misc/books.dfn): A Welcome (a_welcome) // Book by Blackthorn, dropped as loot by Betrayers Added definitions for additional NPCs, with scripted special abilities where applicable: Orc Brute (orcbrute) // Throws Orc Lords, cannot be targeted by provoked creatures Orc Chopper (orcchopper) // Attacks deal AoE damage to nearby targets Betrayer (betrayer) // Colossal Blow (stuns and peacemakes), AoE poison (2m range) Golem Controller (m_golemcontroller/f_golemcontroller) Golem (golem) // Colossal Blow (stuns and peacemakes) Crafted Golem (craftedgolem) // Crafted version of golem Exodus Overseer (exodusoverseer) // Magical Shield (immune to physical damage until shield down) Exodus Minion Lord (exodusminionlord) // Magical Shield (immune to physical damage until shield down) Exodus Minion (exodusminion) // Magical shield (immune to physical damage until shield down), periodic AoE burst Added script that allows Tinkerers to craft golem followers via Clockwork Assembly items (js/item/clockwork_assembly.js) Added script for mask of orcish kin, which when worn prevents all orcs from attacking the wearer (js/item/orcish_kin_mask.js) Added AI script for Exodus clockwork NPCs, which amongst a few other things makes them spawn with a magical shield that prevents physical damage being dealt to them until the shield has been brought down by magic damage (js/npc/ai/monster/exodus_clockwork.js) Added AI script for orc NPCs which prevent them from attacking characters wearing masks of orcish kin (js/npc/ai/monster/orc.js) Added AI script for orc brute NPCs, which makes the NPCs toss orc lords (up to 10 in total) when attacked by magic spells (js/npc/ai/monster/orc_brute.js) Added AI script for orc chopper NPCs, which makes the NPCs hit all nearby valid targets with their melee attacks (js/npc/ai/monster/orc_chopper.js) Added script for NPC special ability Colossal Blow, which both stuns and adds a temporary peacemaking effect to targets (js/npc/special/colossal_blow.js) Updated Provocation skill to disallow directing provoked creatures at targets with the custom tag provImmune present Fixed an issue with initialization of wander areas for NPCs spawned via object spawners, which caused NPCs to not stick to their assigned areas, but wander according to their own free will. Can't have that! Fixed some issues with itemlists pointing to non-existing items (a turnip and 10 of each magical reagent) Fixed an issue where information on newly spawned characters would get sent twice to each nearby player Changed default value of ACCOUNTFLUSH ini setting from 0.0 to 5.0 seconds Misc minor cleanup of console messages during startup and shutdown
2022-01-24 17:58:19 +08:00
UI32 spawnedItems = 0;
UI32 spawnedNpcs = 0;
2022-10-24 23:42:16 +08:00
std::for_each( cwmWorldState->spawnRegions.begin(), cwmWorldState->spawnRegions.end(), [&spawnedItems, &spawnedNpcs]( std::pair<UI16, CSpawnRegion *> entry )
{
if( entry.second )
{
entry.second->DoRegionSpawn( spawnedItems, spawnedNpcs );
}
2022-06-06 12:17:38 -04:00
});
UI32 b = 0;
ObjectFactory::GetSingleton().IterateOver( OT_ITEM, b, nullptr, &RespawnFunctor );
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_RegSpawn()
//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 - (s/d) Forces a region spawn, First argument is region number or "ALL"
//o------------------------------------------------------------------------------------------------o
void Command_RegSpawn( CSocket *s )
{
VALIDATESOCKET( s );
if( Commands->NumArguments() == 2 )
{
0.99.5a Improved overall performance of NPC pathfinding (by nearly 60%!) by eliminating some double-work done when checking for blocking dynamics and statics Optimized how the system for determining which internal map regions should have active NPCs; instead of there always being 9 active map regions surrounding any given player who's online, that number will now vary between 3 to 6 map regions, depending on how far the player is from boundaries between such map regions. This should reduce the amount of NPCs active and trying to pathfind at any given point when players are online. UOX3 now adapts the time between each time it checks Spawn Regions based on how "full" the Spawn Regions are on average - the nearer they are to max capacity, the longer time between each time Spawn Regions are checked Fixed an issue with reloading of spawn regions where UOX3 would forget about previously spawned NPCs/Items and respawn everything all over again. As part of the reload process, UOX3 now iterates over previously spawned objects and deletes these where appropriate Added two new races to races.dfn - Ophidian (RACE 25) and Terathan (RACE 26) - which have been setup as racial enemies Updated the race ID of relevant Ophidian and Terathan NPCs (dfndata/npc/arachnids.dfn and dfndata/npc/reptiles.dfn) Added support for NPCs engaging other NPCs in combat if they are marked as racial enemies via races.dfn Extended the amount of JS events supported by UOX3's JS engine from 96 to 192 Added new JS Event to allow overriding behaviour from Help button in paperdoll: onHelpGump( pChar ) // Overrides default gump menu when pressing Help button in paperdoll Added new JS Event to allow preventing characters from toggling on/off war/combat mode onWarModeToggle( p Char ) // return false to prevent war mode toggle Added new JS Event to allow overriding target selection in combat for default AI behaviours: onAICombatTarget( pAttacker, pTarget ) // return true to select current target, or false to skip and look for another Updated JS onDamage() JS event to allow returning false to override and prevent damage dealt to a character. Event must now return true to allow damage to go through Updated JS Event onSwing to work for characters with no weapon equipped (iSwinging will be null, in this case) Updated JS Object Method .KillTimers() to also work for Characters, not just Items Added JS script that renders characters it's attached to immune to physical damage (js/npc/special/physical_immunity.js) Renamed shadow_elemental.js to magical_immunity.js, as it's generic script that can be attached to any NPC Added more pre-defined books to dfndata/misc/books.dfn (and dfndata/items/misc/books.dfn): A Welcome (a_welcome) // Book by Blackthorn, dropped as loot by Betrayers Added definitions for additional NPCs, with scripted special abilities where applicable: Orc Brute (orcbrute) // Throws Orc Lords, cannot be targeted by provoked creatures Orc Chopper (orcchopper) // Attacks deal AoE damage to nearby targets Betrayer (betrayer) // Colossal Blow (stuns and peacemakes), AoE poison (2m range) Golem Controller (m_golemcontroller/f_golemcontroller) Golem (golem) // Colossal Blow (stuns and peacemakes) Crafted Golem (craftedgolem) // Crafted version of golem Exodus Overseer (exodusoverseer) // Magical Shield (immune to physical damage until shield down) Exodus Minion Lord (exodusminionlord) // Magical Shield (immune to physical damage until shield down) Exodus Minion (exodusminion) // Magical shield (immune to physical damage until shield down), periodic AoE burst Added script that allows Tinkerers to craft golem followers via Clockwork Assembly items (js/item/clockwork_assembly.js) Added script for mask of orcish kin, which when worn prevents all orcs from attacking the wearer (js/item/orcish_kin_mask.js) Added AI script for Exodus clockwork NPCs, which amongst a few other things makes them spawn with a magical shield that prevents physical damage being dealt to them until the shield has been brought down by magic damage (js/npc/ai/monster/exodus_clockwork.js) Added AI script for orc NPCs which prevent them from attacking characters wearing masks of orcish kin (js/npc/ai/monster/orc.js) Added AI script for orc brute NPCs, which makes the NPCs toss orc lords (up to 10 in total) when attacked by magic spells (js/npc/ai/monster/orc_brute.js) Added AI script for orc chopper NPCs, which makes the NPCs hit all nearby valid targets with their melee attacks (js/npc/ai/monster/orc_chopper.js) Added script for NPC special ability Colossal Blow, which both stuns and adds a temporary peacemaking effect to targets (js/npc/special/colossal_blow.js) Updated Provocation skill to disallow directing provoked creatures at targets with the custom tag provImmune present Fixed an issue with initialization of wander areas for NPCs spawned via object spawners, which caused NPCs to not stick to their assigned areas, but wander according to their own free will. Can't have that! Fixed some issues with itemlists pointing to non-existing items (a turnip and 10 of each magical reagent) Fixed an issue where information on newly spawned characters would get sent twice to each nearby player Changed default value of ACCOUNTFLUSH ini setting from 0.0 to 5.0 seconds Misc minor cleanup of console messages during startup and shutdown
2022-01-24 17:58:19 +08:00
UI32 itemsSpawned = 0;
UI32 npcsSpawned = 0;
if( oldstrutil::upper( Commands->CommandString( 2, 2 )) == "ALL" )
{
0.99.6d Cleaned up an issue with last commit where wrong npclists were used in some spawn regions Made a few additional adjustments to the new spawn regions in Lost Lands/New Haven Included more changes related to poison updates that should've been in previous commit (like the complete UOX.INI support for POISONCORROSIONSYSTEM setting) Adjusted region setup for New Haven to set the individual "building" regions within as a sub-region of the main town (regions.dfn) Fixed an issue where the displayed HP of an equipped item would not update correctly Further updates to convert timers 32-bit to 64-bit. This affects and addresses some potential issues with: Character creation/NPC guild-join timestamps, NPC movement, combat timers, idle timeouts, item decay, spellcasting Added support for new JS Events that can trigger from global script, and can be used to store persistent custom entries in players' paperdoll profiles: onProfileRequest( socket, profileOwnerChar ) - Triggers when client requests data for a paperdoll profile onProfileUpdate( socket, updatedText ) - Triggers when client sends updated data from paperdoll profile Added two new helper functions in code that allows faster (but very slightly less accurate) distance checks between two points: GetApproxDist( Point3_st a, Point3_st b ) GetApproxDist( CBaseObject *a, CBaseObject *b ) Improved pathfinding for NPCs attempting to follow another character, by adopting a system of weighted variables to help the NPC determine when to recalculate the path vs when to stick with the old, combined with faster distance checks via GetApproxDist(). The end result of this is faster, smarter and more responsive NPC followers and NPC opponents in combat. The variables influencing this include: how far the target has moved from last pathfind target location, whether NPC is heading in the overall right direction or not, time since last path calculation and some small randomization to avoid edge case jitters. Updated default command levels in commands.dfn, code and scripts to support the Seer role and make space for some custom roles. These are the new defaults as listed in commands.dfn, which should not be changed as they are linked to specific enums in code. Do take note that this might invalidate command levels for existing GMs/Seers/Counselors, who might need another round of 'make gm/seer/cns from an admin: ADMIN - command level 10 GM - command level 9 SEER - command level 7 CNS - command level 4 PLAYER - command level 0 Updated how UOX3 makes use of the account-level flags 0x2000 (Seer) and 0x4000 (Counselor). If either of these flags are set on an account, all new characters created on the accounts will automatically receive the relevant command privileges. Fixed an issue with 'wholist command that prevented admin characters from seeing characters with lower privilege levels in the list (js/commands/wholist.js) Fixed an issue with hiding/GM hide that prevented admin characters from seeing hidden characters with lower privilege levels in the world UOX3 now includes the cross-platform, header-only utf8cpp library found at https://github.com/nemtrif/utfcpp and freely available under Boost Software License v1.0. The immediate use-case for this is in code right now is to better handle strings related to custom paperdoll profiles, but will also look to make more heavy use of this in future updates
2025-06-28 22:37:42 +08:00
// Force a round of respawns across all spawn regions
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
const TIMERVAL s_t = GetClock();
2022-10-24 23:42:16 +08:00
std::for_each( cwmWorldState->spawnRegions.begin(), cwmWorldState->spawnRegions.end(), [&itemsSpawned, &npcsSpawned]( std::pair<UI16, CSpawnRegion *> entry )
{
if( entry.second )
{
entry.second->DoRegionSpawn( itemsSpawned, npcsSpawned );
2022-06-06 12:17:38 -04:00
}
});
if( itemsSpawned || npcsSpawned )
{
s->SysMessage( 9021, itemsSpawned, npcsSpawned, cwmWorldState->spawnRegions.size() ); // Spawned %u items and %u npcs in %u SpawnRegions
}
else
{
s->SysMessage( 9022, cwmWorldState->spawnRegions.size() ); // Failed to spawn any new items or npcs in %u SpawnRegions
}
const TIMERVAL e_t = GetClock();
Wholist updated, menus to manage npcs and spawn objects, misc Revamped 'wholist GM command entirely in JS, now comes with filters for names, online/offline status, sorting by name or last online date, quick-buttons to tweak/teleport/inspect, etc. Updated syntax: 'wholist [on] 'wholist off 'wholist force Also available under alias 'playeradmin, with the same parameters Added new JS command for GMs to assist managing NPCs, using updated wholist menu as basis: 'npcadmin Added new JS command for GMs to assist managing object-based Spawners, using updated wholist menu as basis: 'spawnadmin Exposed the following character properties to JS engine: .lastOn // String-formatted timestamp of last time character was oniline .lastOnSecs // Timestamp of last time character was online, expressed as seconds since Unix epoch Added some validation (and re-synching) of lastOn vs lastOnSecs player character properties - only active when running in debug mode Updated onBoatTurn JS Event to support a 4th parameter - a reference to the boat's tillerman: onBoatTurn( iBoat, oldDir, newDir, iTiller ) Added (missing from last commit) JS Method for boats to fetch tillerman reference: .GetTiller() Updated JS Docs with details about onBoatTurn JS event, .GetTiller() method and .lastOn/.lastOnSecs properties Added some console output with details about time taken for each regionspawn cycle Added some new tiledata override entries for some tiles (stairs/platforms) missing NoShoot flag in some older clients (dfndata/maps/tiles.dfn)
2025-04-27 09:18:09 +08:00
Console.Print( oldstrutil::format( "RegionSpawn cycle completed in %.02fsec\n", ( static_cast<R32>( e_t - s_t )) / 1000.0f ));
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
}
else if( oldstrutil::upper( Commands->CommandString( 2, 2 )) == "MAX" )
{
// Force respawn all spawn regions to max
const TIMERVAL s_t = GetClock();
std::for_each( cwmWorldState->spawnRegions.begin(), cwmWorldState->spawnRegions.end(), [&itemsSpawned, &npcsSpawned]( std::pair<UI16, CSpawnRegion *> entry )
{
auto maxTries = 1000;
auto numTries = 0;
if( entry.second )
{
while( numTries < maxTries
&& ( entry.second->GetCurrentCharAmt() < entry.second->GetMaxCharSpawn()
|| entry.second->GetCurrentItemAmt() < entry.second->GetMaxItemSpawn() ))
{
entry.second->DoRegionSpawn( itemsSpawned, npcsSpawned );
numTries++;
}
}
});
if( itemsSpawned || npcsSpawned )
{
s->SysMessage( 9021, itemsSpawned, npcsSpawned, cwmWorldState->spawnRegions.size() ); // Spawned %u items and %u npcs in %u SpawnRegions
}
else
{
s->SysMessage( 9022, cwmWorldState->spawnRegions.size() ); // Failed to spawn any new items or npcs in %u SpawnRegions
}
const TIMERVAL e_t = GetClock();
Console.Print( oldstrutil::format( "Maximum RegionSpawn cycles completed in %.02fsec\n", ( static_cast<R32>( e_t - s_t )) / 1000.0f ));
}
else
{
UI16 spawnRegNum = static_cast<UI16>( Commands->Argument( 1 ));
if( cwmWorldState->spawnRegions.find( spawnRegNum ) != cwmWorldState->spawnRegions.end() )
{
CSpawnRegion *spawnReg = cwmWorldState->spawnRegions[spawnRegNum];
2021-06-12 07:30:23 -04:00
if( spawnReg != nullptr )
{
spawnReg->DoRegionSpawn( itemsSpawned, npcsSpawned );
if( itemsSpawned || npcsSpawned )
{
s->SysMessage( 9023, spawnReg->GetName().c_str(), spawnRegNum, itemsSpawned, npcsSpawned ); // Region: '%s'(%u) spawned %u items and %u npcs
}
else
{
s->SysMessage( 9024, spawnReg->GetName().c_str(), spawnRegNum ); // Region: '%s'(%u) failed to spawn any new items or npcs
}
return;
}
}
s->SysMessage( 9025, spawnRegNum ); // Invalid SpawnRegion %u
}
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_LoadDefaults()
//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 - Loads the hardcoded server defaults for various settings in uox.ini
//o------------------------------------------------------------------------------------------------o
void Command_LoadDefaults( void )
{
cwmWorldState->ServerData()->ResetDefaults();
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_CQ()
//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 - Display the Counselor queue when used with no arguments
//| Can trigger other queue-related commands when arguments are provided
//o------------------------------------------------------------------------------------------------o
void Command_CQ( CSocket *s )
{
VALIDATESOCKET( s );
if( Commands->NumArguments() == 2 )
{
std::string upperCommand = oldstrutil::upper( Commands->CommandString( 2, 2 ));
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( upperCommand == "NEXT" ) // Go to next call in Counselor queue
{
NextCall( s, false );
}
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( upperCommand == "CLEAR" ) // Close and clear current call as resolved
{
CloseCall( s, false );
}
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( upperCommand == "CURR" ) // Take Counselor to current call they are on
{
CurrentCall( s, false );
}
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( upperCommand == "TRANSFER" ) // Transfer call from Counselor queue to GM queue
{
CChar *mChar = s->CurrcharObj();
if( mChar->GetCallNum() != 0 )
{
if( CounselorQueue->GotoPos( CounselorQueue->FindCallNum( mChar->GetCallNum() )))
{
CHelpRequest pageToAdd;
CHelpRequest *currentPage = nullptr;
currentPage = CounselorQueue->Current();
pageToAdd.Reason( currentPage->Reason() );
pageToAdd.WhoPaging( currentPage->WhoPaging() );
pageToAdd.IsHandled( false );
pageToAdd.TimeOfPage( time( nullptr ));
GMQueue->Add( &pageToAdd );
s->SysMessage( 74 ); // Call successfully transferred to the GM queue.
CloseCall( s, false );
}
else
{
s->SysMessage( 75 ); // No such call exists
}
}
else
{
s->SysMessage( 72 ); // You are not currently on a call.
}
}
}
else
{
CounselorQueue->SendAsGump( s ); // Show the Counselor queue, not GM queue
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_GQ()
//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 - Display the GM queue when used with no arguments
//| Can trigger other queue-related commands when arguments are provided
//o------------------------------------------------------------------------------------------------o
void Command_GQ( CSocket *s )
{
VALIDATESOCKET( s );
if( Commands->NumArguments() == 2 )
{
std::string upperCommand = oldstrutil::upper( Commands->CommandString( 2, 2 ));
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( upperCommand == "NEXT" ) // Go to next call in GM queue
{
NextCall( s, true );
}
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( upperCommand == "CLEAR" ) // Close and clear current call as resolved
{
CloseCall( s, true );
}
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( upperCommand == "CURR" ) // Take GM to current call they are on
{
CurrentCall( s, true );
}
}
else
{
GMQueue->SendAsGump( s );
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_MineCheck()
//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 - (d) Set the server mine check status to determine where mining will work
//| 0 - allow mining everywhere
//| 1 - mountainsides and cave floors
//| 2 - mining regions only
//o------------------------------------------------------------------------------------------------o
void Command_MineCheck( void )
{
if( Commands->NumArguments() == 2 )
{
cwmWorldState->ServerData()->MineCheck( static_cast<UI08>( Commands->Argument( 1 )));
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Guards()
//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 - Enables (ON) or disables (OFF) town guards globally
//o------------------------------------------------------------------------------------------------o
void Command_Guards( void )
{
if( oldstrutil::upper( Commands->CommandString( 2, 2 )) == "ON" )
{
cwmWorldState->ServerData()->GuardStatus( true );
SysBroadcast( Dictionary->GetEntry( 61 )); // Guards have been reactivated.
}
else if( oldstrutil::upper( Commands->CommandString( 2, 2 )) == "OFF" )
{
cwmWorldState->ServerData()->GuardStatus( false );
SysBroadcast( Dictionary->GetEntry( 62 )); // Warning: Guards have been deactivated globally.
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Announce()
//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 - Enables (ON) or disables (OFF) announcement of world saves
//o------------------------------------------------------------------------------------------------o
void Command_Announce( void )
{
if( oldstrutil::upper( Commands->CommandString( 2, 2 )) == "ON" )
{
cwmWorldState->ServerData()->ServerAnnounceSaves( true );
SysBroadcast( Dictionary->GetEntry( 63 )); // WorldStat Saves will be displayed.
}
else if( oldstrutil::upper( Commands->CommandString( 2, 2 )) == "OFF" )
{
cwmWorldState->ServerData()->ServerAnnounceSaves( false );
SysBroadcast( Dictionary->GetEntry( 64 )); // WorldStat Saves will not be displayed.
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_PDump()
//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 - Display some performance information
//o------------------------------------------------------------------------------------------------o
void Command_PDump( CSocket *s )
{
VALIDATESOCKET( s );
UI32 networkTimeCount = cwmWorldState->ServerProfile()->NetworkTimeCount();
UI32 timerTimeCount = cwmWorldState->ServerProfile()->TimerTimeCount();
UI32 autoTimeCount = cwmWorldState->ServerProfile()->AutoTimeCount();
UI32 loopTimeCount = cwmWorldState->ServerProfile()->LoopTimeCount();
s->SysMessage( "Performance Dump:" );
s->SysMessage( "Network code: %fmsec [%i]", static_cast<R32>( static_cast<R32>( cwmWorldState->ServerProfile()->NetworkTime() ) / static_cast<R32>( networkTimeCount )), networkTimeCount );
s->SysMessage( "Timer code: %fmsec [%i]", static_cast<R32>( static_cast<R32>( cwmWorldState->ServerProfile()->TimerTime() ) / static_cast<R32>( timerTimeCount )), timerTimeCount );
s->SysMessage( "Auto code: %fmsec [%i]", static_cast<R32>( static_cast<R32>( cwmWorldState->ServerProfile()->AutoTime() ) / static_cast<R32>( autoTimeCount )), autoTimeCount );
s->SysMessage( "Loop Time: %fmsec [%i]", static_cast<R32>( static_cast<R32>( cwmWorldState->ServerProfile()->LoopTime() ) / static_cast<R32>( loopTimeCount )), loopTimeCount );
s->SysMessage( "Simulation Cycles/Sec: %f", ( 1000.0 * ( 1.0 / static_cast<R32>( static_cast<R32>( cwmWorldState->ServerProfile()->LoopTime() ) / static_cast<R32>( loopTimeCount )))));
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_SpawnKill()
//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 - (d) Kills spawns from the specified spawn region in SPAWN.DFN
//o------------------------------------------------------------------------------------------------o
auto Command_SpawnKill( CSocket *s ) -> void
{
VALIDATESOCKET( s );
if( Commands->NumArguments() == 2 )
{
UI16 regNum = static_cast<UI16>( Commands->Argument( 1 ));
if( cwmWorldState->spawnRegions.find( regNum ) != cwmWorldState->spawnRegions.end() )
{
auto spawnReg = cwmWorldState->spawnRegions[regNum];
if( spawnReg )
{
SI32 killed = 0;
s->SysMessage( 349 ); // Killing spawn, this may cause lag...
UOX3 0.99.5b-6 Increased world load speed by almost 20% by reducing how often loading progress is written to the console Increased world save speed by almost 50% through the use of binary mode and buffer tweaks for ofstream combined with a cached newline char and std::to_string instead of static_cast Fixed a server crash involving killing NPCs of a specific spawn region using the 'spawnkill # command Fixed a server crash involving moving items from decaying corpses to the ground Fixed a server crash involving carving up human corpses Fixed a server crash related to AreaCharacterFunction JS function, which could trigger for any script that potentially kills any NPC this function iterates over (like explosion potions) Fixed a server crash related to GMs attempting to add items from add-menu while having no backpack Fixed a client crash issue caused by attempting to sell house deeds back to architect NPCs Fixed an issue where players would get incorrect amounts of gold for selling house deeds back to architect NPCs Fixed an issue with characters dying onboard boats which prevented players from packing up the boats later Added new item property in code (via bools bitset) that can be used to enable/disable maker's mark on crafted items. This property can be set to true for items crafted at exceptional quality by GM craftsmen Exposed the new item property to JS engine: .isMarkedByMaker // If true, maker's mark will be displayed Updated default item tooltip to display " of exceptional quality" for items crafted with exceptional quality Updated default item tooltip to display "[Crafted] by [Crafter's Name]" for exceptional quality items crafted by GM craftsmen. The [Crafted] text comes from the MADEWORD defined in dfndata/skills/skills.dfn for the primary skill used to craft the item Updated old-school single-click names for items (when AoS bit is disabled in client/server features) to display exceptional status and/or maker's mark for appropriate items Fixed an issue with the display of titles for NPCs that used dictionary lookups for their title Added new UOX.INI settings under the [settings] section: DISPLAYMAKERSMARK=1/0 // Controls if maker's marks on crafted items are shown on a global level SHOWNPCTITLESOVERHEAD=1/0 // Controls whether NPC titles are shown over their heads SHOWINVULNERABLETAGOVERHEAD=0/1 // Controls whether invulnerable tags are shown overhead GLOBALRESTOCKMULTIPLIER=1.0 // Global multiplier applied to RESTOCK property of items when loaded from DFNs Added new UOX.INI settings under the [combat] section: PETCOMBATTRAINING=1/0 // Controls whether pets can gain skills/stats from combat HIRELINGCOMBATTRAINING=1/0 // Controls whether hirelings can gain skills/stats from combat NPCCOMBATTRAINING=0/1 // Controls whether NPCs in general can gain skills/stats from combat Fixed an issue where a player meeting the exact minimum requirements for crafting an item would always fail Fixed a bug with teleporting off boats to valid nearby locations when double-clicking boat planks while standing on it Updated behaviour of planks on boats: Boat key can unlock plank, but won't automatically open it Boat key used on an open, unlocked plank will lock and automatically close the plank Boat key used on an open, locked plank will unlock the plank and leave it open Player using an unlocked plank now opens it Player using an open plank will disembark (if onboard) or embark (if not) the boat Player can always open a locked plank if they're on the boat, even with no key, to allow disembarking the boat. Planks that are open, but locked cannot be accessed from outside the boat, and will close automatically after five of seconds Updated behaviour of Magic Lock/Unlock spells: Magic Lock cannot be used on objects inside a multi Magic Lock applies difficulty to lock based on caster's Magery skill Magic Lock effect will last between 7 to 50 seconds (depending on caster's Magery skill) Any object that can be locked via Magic Lock spell can also be unlocked via Magic Unlock spell, if caster has high enough Magery skill Fixed a bug where certain JS Functions, Methods and Properties would occasionally pass incorrect values to scripts that called upon them. Scripts that rely on the GetCurrentClock() Function, the .GetTimer() Method, .decayTime, .logTime, .oreTime and .fishTime Properties might need to be updated to account for the fix, which causes larger values to be passed in than before. Fixed a bug related to GetCurrentClock() that caused decay and respawning of dungeon chests from working properly Fixed a bug related to GetCurrentClock() and .logTime/.fishTime that prevented consumption and regeneration of log/fish resources from working properly Added a new JS Function: GetStartTime() // Returns a timestamp for when server started up Fixed a bug related to GetCurrentClock() where server uptime stats in help menu was showing up incorrectly Fixed a bug related to GetCurrentClock() and purging of registrations of visitors in public houses so their visits can be counted again later Fixed a bug related to GetCurrentClock() that caused monster speech to not work properly Fixed a Z-related issue that sometimes prevented players from fishing when standing on the shoreline next to the sea Fixed an issue with Animal Lore skill that would always return a pet's loyalty level as "Wild" Increased max range pets can be from their owner in order to still be included in moongate/teleporter travel from 12 to 24 tiles Fixed an issue where the alchemy bonus damage for explosion potions was off by an order of magnitude Fixed an issue where food IDs from foodlists referenced by other foodlists was not detected as valid food for tamed pets or NPCs Fixed an issue where Alchemy crafting skill did not properly check for the existence of the crafting tool before proceeding with the crafting process Fixed an issue that prevented the Teleport spell from working as intended Fixed an issue where players would still get 1 gold even if STARTGOLD in uox.ini was set to 0 Fixed an issue with mount restrictions script that prevented players from mounting Unicorns, Ki-rins and Cu Sidhes Fixed an issue where aggressive creatures wouldn't stop attacking player after being tamed (js/skill/taming.js) Added a system message to inform the player when they've dropped out of stealth due to taking too many steps Fixed an issue where hunger level of NPCs instantly dropped upon spawning because hunger timer was not active yet Fixed a bug where character corpses would appear with a [unidentified] tag attached Fixed an issue where the [unidentified] tag did not show up for unidentified magic items Added ANIMAL tag to a small bunch of creature definitions (dfndata/creatures/creatures.dfn) Fixed an issue with Bowcraft skill where player could not gain enough skill from crafting bows to reach min requirement for crossbows, and similiarly could not reach min requirement for heavy crossbows from crossbows Updated default value of MURDERDECAYTIMER INI setting from 60 seconds to 28800 seconds (8 hours), to match the amount of time it would take for one (short term) murder count to decay on LBR-era OSI shards.
2022-08-25 02:13:00 +08:00
std::vector<CChar *> spCharsToDelete;
auto spCharList = spawnReg->GetSpawnedCharsList();
UOX3 0.99.5b-6 Increased world load speed by almost 20% by reducing how often loading progress is written to the console Increased world save speed by almost 50% through the use of binary mode and buffer tweaks for ofstream combined with a cached newline char and std::to_string instead of static_cast Fixed a server crash involving killing NPCs of a specific spawn region using the 'spawnkill # command Fixed a server crash involving moving items from decaying corpses to the ground Fixed a server crash involving carving up human corpses Fixed a server crash related to AreaCharacterFunction JS function, which could trigger for any script that potentially kills any NPC this function iterates over (like explosion potions) Fixed a server crash related to GMs attempting to add items from add-menu while having no backpack Fixed a client crash issue caused by attempting to sell house deeds back to architect NPCs Fixed an issue where players would get incorrect amounts of gold for selling house deeds back to architect NPCs Fixed an issue with characters dying onboard boats which prevented players from packing up the boats later Added new item property in code (via bools bitset) that can be used to enable/disable maker's mark on crafted items. This property can be set to true for items crafted at exceptional quality by GM craftsmen Exposed the new item property to JS engine: .isMarkedByMaker // If true, maker's mark will be displayed Updated default item tooltip to display " of exceptional quality" for items crafted with exceptional quality Updated default item tooltip to display "[Crafted] by [Crafter's Name]" for exceptional quality items crafted by GM craftsmen. The [Crafted] text comes from the MADEWORD defined in dfndata/skills/skills.dfn for the primary skill used to craft the item Updated old-school single-click names for items (when AoS bit is disabled in client/server features) to display exceptional status and/or maker's mark for appropriate items Fixed an issue with the display of titles for NPCs that used dictionary lookups for their title Added new UOX.INI settings under the [settings] section: DISPLAYMAKERSMARK=1/0 // Controls if maker's marks on crafted items are shown on a global level SHOWNPCTITLESOVERHEAD=1/0 // Controls whether NPC titles are shown over their heads SHOWINVULNERABLETAGOVERHEAD=0/1 // Controls whether invulnerable tags are shown overhead GLOBALRESTOCKMULTIPLIER=1.0 // Global multiplier applied to RESTOCK property of items when loaded from DFNs Added new UOX.INI settings under the [combat] section: PETCOMBATTRAINING=1/0 // Controls whether pets can gain skills/stats from combat HIRELINGCOMBATTRAINING=1/0 // Controls whether hirelings can gain skills/stats from combat NPCCOMBATTRAINING=0/1 // Controls whether NPCs in general can gain skills/stats from combat Fixed an issue where a player meeting the exact minimum requirements for crafting an item would always fail Fixed a bug with teleporting off boats to valid nearby locations when double-clicking boat planks while standing on it Updated behaviour of planks on boats: Boat key can unlock plank, but won't automatically open it Boat key used on an open, unlocked plank will lock and automatically close the plank Boat key used on an open, locked plank will unlock the plank and leave it open Player using an unlocked plank now opens it Player using an open plank will disembark (if onboard) or embark (if not) the boat Player can always open a locked plank if they're on the boat, even with no key, to allow disembarking the boat. Planks that are open, but locked cannot be accessed from outside the boat, and will close automatically after five of seconds Updated behaviour of Magic Lock/Unlock spells: Magic Lock cannot be used on objects inside a multi Magic Lock applies difficulty to lock based on caster's Magery skill Magic Lock effect will last between 7 to 50 seconds (depending on caster's Magery skill) Any object that can be locked via Magic Lock spell can also be unlocked via Magic Unlock spell, if caster has high enough Magery skill Fixed a bug where certain JS Functions, Methods and Properties would occasionally pass incorrect values to scripts that called upon them. Scripts that rely on the GetCurrentClock() Function, the .GetTimer() Method, .decayTime, .logTime, .oreTime and .fishTime Properties might need to be updated to account for the fix, which causes larger values to be passed in than before. Fixed a bug related to GetCurrentClock() that caused decay and respawning of dungeon chests from working properly Fixed a bug related to GetCurrentClock() and .logTime/.fishTime that prevented consumption and regeneration of log/fish resources from working properly Added a new JS Function: GetStartTime() // Returns a timestamp for when server started up Fixed a bug related to GetCurrentClock() where server uptime stats in help menu was showing up incorrectly Fixed a bug related to GetCurrentClock() and purging of registrations of visitors in public houses so their visits can be counted again later Fixed a bug related to GetCurrentClock() that caused monster speech to not work properly Fixed a Z-related issue that sometimes prevented players from fishing when standing on the shoreline next to the sea Fixed an issue with Animal Lore skill that would always return a pet's loyalty level as "Wild" Increased max range pets can be from their owner in order to still be included in moongate/teleporter travel from 12 to 24 tiles Fixed an issue where the alchemy bonus damage for explosion potions was off by an order of magnitude Fixed an issue where food IDs from foodlists referenced by other foodlists was not detected as valid food for tamed pets or NPCs Fixed an issue where Alchemy crafting skill did not properly check for the existence of the crafting tool before proceeding with the crafting process Fixed an issue that prevented the Teleport spell from working as intended Fixed an issue where players would still get 1 gold even if STARTGOLD in uox.ini was set to 0 Fixed an issue with mount restrictions script that prevented players from mounting Unicorns, Ki-rins and Cu Sidhes Fixed an issue where aggressive creatures wouldn't stop attacking player after being tamed (js/skill/taming.js) Added a system message to inform the player when they've dropped out of stealth due to taking too many steps Fixed an issue where hunger level of NPCs instantly dropped upon spawning because hunger timer was not active yet Fixed a bug where character corpses would appear with a [unidentified] tag attached Fixed an issue where the [unidentified] tag did not show up for unidentified magic items Added ANIMAL tag to a small bunch of creature definitions (dfndata/creatures/creatures.dfn) Fixed an issue with Bowcraft skill where player could not gain enough skill from crafting bows to reach min requirement for crossbows, and similiarly could not reach min requirement for heavy crossbows from crossbows Updated default value of MURDERDECAYTIMER INI setting from 60 seconds to 28800 seconds (8 hours), to match the amount of time it would take for one (short term) murder count to decay on LBR-era OSI shards.
2022-08-25 02:13:00 +08:00
for( auto &spChar : spCharList->collection() )
{
if( ValidateObject( spChar ))
{
if( spChar->IsSpawned() )
UOX3 0.99.5b-6 Increased world load speed by almost 20% by reducing how often loading progress is written to the console Increased world save speed by almost 50% through the use of binary mode and buffer tweaks for ofstream combined with a cached newline char and std::to_string instead of static_cast Fixed a server crash involving killing NPCs of a specific spawn region using the 'spawnkill # command Fixed a server crash involving moving items from decaying corpses to the ground Fixed a server crash involving carving up human corpses Fixed a server crash related to AreaCharacterFunction JS function, which could trigger for any script that potentially kills any NPC this function iterates over (like explosion potions) Fixed a server crash related to GMs attempting to add items from add-menu while having no backpack Fixed a client crash issue caused by attempting to sell house deeds back to architect NPCs Fixed an issue where players would get incorrect amounts of gold for selling house deeds back to architect NPCs Fixed an issue with characters dying onboard boats which prevented players from packing up the boats later Added new item property in code (via bools bitset) that can be used to enable/disable maker's mark on crafted items. This property can be set to true for items crafted at exceptional quality by GM craftsmen Exposed the new item property to JS engine: .isMarkedByMaker // If true, maker's mark will be displayed Updated default item tooltip to display " of exceptional quality" for items crafted with exceptional quality Updated default item tooltip to display "[Crafted] by [Crafter's Name]" for exceptional quality items crafted by GM craftsmen. The [Crafted] text comes from the MADEWORD defined in dfndata/skills/skills.dfn for the primary skill used to craft the item Updated old-school single-click names for items (when AoS bit is disabled in client/server features) to display exceptional status and/or maker's mark for appropriate items Fixed an issue with the display of titles for NPCs that used dictionary lookups for their title Added new UOX.INI settings under the [settings] section: DISPLAYMAKERSMARK=1/0 // Controls if maker's marks on crafted items are shown on a global level SHOWNPCTITLESOVERHEAD=1/0 // Controls whether NPC titles are shown over their heads SHOWINVULNERABLETAGOVERHEAD=0/1 // Controls whether invulnerable tags are shown overhead GLOBALRESTOCKMULTIPLIER=1.0 // Global multiplier applied to RESTOCK property of items when loaded from DFNs Added new UOX.INI settings under the [combat] section: PETCOMBATTRAINING=1/0 // Controls whether pets can gain skills/stats from combat HIRELINGCOMBATTRAINING=1/0 // Controls whether hirelings can gain skills/stats from combat NPCCOMBATTRAINING=0/1 // Controls whether NPCs in general can gain skills/stats from combat Fixed an issue where a player meeting the exact minimum requirements for crafting an item would always fail Fixed a bug with teleporting off boats to valid nearby locations when double-clicking boat planks while standing on it Updated behaviour of planks on boats: Boat key can unlock plank, but won't automatically open it Boat key used on an open, unlocked plank will lock and automatically close the plank Boat key used on an open, locked plank will unlock the plank and leave it open Player using an unlocked plank now opens it Player using an open plank will disembark (if onboard) or embark (if not) the boat Player can always open a locked plank if they're on the boat, even with no key, to allow disembarking the boat. Planks that are open, but locked cannot be accessed from outside the boat, and will close automatically after five of seconds Updated behaviour of Magic Lock/Unlock spells: Magic Lock cannot be used on objects inside a multi Magic Lock applies difficulty to lock based on caster's Magery skill Magic Lock effect will last between 7 to 50 seconds (depending on caster's Magery skill) Any object that can be locked via Magic Lock spell can also be unlocked via Magic Unlock spell, if caster has high enough Magery skill Fixed a bug where certain JS Functions, Methods and Properties would occasionally pass incorrect values to scripts that called upon them. Scripts that rely on the GetCurrentClock() Function, the .GetTimer() Method, .decayTime, .logTime, .oreTime and .fishTime Properties might need to be updated to account for the fix, which causes larger values to be passed in than before. Fixed a bug related to GetCurrentClock() that caused decay and respawning of dungeon chests from working properly Fixed a bug related to GetCurrentClock() and .logTime/.fishTime that prevented consumption and regeneration of log/fish resources from working properly Added a new JS Function: GetStartTime() // Returns a timestamp for when server started up Fixed a bug related to GetCurrentClock() where server uptime stats in help menu was showing up incorrectly Fixed a bug related to GetCurrentClock() and purging of registrations of visitors in public houses so their visits can be counted again later Fixed a bug related to GetCurrentClock() that caused monster speech to not work properly Fixed a Z-related issue that sometimes prevented players from fishing when standing on the shoreline next to the sea Fixed an issue with Animal Lore skill that would always return a pet's loyalty level as "Wild" Increased max range pets can be from their owner in order to still be included in moongate/teleporter travel from 12 to 24 tiles Fixed an issue where the alchemy bonus damage for explosion potions was off by an order of magnitude Fixed an issue where food IDs from foodlists referenced by other foodlists was not detected as valid food for tamed pets or NPCs Fixed an issue where Alchemy crafting skill did not properly check for the existence of the crafting tool before proceeding with the crafting process Fixed an issue that prevented the Teleport spell from working as intended Fixed an issue where players would still get 1 gold even if STARTGOLD in uox.ini was set to 0 Fixed an issue with mount restrictions script that prevented players from mounting Unicorns, Ki-rins and Cu Sidhes Fixed an issue where aggressive creatures wouldn't stop attacking player after being tamed (js/skill/taming.js) Added a system message to inform the player when they've dropped out of stealth due to taking too many steps Fixed an issue where hunger level of NPCs instantly dropped upon spawning because hunger timer was not active yet Fixed a bug where character corpses would appear with a [unidentified] tag attached Fixed an issue where the [unidentified] tag did not show up for unidentified magic items Added ANIMAL tag to a small bunch of creature definitions (dfndata/creatures/creatures.dfn) Fixed an issue with Bowcraft skill where player could not gain enough skill from crafting bows to reach min requirement for crossbows, and similiarly could not reach min requirement for heavy crossbows from crossbows Updated default value of MURDERDECAYTIMER INI setting from 60 seconds to 28800 seconds (8 hours), to match the amount of time it would take for one (short term) murder count to decay on LBR-era OSI shards.
2022-08-25 02:13:00 +08:00
{
// Store reference to character we want to delete
spCharsToDelete.push_back( spChar );
}
}
}
UOX3 0.99.5b-6 Increased world load speed by almost 20% by reducing how often loading progress is written to the console Increased world save speed by almost 50% through the use of binary mode and buffer tweaks for ofstream combined with a cached newline char and std::to_string instead of static_cast Fixed a server crash involving killing NPCs of a specific spawn region using the 'spawnkill # command Fixed a server crash involving moving items from decaying corpses to the ground Fixed a server crash involving carving up human corpses Fixed a server crash related to AreaCharacterFunction JS function, which could trigger for any script that potentially kills any NPC this function iterates over (like explosion potions) Fixed a server crash related to GMs attempting to add items from add-menu while having no backpack Fixed a client crash issue caused by attempting to sell house deeds back to architect NPCs Fixed an issue where players would get incorrect amounts of gold for selling house deeds back to architect NPCs Fixed an issue with characters dying onboard boats which prevented players from packing up the boats later Added new item property in code (via bools bitset) that can be used to enable/disable maker's mark on crafted items. This property can be set to true for items crafted at exceptional quality by GM craftsmen Exposed the new item property to JS engine: .isMarkedByMaker // If true, maker's mark will be displayed Updated default item tooltip to display " of exceptional quality" for items crafted with exceptional quality Updated default item tooltip to display "[Crafted] by [Crafter's Name]" for exceptional quality items crafted by GM craftsmen. The [Crafted] text comes from the MADEWORD defined in dfndata/skills/skills.dfn for the primary skill used to craft the item Updated old-school single-click names for items (when AoS bit is disabled in client/server features) to display exceptional status and/or maker's mark for appropriate items Fixed an issue with the display of titles for NPCs that used dictionary lookups for their title Added new UOX.INI settings under the [settings] section: DISPLAYMAKERSMARK=1/0 // Controls if maker's marks on crafted items are shown on a global level SHOWNPCTITLESOVERHEAD=1/0 // Controls whether NPC titles are shown over their heads SHOWINVULNERABLETAGOVERHEAD=0/1 // Controls whether invulnerable tags are shown overhead GLOBALRESTOCKMULTIPLIER=1.0 // Global multiplier applied to RESTOCK property of items when loaded from DFNs Added new UOX.INI settings under the [combat] section: PETCOMBATTRAINING=1/0 // Controls whether pets can gain skills/stats from combat HIRELINGCOMBATTRAINING=1/0 // Controls whether hirelings can gain skills/stats from combat NPCCOMBATTRAINING=0/1 // Controls whether NPCs in general can gain skills/stats from combat Fixed an issue where a player meeting the exact minimum requirements for crafting an item would always fail Fixed a bug with teleporting off boats to valid nearby locations when double-clicking boat planks while standing on it Updated behaviour of planks on boats: Boat key can unlock plank, but won't automatically open it Boat key used on an open, unlocked plank will lock and automatically close the plank Boat key used on an open, locked plank will unlock the plank and leave it open Player using an unlocked plank now opens it Player using an open plank will disembark (if onboard) or embark (if not) the boat Player can always open a locked plank if they're on the boat, even with no key, to allow disembarking the boat. Planks that are open, but locked cannot be accessed from outside the boat, and will close automatically after five of seconds Updated behaviour of Magic Lock/Unlock spells: Magic Lock cannot be used on objects inside a multi Magic Lock applies difficulty to lock based on caster's Magery skill Magic Lock effect will last between 7 to 50 seconds (depending on caster's Magery skill) Any object that can be locked via Magic Lock spell can also be unlocked via Magic Unlock spell, if caster has high enough Magery skill Fixed a bug where certain JS Functions, Methods and Properties would occasionally pass incorrect values to scripts that called upon them. Scripts that rely on the GetCurrentClock() Function, the .GetTimer() Method, .decayTime, .logTime, .oreTime and .fishTime Properties might need to be updated to account for the fix, which causes larger values to be passed in than before. Fixed a bug related to GetCurrentClock() that caused decay and respawning of dungeon chests from working properly Fixed a bug related to GetCurrentClock() and .logTime/.fishTime that prevented consumption and regeneration of log/fish resources from working properly Added a new JS Function: GetStartTime() // Returns a timestamp for when server started up Fixed a bug related to GetCurrentClock() where server uptime stats in help menu was showing up incorrectly Fixed a bug related to GetCurrentClock() and purging of registrations of visitors in public houses so their visits can be counted again later Fixed a bug related to GetCurrentClock() that caused monster speech to not work properly Fixed a Z-related issue that sometimes prevented players from fishing when standing on the shoreline next to the sea Fixed an issue with Animal Lore skill that would always return a pet's loyalty level as "Wild" Increased max range pets can be from their owner in order to still be included in moongate/teleporter travel from 12 to 24 tiles Fixed an issue where the alchemy bonus damage for explosion potions was off by an order of magnitude Fixed an issue where food IDs from foodlists referenced by other foodlists was not detected as valid food for tamed pets or NPCs Fixed an issue where Alchemy crafting skill did not properly check for the existence of the crafting tool before proceeding with the crafting process Fixed an issue that prevented the Teleport spell from working as intended Fixed an issue where players would still get 1 gold even if STARTGOLD in uox.ini was set to 0 Fixed an issue with mount restrictions script that prevented players from mounting Unicorns, Ki-rins and Cu Sidhes Fixed an issue where aggressive creatures wouldn't stop attacking player after being tamed (js/skill/taming.js) Added a system message to inform the player when they've dropped out of stealth due to taking too many steps Fixed an issue where hunger level of NPCs instantly dropped upon spawning because hunger timer was not active yet Fixed a bug where character corpses would appear with a [unidentified] tag attached Fixed an issue where the [unidentified] tag did not show up for unidentified magic items Added ANIMAL tag to a small bunch of creature definitions (dfndata/creatures/creatures.dfn) Fixed an issue with Bowcraft skill where player could not gain enough skill from crafting bows to reach min requirement for crossbows, and similiarly could not reach min requirement for heavy crossbows from crossbows Updated default value of MURDERDECAYTIMER INI setting from 60 seconds to 28800 seconds (8 hours), to match the amount of time it would take for one (short term) murder count to decay on LBR-era OSI shards.
2022-08-25 02:13:00 +08:00
// Loop through the characters we want to delete from spawn region
std::for_each( spCharsToDelete.begin(), spCharsToDelete.end(), [&killed]( CChar *charToDelete )
{
Effects->Bolteffect( charToDelete );
UOX3 0.99.5b-6 Increased world load speed by almost 20% by reducing how often loading progress is written to the console Increased world save speed by almost 50% through the use of binary mode and buffer tweaks for ofstream combined with a cached newline char and std::to_string instead of static_cast Fixed a server crash involving killing NPCs of a specific spawn region using the 'spawnkill # command Fixed a server crash involving moving items from decaying corpses to the ground Fixed a server crash involving carving up human corpses Fixed a server crash related to AreaCharacterFunction JS function, which could trigger for any script that potentially kills any NPC this function iterates over (like explosion potions) Fixed a server crash related to GMs attempting to add items from add-menu while having no backpack Fixed a client crash issue caused by attempting to sell house deeds back to architect NPCs Fixed an issue where players would get incorrect amounts of gold for selling house deeds back to architect NPCs Fixed an issue with characters dying onboard boats which prevented players from packing up the boats later Added new item property in code (via bools bitset) that can be used to enable/disable maker's mark on crafted items. This property can be set to true for items crafted at exceptional quality by GM craftsmen Exposed the new item property to JS engine: .isMarkedByMaker // If true, maker's mark will be displayed Updated default item tooltip to display " of exceptional quality" for items crafted with exceptional quality Updated default item tooltip to display "[Crafted] by [Crafter's Name]" for exceptional quality items crafted by GM craftsmen. The [Crafted] text comes from the MADEWORD defined in dfndata/skills/skills.dfn for the primary skill used to craft the item Updated old-school single-click names for items (when AoS bit is disabled in client/server features) to display exceptional status and/or maker's mark for appropriate items Fixed an issue with the display of titles for NPCs that used dictionary lookups for their title Added new UOX.INI settings under the [settings] section: DISPLAYMAKERSMARK=1/0 // Controls if maker's marks on crafted items are shown on a global level SHOWNPCTITLESOVERHEAD=1/0 // Controls whether NPC titles are shown over their heads SHOWINVULNERABLETAGOVERHEAD=0/1 // Controls whether invulnerable tags are shown overhead GLOBALRESTOCKMULTIPLIER=1.0 // Global multiplier applied to RESTOCK property of items when loaded from DFNs Added new UOX.INI settings under the [combat] section: PETCOMBATTRAINING=1/0 // Controls whether pets can gain skills/stats from combat HIRELINGCOMBATTRAINING=1/0 // Controls whether hirelings can gain skills/stats from combat NPCCOMBATTRAINING=0/1 // Controls whether NPCs in general can gain skills/stats from combat Fixed an issue where a player meeting the exact minimum requirements for crafting an item would always fail Fixed a bug with teleporting off boats to valid nearby locations when double-clicking boat planks while standing on it Updated behaviour of planks on boats: Boat key can unlock plank, but won't automatically open it Boat key used on an open, unlocked plank will lock and automatically close the plank Boat key used on an open, locked plank will unlock the plank and leave it open Player using an unlocked plank now opens it Player using an open plank will disembark (if onboard) or embark (if not) the boat Player can always open a locked plank if they're on the boat, even with no key, to allow disembarking the boat. Planks that are open, but locked cannot be accessed from outside the boat, and will close automatically after five of seconds Updated behaviour of Magic Lock/Unlock spells: Magic Lock cannot be used on objects inside a multi Magic Lock applies difficulty to lock based on caster's Magery skill Magic Lock effect will last between 7 to 50 seconds (depending on caster's Magery skill) Any object that can be locked via Magic Lock spell can also be unlocked via Magic Unlock spell, if caster has high enough Magery skill Fixed a bug where certain JS Functions, Methods and Properties would occasionally pass incorrect values to scripts that called upon them. Scripts that rely on the GetCurrentClock() Function, the .GetTimer() Method, .decayTime, .logTime, .oreTime and .fishTime Properties might need to be updated to account for the fix, which causes larger values to be passed in than before. Fixed a bug related to GetCurrentClock() that caused decay and respawning of dungeon chests from working properly Fixed a bug related to GetCurrentClock() and .logTime/.fishTime that prevented consumption and regeneration of log/fish resources from working properly Added a new JS Function: GetStartTime() // Returns a timestamp for when server started up Fixed a bug related to GetCurrentClock() where server uptime stats in help menu was showing up incorrectly Fixed a bug related to GetCurrentClock() and purging of registrations of visitors in public houses so their visits can be counted again later Fixed a bug related to GetCurrentClock() that caused monster speech to not work properly Fixed a Z-related issue that sometimes prevented players from fishing when standing on the shoreline next to the sea Fixed an issue with Animal Lore skill that would always return a pet's loyalty level as "Wild" Increased max range pets can be from their owner in order to still be included in moongate/teleporter travel from 12 to 24 tiles Fixed an issue where the alchemy bonus damage for explosion potions was off by an order of magnitude Fixed an issue where food IDs from foodlists referenced by other foodlists was not detected as valid food for tamed pets or NPCs Fixed an issue where Alchemy crafting skill did not properly check for the existence of the crafting tool before proceeding with the crafting process Fixed an issue that prevented the Teleport spell from working as intended Fixed an issue where players would still get 1 gold even if STARTGOLD in uox.ini was set to 0 Fixed an issue with mount restrictions script that prevented players from mounting Unicorns, Ki-rins and Cu Sidhes Fixed an issue where aggressive creatures wouldn't stop attacking player after being tamed (js/skill/taming.js) Added a system message to inform the player when they've dropped out of stealth due to taking too many steps Fixed an issue where hunger level of NPCs instantly dropped upon spawning because hunger timer was not active yet Fixed a bug where character corpses would appear with a [unidentified] tag attached Fixed an issue where the [unidentified] tag did not show up for unidentified magic items Added ANIMAL tag to a small bunch of creature definitions (dfndata/creatures/creatures.dfn) Fixed an issue with Bowcraft skill where player could not gain enough skill from crafting bows to reach min requirement for crossbows, and similiarly could not reach min requirement for heavy crossbows from crossbows Updated default value of MURDERDECAYTIMER INI setting from 60 seconds to 28800 seconds (8 hours), to match the amount of time it would take for one (short term) murder count to decay on LBR-era OSI shards.
2022-08-25 02:13:00 +08:00
Effects->PlaySound( charToDelete, 0x0029 );
charToDelete->Delete();
++killed;
});
s->SysMessage( 84 ); // Done.
s->SysMessage( 350, killed, regNum ); // %i of Spawn %i have been killed.
}
}
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - BuildWhoGump()
//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 - Build and send a gump with a list of players based on provided criteria
//o------------------------------------------------------------------------------------------------o
void BuildWhoGump( CSocket *s, UI08 commandLevel, std::string title )
{
UI16 j = 0;
CGumpDisplay Who( s, 400, 300 );
Who.SetTitle( title );
{
for( auto &iSock : Network->connClients )
{
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
CChar *iChar = iSock->CurrcharObj();
if( iChar->GetCommandLevel() >= commandLevel )
{
auto temp = oldstrutil::format( "%i) %s", j, iChar->GetName().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
Who.AddData( temp, iChar->GetSerial(), 3 );
}
++j;
}
}
Who.Send( 4, false, INVALIDSERIAL );
}
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
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Who()
//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 - Displays a list of users currently online
//o------------------------------------------------------------------------------------------------o
void Command_Who( CSocket *s )
{
VALIDATESOCKET( s );
BuildWhoGump( s, 0, "Who's Online" );
}
//o------------------------------------------------------------------------------------------------o
//| Function - void Command_GMs( CSocket *s )
//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 - Displays a list of server staff currently online
//o------------------------------------------------------------------------------------------------o
void Command_GMs( CSocket *s )
{
VALIDATESOCKET( s );
BuildWhoGump( s, CL_CNS, Dictionary->GetEntry( 77, s->Language() )); // Current Staff online
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_ReportBug()
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
//| Date - 9th February, 2000
//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 - Writes out a bug reported by player to the bug file
//o------------------------------------------------------------------------------------------------o
void Command_ReportBug( CSocket *s )
{
VALIDATESOCKET( s );
CChar *mChar = s->CurrcharObj();
if( !ValidateObject( mChar ))
return;
std::string logName = cwmWorldState->ServerData()->Directory( CSDDP_LOGS ) + "bugs.log";
std::ofstream logDestination;
logDestination.open( logName.c_str(), std::ios::out | std::ios::app );
if( !logDestination.is_open() )
{
Console.Error( oldstrutil::format( "Unable to open bugs log file %s!", logName.c_str() ));
return;
}
char dateTime[1024];
RealTime( dateTime );
logDestination << "[" << dateTime << "] ";
logDestination << "<" << mChar->GetName() << "> ";
logDestination << "Reports: " << Commands->CommandString( 2 ) << std::endl;
logDestination.close();
s->SysMessage( 87 ); // Thank you for your continuing support, your feedback is important to us
bool x = false;
{
for( auto &iSock : Network->connClients )
{
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
CChar *iChar = iSock->CurrcharObj();
if( ValidateObject( iChar ))
{
if( iChar->IsGMPageable() )
{
x = true;
iSock->SysMessage( 277, mChar->GetName().c_str(), Commands->CommandString( 2 ).c_str() ); // User %s reported a bug (%s)
}
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( x )
{
s->SysMessage( 88 ); // Available Game Masters have been notified of your bug submission.
}
else
{
s->SysMessage( 89 ); // There was no Game Master available to note your bug report.
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_ForceWho()
//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 - Brings up an interactive listing of online users.
//o------------------------------------------------------------------------------------------------o
void Command_ForceWho( CSocket *s )
{
VALIDATESOCKET( s );
WhoList->ZeroWho();
WhoList->SendSocket( s );
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_ValidCmd()
//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 - Displays all valid commands for the user's character
//o------------------------------------------------------------------------------------------------o
void Command_ValidCmd( CSocket *s )
{
VALIDATESOCKET( s );
CChar *mChar = s->CurrcharObj();
UI08 targetCommand = mChar->GetCommandLevel();
CGumpDisplay targetCmds( s, 300, 300 );
targetCmds.SetTitle( "Valid Commands" );
for( COMMANDMAP_ITERATOR myCounter = CommandMap.begin(); myCounter != CommandMap.end(); ++myCounter )
{
if( myCounter->second.cmdLevelReq <= targetCommand )
{
targetCmds.AddData( myCounter->first, myCounter->second.cmdLevelReq );
}
}
for( TARGETMAP_ITERATOR targCounter = TargetMap.begin(); targCounter != TargetMap.end(); ++targCounter )
{
if( targCounter->second.cmdLevelReq <= targetCommand )
{
targetCmds.AddData( targCounter->first, targCounter->second.cmdLevelReq );
}
}
for( JSCOMMANDMAP_ITERATOR jsCounter = JSCommandMap.begin(); jsCounter != JSCommandMap.end(); ++jsCounter )
{
if( jsCounter->second.cmdLevelReq <= targetCommand )
{
targetCmds.AddData( jsCounter->first, jsCounter->second.cmdLevelReq );
}
}
targetCmds.Send( 4, false, INVALIDSERIAL );
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_HowTo()
//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 - Opens a list of commands, with explanations of how to use each specific command
//o------------------------------------------------------------------------------------------------o
void Command_HowTo( CSocket *s )
{
VALIDATESOCKET( s );
std::string commandStart = oldstrutil::upper( Commands->CommandString( 2 ));
if( commandStart.empty() )
{
CChar *mChar = s->CurrcharObj();
if( !ValidateObject( mChar ))
return;
SI32 iCmd = 2;
SI32 numAdded = 0;
UI08 pagenum = 1;
UI16 position = 40;
UI16 linenum = 1;
CPSendGumpMenu toSend;
toSend.UserId( INVALIDSERIAL );
toSend.GumpId( 13 );
toSend.addCommand( oldstrutil::format( "resizepic 0 0 %u 480 320", cwmWorldState->ServerData()->BackgroundPic() ));
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
toSend.addCommand( "page 0" );
toSend.addCommand( "text 200 20 0 0" );
toSend.addText( "HOWTO" );
toSend.addCommand( oldstrutil::format( "button 440 20 %u %i 1 0 1", cwmWorldState->ServerData()->ButtonCancel(), cwmWorldState->ServerData()->ButtonCancel() + 1 ));
UI08 currentLevel = mChar->GetCommandLevel();
COMMANDMAP_ITERATOR gAdd = CommandMap.begin();
TARGETMAP_ITERATOR tAdd = TargetMap.begin();
JSCOMMANDMAP_ITERATOR jAdd = JSCommandMap.begin();
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
toSend.addCommand( "page 1" );
bool justDonePageAdd = false;
while( gAdd != CommandMap.end() )
{
if( numAdded > 0 && !(numAdded%10) && !justDonePageAdd )
{
position = 40;
++pagenum;
toSend.addCommand( oldstrutil::format( "page %u", pagenum ));
justDonePageAdd = true;
}
if( gAdd->second.cmdLevelReq <= currentLevel )
{
justDonePageAdd = false;
toSend.addCommand( oldstrutil::format( "text 50 %u %u %u", position, cwmWorldState->ServerData()->LeftTextColour(), linenum ));
toSend.addCommand( oldstrutil::format("button 20 %u %u %i %u 0 %i", position, cwmWorldState->ServerData()->ButtonRight(), cwmWorldState->ServerData()->ButtonRight() + 1, pagenum, iCmd ));
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
toSend.addText( gAdd->first );
++numAdded;
++linenum;
position += 20;
}
++iCmd;
++gAdd;
}
while( tAdd != TargetMap.end() )
{
if( numAdded > 0 && !(numAdded%10) && !justDonePageAdd )
{
position = 40;
++pagenum;
toSend.addCommand( oldstrutil::format( "page %u", pagenum ));
justDonePageAdd = true;
}
if( tAdd->second.cmdLevelReq <= currentLevel )
{
justDonePageAdd = false;
toSend.addCommand( oldstrutil::format( "text 50 %u %u %u", position, cwmWorldState->ServerData()->LeftTextColour(), linenum ));
toSend.addCommand( oldstrutil::format( "button 20 %u %u %i %u 0 %i", position, cwmWorldState->ServerData()->ButtonRight(), cwmWorldState->ServerData()->ButtonRight() + 1, pagenum, iCmd ));
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
toSend.addText( tAdd->first );
++numAdded;
++linenum;
position += 20;
}
++iCmd;
++tAdd;
}
while( jAdd != JSCommandMap.end() )
{
if( numAdded > 0 && !(numAdded%10) && !justDonePageAdd )
{
position = 40;
++pagenum;
toSend.addCommand( oldstrutil::format( "page %u", pagenum ));
justDonePageAdd = true;
}
if( jAdd->second.cmdLevelReq <= currentLevel )
{
justDonePageAdd = false;
toSend.addCommand( oldstrutil::format( "text 50 %u %u %u", position, cwmWorldState->ServerData()->LeftTextColour(), linenum ));
toSend.addCommand( oldstrutil::format( "button 20 %u %u %i %u 0 %i", position, cwmWorldState->ServerData()->ButtonRight(), cwmWorldState->ServerData()->ButtonRight() + 1, pagenum, iCmd ));
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
toSend.addText( jAdd->first );
++numAdded;
++linenum;
position += 20;
}
++iCmd;
++jAdd;
}
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
pagenum = 1;
for( SI32 i = 0; i < numAdded; i += 10 )
{
toSend.addCommand( oldstrutil::format( "page %u", pagenum ));
if( i >= 10 )
{
toSend.addCommand( oldstrutil::format( "button 30 290 %u %i 0 %i", cwmWorldState->ServerData()->ButtonLeft(), cwmWorldState->ServerData()->ButtonLeft() + 1, pagenum - 1 )); //back button
}
if(( numAdded > 10 ) && (( i + 10 ) < numAdded ))
{
toSend.addCommand( oldstrutil::format("button 440 290 %u %i 0 %i", cwmWorldState->ServerData()->ButtonRight(), cwmWorldState->ServerData()->ButtonRight() + 1, pagenum + 1 ));
}
++pagenum;
}
toSend.Finalize();
s->Send( &toSend );
}
else
{
SI32 i = 0;
COMMANDMAP_ITERATOR toFind;
for( toFind = CommandMap.begin(); toFind != CommandMap.end(); ++toFind )
{
if( commandStart == toFind->first )
{
break;
}
++i;
}
if( toFind == CommandMap.end() )
{
TARGETMAP_ITERATOR findTarg;
for( findTarg = TargetMap.begin(); findTarg != TargetMap.end(); ++findTarg )
{
if( commandStart == findTarg->first )
{
break;
}
++i;
}
if( findTarg == TargetMap.end() )
{
JSCOMMANDMAP_ITERATOR findJS = JSCommandMap.begin();
for( findJS = JSCommandMap.begin(); findJS != JSCommandMap.end(); ++findJS )
{
if( commandStart == findJS->first )
{
break;
}
++i;
}
if( findJS == JSCommandMap.end() )
{
s->SysMessage( 280 ); // Error finding command
return;
}
}
}
HandleHowTo( s, i );
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Temp()
//o------------------------------------------------------------------------------------------------o
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
//| Purpose - Displays the current temperature in user's current townregion
//o------------------------------------------------------------------------------------------------o
void Command_Temp( CSocket *s )
{
VALIDATESOCKET( s );
CChar *mChar = s->CurrcharObj();
if( !ValidateObject( mChar ))
return;
CTownRegion *reg = mChar->GetRegion();
WEATHID toGrab = reg->GetWeather();
if( toGrab != 0xFF )
{
R32 curTemp = Weather->Temp( toGrab );
s->SysMessage( 1751, curTemp ); // It is currently %f degrees
}
}
//o------------------------------------------------------------------------------------------------o
//| Function - Command_Status()
//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 - Opens the HTML status information gump
//o------------------------------------------------------------------------------------------------o
void Command_Status( CSocket *s )
{
VALIDATESOCKET( s );
HTMLTemplates->TemplateInfoGump( s );
}
COMMANDMAP CommandMap;
TARGETMAP TargetMap;
JSCOMMANDMAP JSCommandMap;
void CCommands::CommandReset()
{
// TargetMap[Command Name] = TargetMapEntry_st(Required Command Level, Command Type, Target ID, Dictionary Entry);
// A
// B
// C
// D
// E
// F
// G
// H
// I
TargetMap["INFO"] = TargetMapEntry_st( CL_GM, CMD_TARGET, TARGET_INFO, 261);
// J
// K
// L
// M
TargetMap["MAKE"] = TargetMapEntry_st( CL_ADMIN, CMD_TARGETTXT, TARGET_MAKESTATUS, 279);
// N
// O
// P
// Q
// R
// S
TargetMap["SHOWSKILLS"] = TargetMapEntry_st( CL_GM, CMD_TARGETINT, TARGET_SHOWSKILLS, 260);
// T
//TargetMap["TWEAK"] = TargetMapEntry_st( CL_GM, CMD_TARGET, TARGET_TWEAK, 229);
// U
// V
// W
TargetMap["WSTATS"] = TargetMapEntry_st( CL_CNS, CMD_TARGET, TARGET_WSTATS, 183);
// X
// Y
// Z
// CommandMap[Command Name] = CommandMapEntry_st(Required Command Level, Command Type, Command Function);
//A
CommandMap["ADDACCOUNT"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_AddAccount);
CommandMap["ANNOUNCE"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&Command_Announce);
//B
//C
CommandMap["CQ"] = CommandMapEntry_st( CL_CNS, CMD_SOCKFUNC, (CMD_DEFINE)&Command_CQ);
CommandMap["COMMAND"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_Command);
//D
CommandMap["DYE"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_Dye);
//E
//F
CommandMap["FORCEWHO"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_ForceWho);
CommandMap["FIXSPAWN"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&command_fixspawn);
//G,
CommandMap["GETLIGHT"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_GetLight);
CommandMap["GUARDS"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&Command_Guards);
CommandMap["GMS"] = CommandMapEntry_st( CL_CNS, CMD_SOCKFUNC, (CMD_DEFINE)&Command_GMs);
CommandMap["GMMENU"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_GmMenu);
CommandMap["GCOLLECT"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&CollectGarbage);
CommandMap["GQ"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_GQ);
//H
CommandMap["HOWTO"] = CommandMapEntry_st( CL_PLAYER, CMD_SOCKFUNC, (CMD_DEFINE)&Command_HowTo );
//I
//J
//K
//L
CommandMap["LOADDEFAULTS"] = CommandMapEntry_st( CL_ADMIN, CMD_FUNC, (CMD_DEFINE)&Command_LoadDefaults);
//M
CommandMap["MEMSTATS"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_MemStats);
CommandMap["MINECHECK"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&Command_MineCheck);
//N
//O
//P
CommandMap["PDUMP"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_PDump);
CommandMap["POST"] = CommandMapEntry_st( CL_CNS, CMD_SOCKFUNC, (CMD_DEFINE)&Command_GetPost);
//Q
//R
CommandMap["RESTOCK"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_Restock);
CommandMap["RESPAWN"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&Command_Respawn);
CommandMap["REGSPAWN"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_RegSpawn);
CommandMap["REPORTBUG"] = CommandMapEntry_st( CL_PLAYER, CMD_SOCKFUNC, (CMD_DEFINE)&Command_ReportBug);
//S
CommandMap["SETPOST"] = CommandMapEntry_st( CL_CNS, CMD_SOCKFUNC, (CMD_DEFINE)&Command_SetPost);
CommandMap["SPAWNKILL"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_SpawnKill);
CommandMap["SETSHOPRESTOCKRATE"]= CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_SetShopRestockRate);
CommandMap["SETTIME"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&Command_SetTime);
CommandMap["SHUTDOWN"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&Command_Shutdown);
CommandMap["SAVE"] = CommandMapEntry_st( CL_GM, CMD_FUNC, (CMD_DEFINE)&Command_Save);
CommandMap["STATUS"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_Status);
CommandMap["SHOWIDS"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_ShowIds);
//T
CommandMap["TEMP"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_Temp );
CommandMap["TELL"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_Tell);
CommandMap["TILE"] = CommandMapEntry_st( CL_GM, CMD_SOCKFUNC, (CMD_DEFINE)&Command_Tile);
//U
//V
CommandMap["VALIDCMD"] = CommandMapEntry_st( CL_PLAYER, CMD_SOCKFUNC, (CMD_DEFINE)&Command_ValidCmd );
//W
CommandMap["WHO"] = CommandMapEntry_st( CL_CNS, CMD_SOCKFUNC, (CMD_DEFINE)&Command_Who);
//X
//Y
//Z
}
//o------------------------------------------------------------------------------------------------o
//| Function - CCommands::UnRegister()
//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 - Unregisters a command from JS command table
//o------------------------------------------------------------------------------------------------o
void CCommands::UnRegister( const std::string &cmdName, [[maybe_unused]] cScript *toRegister )
{
#if defined( UOX_DEBUG_MODE )
Console.Print( oldstrutil::format( " UnRegistering command %s\n", cmdName.c_str() ));
#endif
std::string upper = cmdName;
upper = oldstrutil::upper( upper );
JSCOMMANDMAP_ITERATOR p = JSCommandMap.find( upper );
if( p != JSCommandMap.end() )
{
JSCommandMap.erase( p );
}
#if defined( UOX_DEBUG_MODE )
else
{
Console.Print( oldstrutil::format( " Command \"%s\" was not found.\n", cmdName.c_str() ));
}
#endif
}
//o------------------------------------------------------------------------------------------------o
//| Function - CCommands::Register()
//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 - Resgisters a new command in JS command table
//o------------------------------------------------------------------------------------------------o
void CCommands::Register( const std::string &cmdName, UI16 scriptId, UI08 cmdLevel, bool isEnabled )
{
#if defined( UOX_DEBUG_MODE )
Console.Print( " " );
Console.MoveTo( 15 );
Console.Print( "Registering " );
Console.TurnYellow();
Console.Print( cmdName );
Console.TurnNormal();
Console.MoveTo( 50 );
Console.Print( "@ command level " );
Console.TurnYellow();
Console.Print( oldstrutil::format( "%i\n", cmdLevel ));
Console.TurnNormal();
#endif
std::string upper = cmdName;
upper = oldstrutil::upper( upper );
JSCommandMap[upper] = JSCommandEntry_st( cmdLevel, scriptId, isEnabled );
}
//o------------------------------------------------------------------------------------------------o
//| Function - CCommands::SetCommandStatus()
//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 - Enables or disables a command in JS command table
//o------------------------------------------------------------------------------------------------o
void CCommands::SetCommandStatus( const std::string &cmdName, bool isEnabled )
{
std::string upper = cmdName;
upper = oldstrutil::upper( upper );
JSCOMMANDMAP_ITERATOR toFind = JSCommandMap.find( upper );
if( toFind != JSCommandMap.end() )
{
toFind->second.isEnabled = isEnabled;
}
}