Commit graph

172 commits

Author SHA1 Message Date
Dragon Slayer
d86725cd43 feat(magic): support configurable spellbook expansions
Make spell and spellbook ranges data-driven so custom schools can extend beyond the original Magery limits.

- add SPELLBOOKDATA persistence and use configured spell/scroll ranges across book lookup, display, packets, scroll drops, and casting
- load spell definitions by their highest configured ID and widen spell IDs through core and JavaScript event paths
- support section-based custom reagents with optional amounts and colors, including JavaScript inspection
- add script-owned temporary effects with pause, resume, removal, and expiration callbacks
2026-07-22 16:01:21 -05:00
Xoduz
d355c4d946 Pathfinding update
- [UPD] UOX3 now supports Z as a third dimension for NPC pathfinding; automatically used in most places in code, it can also be triggered via .WalkTo() and .RunTo() JS Methods, which have been updated to support target Z coordinate. This means NPCs can now navigate up and down stairs, move between floors of buildings, etc.
- [UPD] NPCs will recalculate their path less often now in situations with little-to-no change since last they got a valid path, if they still have remaining steps in their previously calculated path. However, the more time passes from the original pathfind calculation, the more likely it is to retrigger.
- [UPD] Updated 'xwalk and 'xrun GM commands (js/commands/targeting/xwalk.js), hireling AI (js/npc/ai/hireling.js) and Herding skill (js/skill/herding.js) to make use of "3D pathfinding"
- [FIX] Fixed some issues with pathfinding code that could result in invalid results for what should be valid paths
2026-04-26 21:13:48 +08:00
Dragon Slayer
4f61273e3f Couple Fixes
- [FIX] Fixed Guests was not showing correctly on the housesign counts
- [ADD] Added AddVendor and RemoveVendor to the js methods so we could fix the issue where the player vendors was not being registered to the house when placed, I also added the changes to rmeove.js house.js housecommands.js and playervendordeed.js
2026-03-09 14:36:07 -05:00
Xoduz
c690738db3 Fix for AddXMFHTMLTok
- [FIX] Fixed a client crash related to AddXMFHTMLTok Gump Method not sending correct number of non-empty cliloc arguments with gump command
2026-02-01 04:07:10 +08:00
Xoduz
24fd1c49c1 Fix for custom gumptype and reduction of log spam
- [FIX] Fixed an issue with how custom gump type properties were saved to worldfiles, which would lead to a crash on next world load
- [UPD] Disabled logging of unknown JS object properties for now, as log message would also trigger for usage of JS object methods
- [UPD] Wrapped CustomTarget console warning in a debug define so it doesn't spam console/log file in release mode
2026-01-23 22:26:58 +08:00
Dragon Slayer
ecccaa3e2b updates 2025-11-09 16:44:30 -06:00
Dragon Slayer
b9fef6de1f New Race Function
- [ADD] Added CanEquip that checks if members of race can equip specified item (Thanks , Xuri).
2025-11-05 20:32:45 -06:00
Xoduz
9359970ba0 Added server restart functionality
- [ADD] Added functionality to trigger a server restart from within UOX3, either via console ('R'), command ('restart) or JS Console Method (.BeginRestart()). This will first perform a world save, then do a clean shut down before restarting UOX3 in a new process
2025-10-24 16:13:17 +08:00
Dragon Slayer
7350c4a2fa WalkTo & RunTo Bug Fix
-[FIX] Fixed WalkTo was missing the if( argc < 2 || argc > 5 ) line.
-[FIX] Fixed Debug Msg for RunTo Said WalkTo instead of RunTo.
2025-08-10 00:07:47 -05:00
Xoduz
3c4b014d92 Guild-specific updates
- [ADD] Integrated FindGuildId( const CGuild* ) in guild relation functions for better JS mapping (Thanks to Xuri for the base implementation)
- [ADD] Added new JS Function:
 - CreateNewGuild() // Returns the guild object for further setup
- [ADD] Added new Guild JS Methods: .AddMember( targChar ), .AddRecruit( targChar ), .RemoveRecruit( targChar ), .RemoveMember( targChar ), .RecruitToMember( targChar ), .IsAtWar( targetGuild ), .IsAlly( targetGuild ), IsNeutral( targetGuild )
	Added documentation entries for all new guild/character functions and methods
- [ADD] New JS Event that triggers when GUILD button in paperdoll is pressed:
 - onGuildButton( mChar )
- [ADD] Added new Guild JS Property: .id (guild number)
- [ADD] Added new Character JS Property: .guildNumber
- [UPD] Updated Guild JS Methods and renamed them:
 - Renamed .NewMember( trgChar ) to .AddMember( trgChar )
 - Renamed .NewRecruit( trgChar ) to .AddRecruit( trgChar )
 - Renamed .GuildIsAtWar( targetGuild ) to .IsAtWar( targetGuild )
 - Renamed .GuildIsAlly( targetGuild) to .IsAlly( targetGuild )
 - Renamed .GuildIsNeutral( targetGuild ) to .IsNeutral( targetGuild )
- [UPD] Removed Character JS Method .CheckGuild(). Can be checked via .guild and/or .guildNumber properties
- [UPD] 'get command can now be used to fetch guild information for characters. Example: 'get guild / 'get guildnumber
- [UPD] Updated 'add item sectionID command to support optional amount. New syntax: 'add item sectionID amount
- [FIX] Fixed an issue with 'wholist command where characters with serials in the millions would not show up in the list
2025-08-05 04:05:43 +08:00
GO
ddb937e7d8
Merge branch 'feature/GECKO20b12_2011022218_RELBRANCH' into Guild-Methods 2025-07-21 17:24:35 +08:00
strattond
2e18133026 Merge remote-tracking branch 'origin/develop' into feature/GECKO20b12_2011022218_RELBRANCH 2025-07-10 09:02:58 +10:00
Xoduz
0ca218cbd6 Added support for large radio/checkbox button IDs
Added [Tame] and [Bonded] to character tooltips of tame/bonded animals and updated Dictionary files
Updated .AddRadio() and .AddCheckbox() Gump Methods to support 32-bit unsigned int for the buttonID
2025-07-09 01:17:59 +08:00
strattond
c61a6e0113 I broke it, I bought it 2025-07-04 14:37:00 +10:00
strattond
afc59dd0a9 Merge from origin/develop. Fix compile error in cScript.cpp 2025-07-04 08:39:28 +10:00
Xoduz
2e0af73968 Poison fixes
Fixed an issue with poison damage in combat where the poison resist of the attacker was checked instead of that of the defender
Fixed an issue where the poison details in tooltip of an item would only be visible when equipped, and not visible when kept in backpack
Fixed an issue where if a weapon was destroyed due to corrosion damage, it would not unset the poison strength on the character who wielded it
Added new Character/Item property to track the source (serial) of poison applied to an object. This is available as a JS Char/Item property:
	.poisonedBy // serial of character who applied poison to an object. Set to 0xFFFFFFFF/SE_INVALIDSERIAL() to clear
Updated all code and scripts related to setting/unsetting poison effect on objects to also update the .poisonedBy property
Serial of character who poisoned a character who died while poisoned is now stored on the corpse
Added third optional parameter to Character JS Method .SetPoisoned() that can be used to specify source char of applied poison. New syntax:
	.SetPoisoned( poisonLevel, wearOffTime[, poisonSourceChar ])
2025-07-04 01:17:04 +08:00
Xoduz
e38be292e3 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
Xoduz
30ddfefd51 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 09:04:16 +08:00
Dragon Slayer
a5e932309f
Merge branch 'feature/GECKO20b12_2011022218_RELBRANCH' into Guild-Methods 2025-06-03 18:21:51 -05:00
strattond
c3f6992148 Merge remote-tracking branch 'origin/develop' into feature/GECKO20b12_2011022218_RELBRANCH 2025-06-04 05:51:35 +10:00
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
strattond
387e0698a7 Merge from origin/develop 2025-05-14 07:45:50 +10:00
strattond
81bb404972 Merge from origin/develop 2025-05-13 06:58:53 +10:00
Xoduz
38691b1c59 More updates
Updated global script (js/server/global.js) to make use of onUseBandageMacro() to enable usage of bandage macros in client
	Overhaul of Healing skill (js/skill/healing.js and js/skill/healing_slip.js) with fixes and improved era support. Script now includes some options that can be modified at top of script to override era-specific behavior. Summary of changes:
		Healing actions are now difficulty based:
			Resurrect chance scales from 25% (min 80.0 primary/secondary skill) to 65% at avg 100.0 skill to 100% at avg 120.0 skill
			Cure chance scales from 80% (min 60.0 primary/secondary skill) to 92% at avg 100.0 skill and 100% at avg 120.0 skill, and is reduced by 10% per level of poison on target
			Upper difficulty for Healing skill checks now changes based on % loss of health on target and based on its maxhp, so to continue gaining skills from healing, one needs to heal targets with higher and higher % of their health lost
			For T2A core shard era, healing can only bring player to ~65.0 skill, curing can bring player from 60.0 to ~85.0 skill, and resurrection can bring player from 80.0 to 100+ skill.
			For UOR and beyond, healing damage can bring player all the way to GM skill and beyond, without need to cure/resurrect
		Base amount of damage healed with bandages in SE era and beyond adjusted to 36-60, compared to 43-80 for AoS and below
		In HS era and beyond, min 80.0 primary and 80.0 secondary healing skill will now trigger attempt at curing poison/bleed at half normal heal duration (but with lower chance of success). If it succeeds, amount of health healed is reduced proportional to strength of poison cured. If it fails, another cure attempt is made after the heal.
		Mortal Strike now blocks heal attempts on a target, but not attempts to cure poison/bleed
		Fingers slipping due to being attacked while bandaging now has a higher threshold to take place for SE era and beyond, and scales further based on dexterity in HS era and beyond - while AOS era and below has a very low threshold for this
	Updated .CheckSkill() Character JS Method to support another parameter which can force the result of a skillcheck (-1 = failure, 0 = use skillcheck result, 1 = success):
		.CheckSkill( skillNum, minSkill, maxSkill[, isCraftSkill, forceResult ] )
	Updated onSkillCheck() JS Event with another parameter, with the value of the optional forceResult parameter in CheckSkill()
		onSkillCheck( pUser, skillID, lowSkill, highSkill, forceResult )
	Fixed an issue where skill caps for player characters were not correctly initialized, resulting in unpredictable behavior
	Fixed an issue with mana regen timer for MANAREGENMODE=1 (LBR and below) where timer was never adjusted
2025-05-12 07:12:34 +08:00
Xoduz
8394c056c1 WIP
WIP
2025-05-10 18:27:06 +08:00
Xoduz
223c557e2c Couple of new JS events, crash fix
Added new JS Event that triggers when dismounting
		onDismount( pUser, npcMount )
	Added four new JS Methods for Characters/Items:
		.PauseTempEffect( tempEffectID ) // pauses selected temp effect indefinitely until resumed/killed
		.ResumeTempEffect( tempEffectID ) // resumes selected temp effect, if paused, and extends original effect timer to account for paused time
		.PauseJSTimer( timerID, scriptID ) // pauses JS timer based on provided timerID and scriptID
		.ResumeJSTimer( timerID, scriptID ) // resumes JS timer based on provided timerID and scriptID
	Renamed previously added JS Method RevertEffect to RevertTempEffect	(code change only, script was always the latter)
	Fixed issue that prevented 'xrun command from working (js/commands/targeting/xwalk.js)
	Fixed an exception related to loading in data from jails.wsc on startup
	Fixed an exception related to periodic check/release of prisoners from jail
2025-05-08 00:57:18 +08:00
strattond
bd31be3db2 Merge from origin/develop 2025-05-05 08:10:05 +10:00
Xoduz
a140199853 Minor pathfinding revamp plus misc fixes
Updated target-based 'wipe command to also affect valid NPCs (non-invulnerable, non-pets) (js/commands/wipe.js)
	NPC admin gump (js/commands/wholist.js) will now force-refresh on next open after NPCs have been removed via the remove button in the menu
	Spawn Object admin gump (js/commands/spawnadmin.js) will now force-refresh on next open after spawn objects have been removed via the remove button in the menu
	Added three new GM commands (js/commands/targeting/xwalk.js) that can be used to control NPCs remotely:
		'xwalk	// Makes targeted NPC pathfind and walk to target location
		'xrun	// Makes targeted NPC pathfind and run to target location
		'xturn	// Makes targeted NPC turn towards target location
	Updated AdvancedPathfinding() in movement.cpp to include two optional parameters
		allowPartial // if true, move even if calculated path is blocked, until blocked (defaults to false)
		ignoreDoors // if true, ignore doors during pathfinding calculations and calculate the path is if the door was not there (defaults to false)
	Updated .WalkTo() and .RunTo() JS Character Methods to support the two additional pathfinding parameters, and also to support maxSteps values beyond 255
	Updated pathfinding heuristic from Manhattan (4-way) to Octile (8-way) distance for improved pathfinding accuracy and increased performance with diagonal movement
	In some situations, UOX3 will now calculate a new partial path for NPCs who failed to follow their assigned path, to get them closer to their final destination
	Optimized pathfinding logic for NPCs following a target (like pets/hirelings, or NPCs in combat), to reduce the amount of pathfinding calculations required when target is moving. The NPCs will now keep track of the general direction towards their target, and if the NPCs are already heading in the right direction, they'll  keep going as long as they have a path left to follow or until direction towards target has changed. This also eliminates a problem where NPCs would stick to their path until they reach the end, even if target has gone in a different direction.
	Updated logic for how NPCs turn during pathfinding. Instead of adding an extra "push" for direction into the calculated path itself to ensure NPC will both turn and move in that direction, which allowed some inaccuracies to creep into the calculated paths, that extra push is now handled while NPC is executing the path instead, whenever direction changes are needed
	Partial pathfinding is now enabled for fleeing NPCs by default, to increase their chances of getting further away from their opponent in combat
	Partial pathfinding is now enabled for NPCs in water by default, to allow them to get as close as possible to their opponent in combat
	Fixed an issue where NPC movement speeds would misbehave at certain speeds where the calculated movement time would get rounded down to zero
	NPCs will now play a fidgeting animation if they've remained motionless for 3 seconds or more while not in a state of actively trying to move/pathfind
	Increased max pathfinding steps for NPCs in combat from 50 to 75
	Fixed an issue where NPCs would stop and wait when they should have been moving, after successful pathfinding calculation
	Fixed an issue where NPCs that ignore a target and enter evade state would not leave combat
	Added two new JS Character properties that can be used to evaluate pathfinding success (for instance in combination with onPathFindEnd Event), and/or opens for manipulating pathfinding target locations via scripts:
		.pathTargX // Current NPC pathfinding target, X coordinate
		.pathTargY // Current NPC pathfinding target, Y coordinate
2025-05-05 00:03:09 +08:00
strattond
6d91f9d7aa Merge from origin/develop 2025-04-30 08:56:23 +10:00
Dragon Slayer
124908e510
Merge branch 'feature/GECKO20b12_2011022218_RELBRANCH' into Guild-Methods 2025-04-27 16:59:50 -05:00
strattond
0519d2d788 Fix link problem 2025-04-28 06:06:38 +10:00
strattond
7665b99769 Merge from origin/develop 2025-04-28 05:54:32 +10:00
Xoduz
46874dab04 Small fixes
Small fixes
2025-04-27 11:13:58 +08:00
Xoduz
b129521c9e 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
Xoduz
5fbeb04f2b Misc Fixes and Updates
Added support for MAXWEIGHTBONUS DFN tag for races, to allow increasing weight that can be carried by specific race, and a new GetWeightMax() code function to do the necessary calculations on demand
Updated [default race bonuses] UOX.INI section with the following new settings for the 3 default playable races (only used if nothing else specified in races.dfn):
	HUMANMAXWEIGHTBONUS=0
	ELFMAXWEIGHTBONUS=0
	GARGOYLEMAXWEIGHTBONUS=0
Added support for ALLSKILLSG and ALLSKILLSL DFN tags for races, which allow defining skill bonus or loss across all skills for a given race
Added new Character JS Method for adding skill points without triggering skillchange JS Events:
	.AddSkill( skillID, skillAmt, triggerEvents[true/false] )
Added new Boat JS Property to allow getting/setting movement types for Boats via scripts:
	.moveType // See UOX3 JS Engine Docs > JS Object Properties > Multi Properties for a detailed list of all supported movement types
Added new Boat JS Method to allow turning boats via scripts:
	.TurnBoat( turnDir ) // 0 = straight (no turning), 1 = turn left, 2 = turn right, 3 = flip around
Updated IterateOver/OnIterate JS Function/Event to support passing in optional socket parameter. New syntax:
	IterateOver( objectType[, socket ]);
	.OnIterate( sourceObject, targetObject, socket )
Updated Character/Item JS Method .Refresh() to support an optional socket argument, to specify which player to refresh the object for. New syntax:
	.Refresh( [socket] )
Added support for new region setting that can define a region as disabled/enabled via DFN (tag) or script (JS property). Disabled regions will be ignored by UOX3:
	DISABLED=0/1 // Region DFN tag
	.isDisabled // Region JS Property
Fixed issue where JS tags and temporary JS tags would not be copied over when duplicating a character or item
Removed strength requirements from base shield definitions - stats like these are handled per era (dfndata/items/gear/armor/base_armor.dfn)
Fixed an issue where necromancer newbie armor would incorrectly inherit base versions of leather armor without stats (dfndata/items/gear/armor/leather_armor/leather.dfn)
Fixed an issue where players would not correctly leave combat after hiding (js/skill/hiding.js)
Fixed an issue with Healing skill where skill-checks for healing/veterinary would fail due to a misspelled variable (js/skill/healing.js)
Updated smart-turn furniture script to prevent players from being able to turn furnitures that are occupied by characters (js/server/misc/furniture_smartturn.js)
Updated Buff-bar script to only add buffs for client versions higher than 5.0.2, the client patch where this feature was added (js/server/network/0xDF_buffBar.js)
Updated Vendor BDO Dispenser script to add alternative reward-table for AoS era (js/npc/ai/vendor_bdo_dispenser.js)
Cleaned up some code (spaces to tabs, indentation, spacing)
2025-04-23 00:01:53 +08:00
strattond
4a07b8c177 Merge from origin/develop 2025-04-22 13:37:57 +10:00
Geir Ove Alnes
3d1ea6ac00
Merge branch 'develop' into AOS-Properties-Regenation 2025-04-20 07:10:35 +08:00
Xoduz
82f473f00a Rework of passive stat regeneration
Updated code calculating passive health, stamina and mana regeneration for characters, based on new UOX.INI settings and bonuses from characters/items/races
	Added three new Character/Item/Race DFN tags to grant bonus health/stamina/mana regeneration:
		HEALTHREGENBONUS=# 	// 10 bonus points equates to 0.01 extra hp regen per second, independent of era
		STAMINAREGENBONUS=# // 10 bonus points equates to 0.05 extra stamina regen per second
		MANAREGENBONUS=# 	// 10 bonus point equates to 0.1 extra mana regen per second
		...also available as JS Properties:
			.healthRegenBonus
			.staminaRegenBonus
			.manaRegenBonus
	Updated get/set JS commands to allow getting/setting regen bonuses for health, stamina and mana
	Updated races.dfn to include default +2 health regen bonus for humans, and +2 mana regen bonus for gargoyles.
	Added new UOX.INI settings under [Skills and Stats] section:
		HEALTHREGENMODE=1 	// 0 = no passive health regen, 1 = default passive health regen
		STAMINAREGENMODE=1 	// 0 = no passive stamina regen, 1 = default passive stamina regen (LBR or below), 2 = AoS or beyond, 3 = SA and beyond
		MANAREGENMODE=1 	// 0 = no passive mana regen, 1 = default passive mana regen (LBR or below), 2 = AoS (Pub17), 3 = AoS/SE (Pub18 and beyond), 4 = ML, 5 = KR, 6 = SA and beyond
		HEALTHREGENCAP=#  	// Max cap for Health Regeneration Bonus stat per character
		STAMINAREGENCAP=# 	// Max cap for Stamina Regeneration Bonus stat per character
		MANAREGENCAP=#		// Max cap for Mana Regeneration Bonus stat per character
	Added new UOX.INI section ([default race bonuses]) with the following new settings for the 3 default playable races (only used if nothing else specified in races.dfn):
		HUMANHEALTHREGENBONUS=0 	// default health regen bonus for human race (2 from ML expansion onwards)
		HUMANSTAMINAREGENBONUS=0 	// default stamina regen bonus for human race
		HUMANMANAREGENBONUS=0 		// default mana regen bonus for human race
		ELFHEALTHREGENBONUS=0 		// default health regen bonus for elf race
		ELFSTAMINAREGENBONUS=0 		// default stamina regen bonus for elf race
		ELFMANAREGENBONUS=0 		// default mana regen bonus for elf race
		GARGOYLEHEALTHREGENBONUS=0 	// default health regen bonus for gargoyle race
		GARGOYLESTAMINAREGENBONUS=0 // default stamina regen bonus for gargoyle race
		GARGOYLEMANAREGENBONUS=0 	// default mana regen bonus for gargoyle race (2 from SA expansion onwards)
	Updated UOX3 Documentation with new feature section on Stat Regeneration with details on stat regeneration rules and recommended settings per UO era
	Added support for Medable armors (have no effect on meditation skill and/or passive regen of mana when worn) and Mage Armors (can turn non-medable armor into medable armor)
		These properties are defined per armor piece using the first and second bits of the MORE property:
			MORE=0x1 0x0 0x0 0x0 // Medable Armor
			MORE=0x0 0x1 0x0 0x0 // Mage Armor
		The following armor types have been marked as medable by default:
			leather armor, leather ninja armor, leather samurai armor, leaf armor, gargish cloth armor, gargish leather armor and all hats and masks
	Updated JS Method .Defense() to support optional fourth and fifth parameters - excludeMedableArmor (true/false) and includeShield (true/false)
	Updated CalfDef function to support including shields in the calculations, and updated mana regen code to include shields when checking for equipped armor
	Updated Meditation skill JS script to exclude medable armor from armor check, include shields, and apply different rules for active meditation depending on mana regen mode
	Updated stat window to include defensive rating of shields (based on Parrying skill) and/or elemental resistances (if enabled in ini)
	Added a new property to CRace class, which is automatically set and incremented as UOX3 loads in races from races.dfn: raceID
	Added new Getters/Setters for CRace class to retrieve ID of a specific Race object
	Updated JS property .id for Race JS Object to return new race ID instead of iterating through list of races to compare race object and return index
	Reloading DFNs now also reloads Races
2025-04-20 06:05:44 +08:00
Dragon Slayer
a635915fa8 Updates to guild exposing 2025-04-14 23:26:42 -05:00
Dragon Slayer
8d13aeb316 New Methods and Functions
NewMember,
NewRecruit,
RemoveMember,
RecruitToMember
Functions
IsAtWar
IsAlly
IsNeutral
2025-04-13 18:27:00 -05:00
strattond
fa8d2014c3 Reserved slot cleanup, debug prints 2025-04-06 20:52:27 +10:00
strattond
2089a79b2d Make an attempt to eliminate global object requirement 2025-04-06 16:16:38 +10:00
strattond
7a9fa7fb78 Keep removing Global Object changes 2025-04-02 13:27:24 +10:00
strattond
8d89c1969d Try and fix callbacks 2025-04-02 12:58:23 +10:00
strattond
6d5bacea9c Cleanup. Try to fix callback scoping 2025-04-02 09:43:41 +10:00
strattond
8a513d80eb Don't change global objects. Fix up constructors 2025-03-31 12:29:16 +10:00
strattond
4c053f22d1 Compile = success, right? 2025-03-28 13:23:59 +10:00
strattond
11d2dbc751 Now down to linker errors 2025-03-28 13:12:02 +10:00
strattond
c844923574 Fix up JScript project. Eliminate more compile errors 2025-03-28 12:27:44 +10:00
strattond
bff2ee60e0 Goodbye Extended Class and equality 2025-03-28 10:23:27 +10:00