Commit graph

54 commits

Author SHA1 Message Date
Xoduz
dcf10ed540 More timer-related tweaks
Got rid of the Overflow() function, which no longer serves a purpose after timers have been upgraded from uint32_t to uint64_t
Unified usage of TIMERVAL (UI64) and TVAL (also UI64) across code base; now only TIMERVAL is used
Updated BuildTimeValue() function parameter from R32 to R64
Updated casting of values passed into BuildTimeValue() across source base
Updated JS Timers and Temp Effects to support starting, saving and loading very long term effect timers; no more 49 days upper limit
Ninja fix for new items added to a container appearing underneath other items in the container instead of over
2025-05-31 01:47:47 +08:00
Xoduz
15da92aca2 Last batch of fixes for this PR
Fixes for updated wholist/spawnadmin menu crashing under certain circumstances using regular UO client
Updated logging of CPCharAndStartLoc packet to account for both old and new version of packet
Reloading Spawn Regions via 'reloadspawnregions JS command will now do a full reload from the DFN files (previously needed manual DFN reload before spawn region reload)
Reloading DFNs via 'reloaddfns JS command will now also reload creatures.dfn, titles.dfn, location.dfn
Reloading ALL via 'reloadall JS command will now also reload teleport.scp, creatures.dfn, titles.dfn, location.dfn
2025-04-29 09:34:51 +08:00
cmkerr59@icloud.com
4be2569a82 two warnings 2023-08-24 17:43:35 -04:00
Lloyd Dilley
bdf3e2192c
Fix compile warnings 2023-07-08 14:25:04 -04:00
Xoduz
7a4a95cd8d Misc minor fixes, network performance increase on Windows
Cleaned up a couple of warnings highlighted by static code analysis
Fixed an issue with NPC evasion pathfinding where the direction wasn't always set correctly
Fixed an issue with onNameRequest JS Event where the size of param jsval (2) didn't match actual number of parameters provided (3)
Removed setting uoxTimeout.tv_usec to 1 in CNetworkStuff::CheckLoginMessage() to address slower core loop iterations on Windows, due to differences in timer resolutions supported by WinSock2 function select() on different platforms - tv_usec 1 is treated as 1 microsecond on Linux/macOS, but as 1 millisecond on Windows
2023-07-02 19:23:21 +08:00
Xoduz
a48d9ee299 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
Lloyd Dilley
64a71580d8
More cast, construct, and spacing fixes 2022-11-14 21:12:12 -05:00
Lloyd Dilley
285f06dbd2
Fix compile warnings 2022-11-04 00:52:37 -04:00
Xoduz
75250e62cb Couple more changes 2022-10-24 23:42:16 +08:00
Xoduz
37a76083de Rest of the changes for 0.99.6-RC1
Misc cleanup and standardization of style and naming conventions in code and scripts
Added missing code for showing race in paperdoll based on ini setting
Players can no longer use Polymorph spell while incognitoed, or while under effect of tribal paint
Players can no longer use Incognito spell while polymorphed, or while under the effects of tribal paint
Facial hair is now removed from players who are under the effects of Incognito spell that changes their gender for female
2022-10-24 18:39:33 +08:00
Xoduz
94233bfd52 Fix for help menu script - UOX3 0.99.5b-7
Fixed a missing definition for GetStartTime JS function which would cause an error in the help menu script
Tweaked some messages output to the UOX3 console during startup for improved clarity
2022-08-26 23:15:13 +08:00
Charles Kerr
b179216bc8 fix for invalid uo directory causing crash 2022-07-04 14:38:28 -04:00
Charles Kerr
6ec63e328a additional debug 2022-06-26 09:01:30 -04:00
Charles Kerr
75969075dd changed some values to const references 2022-06-16 08:17:28 -04:00
Charles Kerr
d5ab7269dd map and statics moved over to new updata handling 2022-06-15 11:24:57 -04:00
Charles Kerr
3f2e169d39 startup modernization 2022-06-11 07:55:06 -04:00
Charles Kerr
d03f72f1b3
Develop (#91)
* updated STARTLOCATIONDATA to use std::string, removed typedef

* removed __STARTLOCATIONDATA_ from typedef

* cleanup

* Update Prerequisites.h

* cleanup, no functional code change

* Update cdice.h

* Pull2 (#89) (#1)

* updated STARTLOCATIONDATA to use std::string, removed typedef

* removed __STARTLOCATIONDATA_ from typedef

* cleanup

* Update Prerequisites.h

* cleanup, no functional code change

* Update cdice.h

* Modernized iterator usage for Network connection iteration.  Should result in a speed increase (measurable or not)
2022-06-07 13:50:49 -04:00
Charles Kerr
d540835eb4 2022 project filters, and name change for strutil 2022-03-04 07:35:46 -05:00
Charles Kerr
5c13a51f39 added parenthesis on some simple logical and/or to make clear precedence (and eliminate warnings)
replace int with auto for some results to prevent size casting, across the different platforms (and eliminate warnings).
2022-01-18 12:24:18 -05:00
Xoduz
378d32d28c 0.99.5
Implemented Herding skill in JS (js/skill/herding.js) (Dragon Slayer)
Updated item stats like def, hp and value for all armors to match Pub15 era
Added item definitions for weapons added in AoS to ToL UO expansions, but with stats balanced against existing weapons from Pub15 era
Added armor definitions for armors added in AoS to ToL UO expansions, but with stats balanced against existing armors from Pub15 era
Added named "alias entries" for all existing item definitions of weapon, armor and clothes, which enables adding those via their names as an alternative to their IDs. Items added via the named aliases will randomize between variations (north/south vs east/west) of the items if there are any. Syntax:
	'add item [nameOfItemWithoutSpaces] (example: 'add item vikingsword)
Removed redundant files dfndata/items/gear/weapons/aos_weapons.dfn, dfndata/items/gear/weapons/se_weapons.dfn and dfndata/npc/spawntags.dfn
Split out ranged weapon projectiles into a separate DFN (dfndata/items/gear/weapons/projectiles.dfn)
Modified tooltip for armors to describe the physical defensive value as Armor Rating instead of Physical Resist
Updated console key input handling with a more robust approach for Linux (punt)
Included new and revamped JS docs, and removed old, out-of-date legacy JS docs
2022-01-12 08:33:44 +08:00
Xoduz
c4dc320719 0.99.5[RC4]
UOX3 now stores a timestamp for when an account receives its first login, which can be accessed via the new (read-only) JS Account Property .firstLogin.
UOX3 now stores a timestamp for when a player character is created, which can be accessed via the new (read-only) JS Character Property .createdOn. For legacy player characters, the creation timestamp is set the first time UOX3 loads the characters after this update.
Fixed an issue on Linux where pressing the arrow keys in the console would cause UOX3 to shut down
Updated UOX3 documentation
2022-01-10 07:33:51 +08:00
Xoduz
c9e4c29367 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
Charles Kerr
2bc886128c updated trim/ltrim/rtrim/simplify to not use regex (seems rather slow for our string sizes).
Updated to lower/toupper to be upper/lower
replaced occurrences of stripTrim with trim(removeTrailing))
replace stripComment with removeTrailing
2021-07-19 13:41:59 -04:00
Xoduz
6ca9ddc6f2 Various code/warning cleanup
Fixed an issue with ItemID skill where using the skill on a crafted item would not output a result if creator of item was unknown
Command logs now also include any parameters used with a command
Fixed an issue where messages used with CustomTarget JS function would not get truncated properly if longer than the allowed maximum length
Fixed some instances of potential buffer overrun and/or out-of-bounds memory access
Fixed some potential null pointer dereferences
Fixed a couple instances of missing breaks in switch cases
Added [[maybe_unused]] attributes in places where return values are intentionally unused
Added [[fallthrough]] attributes in places where switch case fallthroughs are intentional
Misc minor code cleanup
2021-07-04 02:26:43 +08:00
Xoduz
79447c5e09 Various changes
Fixed an issue with JS Function DeleteFile(), which would stop calling script from working if no file was found for deletion. Could break demolishing of houses, amongst other things
Fixed an issue with DoSEErrorMessage() function that prevented JS function error messages from being displayed in UOX3 console if message size was below 512
Fixed a bug that allowed players to place items on the same slot of walls when using a client that doesn't automatically restrict this
When dropping items, UOX3 will now look for a valid surface to drop them on, and move the item to said valid surface if applicable
Fixed an issue with loading of MultiCollections.uop where max boundaries of each multi was not set on load, preventing features that relied on finding corners of building from working (like automatic ban location detection for houses)
Added new function in mapstuff.cpp to check flags on dynamic items, and exposed it as a JS Function with same name and parameters:
	CheckDynamicFlag( SI16 x, SI16 y, SI08 oldz, UI08 worldNumber, UI16 instanceID, TileFlags toCheck );
Fixed an issue where items were not always properly added to/removed from map regions when picked up or dropped
Added new helper function in dist.cpp to find 3D distance between two points:
	getDist3D( point a, point b )
Added JS Function - DistanceBetween() - to find distance between two sets of coordinates, or two objects:
	DistanceBetween( x1, y1, x2, y2 )
	DistanceBetween( x1, y1, z1, x2, y2, z2 )
	DistanceBetween( sourceObject, targObject )
	DistanceBetween( sourceObject, targObject, checkZ )
Added Item JS Method - GetTileName() - to get name of an item directly from tiledata
Added new UOX.INI setting that defines the lower limit for when a purchase will withdraw money from bank instead of backpack:
	BANKBUYTHRESHOLD=2000
Split the UOX.INI setting CONSOLELOG into three parts, to enable/disable different forms of logging:
	CONSOLELOG=1/0 	// Toggles logging of console messages, warnings and errors
	NETWORKLOG=1/0 	// Toggles logging of network traffic
	SPEECHLOG=1/0 	// Toggles logging of player/staff speech
2021-06-27 23:23:31 +08:00
Charles Kerr
1792bcd1ba initial changes, ConfigOS, nullptr, PLATFORM 2021-06-12 08:02:17 -04:00
Charles Kerr
75fc56b0dd NULL to nullptr 2021-06-12 07:30:23 -04:00
Xoduz
fb2df9e7e8 0.99.4q - decorate command, welcome gump, and more
Added entry for a new directory path in uox.ini:
	SCRIPTDATADIRECTORY=./js/jsdata/ - dedicated to generic data read/written by JS scripts, data not directly linked to live content, which should not live or die by the state of the SHAREDDIRECTORY. Existing scripts will continue to write/read files in the SHAREDDIRECTORY if no changes are made.
Updated JS File Method .Open() to support an optional fourth argument (requires third argument):
	useScriptDataDir (boolean) - when this fourth argument is included as true, UOX3 will look for the file in the SCRIPTDATADIRECTORY instead of the SHAREDDIRECTORY. Third argument - folderName - is required for this fourth argument to be used. New syntaxes:
		.Open( fileName, fileMode )
		.Open( fileName, fileMode, folderName )
		.Open( fileName, fileMode, folderName, useScriptDataDir )
Updated JS File Function DeleteFile() to support an optional third argument (requires second argument):
	useScriptDataDir (boolean) - when this third argument is included as true, UOX3 will look for the file in the SCRIPTDATADIRECTORY instead of the SHAREDDIRECTORY. Second argument - folderName - is required for this third argument to be used. New syntaxes:
		DeleteFile( fileName )
		DeleteFile( fileName, folderName )
		DeleteFile( fileName, folderName, useScriptDataDir )
Added new admin command (js/commands/decorate.js) to allow saving/loading world templates. These templates are essentially text files (with .jsdata file extension) that contain the bare minimum amount of details needed to decorate an entire game world, a facet or even a specific area of a facet. The files can be bundled with UOX3 for a smoother first-time-user-experience, can be easily shared with other people as blueprints for world decoration, and they can be saved and loaded on the fly without impacting existing data on a shard. By default, the command will save/load items to/from different files per facet based on the following item categories: doors, signs, lights, moongates, teleporters, misc (everything else).
	Command syntax:
		'decorate save
			Save all items to the default templates, based on each item's objectCategory and facet
		'decorate save [objectCategory]
			Save all items of specified objectCategory, regardless of facet
		'decorate save [facetName]
			Save all items on specified facet, regardless of objectCategory
		'decorate save [customFileName]
			Save all items of all objectCategories on all facets to custom template file
		'decorate save [objectCategory] [facetName]
			Save all items of specified objectCategory in the specified facet
		'decorate save [customFileName] [facetName] x1 y1 x2 y2
			Save all items within specified coordinates on specified facet to customFileName
		'decorate load
			Load all items from the default templates, regardless of objectCategory and facet
		'decorate load [objectCategory]
			Load all items of specified objectCategory, regardless of facet
		'decorate load [facetName]
			Load all items on specified facet, regardless of objectCategory
		'decorate load [customFileName]
			Load all items from file named [customFileName]
		'decorate load [objectCategory] [facetName]
			Load all items of specified objectCategory in the specified facet
		'decorate copy [sourceFacet] [targetFacet]
			Copy all items from one facet to another
		'decorate clean
			Clean up duplicate decorations that might have been loaded/added by accident.
	Note that world templates are by default stored in and read from a subfolder named "worldtemplates" under the new SCRIPTDATADIRECTORY (which defaults to UOX3/js/jsdata/)
Added welcome gump that is displayed automatically for characters on the admin account (account 0) on first login. This welcome gump gives new shard admins the option to either start with a blank and empty world, or to load the default UOX3 world - based on the default set of worldfile templates provided with UOX3, if any. It also provides a few tips to get started, as well as links to various documentation pages, forum and Discord server. The welcome gump can also be re-opened at a later stage using a new admin command: 'welcome
Updated Item JS Method Dupe() to support passing NULL instead of a socket, for duplicating items without needing to place them in a player's backpack
2021-06-11 07:59:35 +08:00
Xoduz
52ed2376f3 Some maintenance changes
Replaced UOX_MIN and UOX_MAX with std::min and std::max (punt)
Moved StringUtility functions into a new namespace: strutil (punt)
2021-05-27 05:42:35 +08:00
Xoduz
4110086944 UString to std::tsring
More UString instances replaced by std::string and associates (punt)

Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2021-04-24 04:21:57 +08:00
Xoduz
48494090ec 0.99.4i
Fixed an error in tweak command (js/commands/targeting/tweak.js) when attempting to use it on characters with no backpacks
Updated a bunch of casts to use UOX3-specific typedefs for consistency
Startup performance is now faster by an additional 70% over the previous commit, primarily due to modernization of HandleLine() functions in cBaseobject.cpp, cChar.cpp, cItem.cpp and cMultiObj.cpp (punt)
2021-04-23 23:54:52 +08:00
Xoduz
9ea15ac7b3 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
Xoduz
17947a3cdb Misc fixes - 0.99.3a
Undid dictionary rename from ENG to ENU and FRE to FRA; these are not actual language codes, but groups of language codes - ENU covers all English language codes, FRA covers all French ones.
Refined build notes
Updated Debug Information Format for Debug x64 platform in VS project properties to Program Database for Edit and Continue
Minor fix for a half-broken system (automatic adding of items to add-menu) that needs to be revamped or removed
Commented out some thread-locking code that was causing UOX3 to crash under certain circumstances
Fixed a few cases of threads sleeping for microseconds instead of milliseconds
Replaced all calls to UOXSleep with direct call to std::this_thread::sleep_for(), and removed UOXSleep function from funcdecl.h
Fixed an issue with "Gold" ore/ingot type, which was mislabelled as "Golden" in the ORE_LIST section of skills.dfn
Fixed an issue where crafting skills might consume the wrong resource if additional resources of the same ID but different color were present in player's backpack
Improved AmbientFootsteps feature so footstep sounds are played more in tune with character movement
AmbientFootsteps now also play for NPC movement
Changed how code handles randomizing between MINTIME and MAXTIME values from region spawners; now multiplies values by 60 (to get seconds) before randomizing, instead of after, to make use of full range of seconds between the values (which are in minutes)
Adjusted default global NPC movement speeds in [speedup} section of uox.ini to use less extreme values
Added a DEBUGMOVEMULTIPLIER define in cChar.cpp used to multiply NPC movement delays by the specified value (1.75 by default) when running UOX3 in debug mode, due to reduced server performance in debug mode
Documentation updates:
	Added section on DFN tags for Character, Item, Region, SpawnRegion and Weather DFNs.
	Added Feature documentation for Mining and customizable ores
	Added More details in feature documentation for Spawn Regions
	Updated feature documentation for Dictionaries
	Added more details in UOX3 history section
2020-09-16 02:51:20 +08:00
Xoduz
e36f4a8f61 Support for compiling 64-bit version of UOX3 for Windows
Updated VS Solutions/Projects for UOX3 and SpiderMonkey to support compiling 64-bit version of UOX3 for Windows 8/10
Fixed an issue in cConsole.cpp that prevented compiling 64bit version of UOX3 for Windows
2020-09-09 09:55:56 +08:00
Xoduz
166d3b0119 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
Xoduz
c4e94f4e23 Additional warning cleanups
Additional warning cleanups
2020-08-26 21:55:51 +08:00
Xoduz
f63f54a9e7 Compilation fixes for Linux
Misc changes to address errors and warnings when compiling on 64bit Linux
	%li changed to %i
	%lu changed to %u
	Some (SERIAL) changed to (UI64)
	Some size_t changed to UI32
2020-08-13 21:48:27 +08:00
Xoduz
3e8006c648 Code cleanup
Embraced the usage of R32, R64, SI16, UI16, SI32, UI32, SI64 and UI64 typedef aliases as replacement for built-in types throughout the sourcecode:
	typedef float				R32;
	typedef double				R64;
	typedef signed char			SI08;
	typedef unsigned char		UI08;
	typedef signed short int	SI16;
	typedef unsigned short int	UI16;
	typedef signed int			SI32;
	typedef unsigned int		UI32;
	typedef signed long long	SI64;
	typedef unsigned long long	UI64;
As part of this process, UI32 was redefined from unsigned long int to unsigned int, and SI32 from signed long int to signed int to ensure the size of variables using these remain the same (32bit) across both Windows, Linux and MacOS for both 32bit and 64bit platforms
Replaced instances of toLong() with toInt(), and toULong() to toUInt()
Replaced instances of "long" and "int" with SI32 where possible
Replaced instances of "unsigned long" and "unsigned int" with UI32 where possible
Replaced instances of "float" with R32 where possible
2020-08-12 23:46:33 +08:00
Xoduz
342385d2f2 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
Xoduz
91be27b734 Added a check for compiler to fix 64bit Linux compiling
NT

Co-Authored-By: Charles Kerr <punt1959@users.noreply.github.com>
2020-04-20 20:40:49 +08:00
Xoduz
35a19f9b01 Preparation for dragging UOX3 kicking and screaming into the 64bit Century
Filepaths to spidermonkey in MSVC project are now relative to source folder
Default language standard in MSVC project set to stdcpp17
2020-04-20 20:05:56 +08:00
Xoduz
9cdf5e2249 Z-movement fixes, pet following, criminal flag
Fixed an Z-movement issue where NPCs could fall through upper-story floors of buildings and start walking at ground level instead
Movement speed of pets and other NPCs following the player out of combat increased by 1.5 to make it easier for them to keep up
Pets will now teleport to keep up with their owners if pathfinding fails
NPCs with EVIL flag set, who highlight in red, will no longer highlight in grey if they are flagged as a criminal
Criminal timer (and murder count decay) now keeps ticking even while a player is dead
Fixed a spelling error in console.cpp
Made Earthquake spell resistable
Restored some code in magic.cpp that caused errors when casting spells
2020-04-12 22:32:08 +08:00
Xoduz
4d471f9b4c Additional function parameters passed as const references
Additional function parameters passed as const references
2018-09-22 02:02:48 +08:00
Xoduz
2a1e3685a6 More code cleanup, new JS commands
Some more code cleanup
Documented temp effect cases in code
Added SETAMMOEFFECT, SETAMMOTYPE, GETAMMOEFFECT, GETAMMOTYPE, REGIONINFO and XREGIONINFO commands to misc-cmd.js
2018-09-22 00:47:12 +08:00
Xoduz
a5da577d4d Misc code cleanup
Resolved an issue with uninitialized struct members
Removed some redundant conditional checks
Made the boolean part of JS function RegisterSkill( <skillnum>, <bool> ) actually work; can now be used to disable/enable JS-implemented skills
Fixed a bug with cHTMLTemplate::Process() where the same expression was used for both branches of a ternary operator
Various minor cleanups; removed some unused variables, addressed some potential portability issues
2018-09-19 18:43:11 +08:00
Xoduz
c900f694fa Cleanup and a bugfix
Cleaned up some old files, and updated some that were out of date
Fixed tooltips not updating properly on containers as items are added/removed
2018-09-09 02:32:06 +08:00
Geir Ove Alnes
e1d376a1fd Updating CVS to bring it up to speed with latest UOX3 version - 0.99.2 2012-11-03 18:11:04 +00:00
Matthew Randall
afc0c8e0ac 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
Matthew Randall
071d628994 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()
  -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

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)
2003-03-14 23:23:37 +00:00
Matthew Randall
d7dd262a67 Sorry everyone, guess I let some bad lines slip in the merge *cough* yea thats it:) Anyhow thanks malketh... 2003-03-10 23:40:08 +00:00