Commit graph

121 commits

Author SHA1 Message Date
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
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
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
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
6b4b12b35a updated luck 2025-03-08 20:29:52 -06:00
Dragon Slayer
426f816cf8 Added Luck
Added Changelog for Luck
Added Document for Luck
2025-03-08 15:43:24 -06:00
Dragon Slayer
f4669f8749 Small adjustments 2025-02-22 23:31:40 -06:00
Dragon Slayer
171ca17564 First Submit
Added new Save methods for AOS props
2025-02-22 23:08:41 -06:00
Dragon Slayer
5c03abe17c
Merge branch 'develop' into durabilitypr-replacement 2025-01-28 20:11:05 -06:00
Geir Ove Alnes
9812074558
Merge branch 'develop' into Lower-Requirement-AOS-Propertie 2025-01-26 01:36:30 +08:00
Geir Ove Alnes
d002b87a9b
Merge branch 'develop' into leech-aos-propties 2025-01-25 16:36:20 +08:00
Geir Ove Alnes
c3f153ff3c
Merge branch 'develop' into Hit/Defense-Chance-Bonus 2025-01-25 15:56:06 +08:00
Dragon Slayer
1fd3a5a0f7
Merge branch 'develop' into leech-aos-propties 2025-01-18 11:52:55 -06:00
Dragon Slayer
3465ffa7d7
Merge branch 'develop' into Hit/Defense-Chance-Bonus 2025-01-18 11:02:27 -06:00
Dragon Slayer
cff7dc832c
Merge branch 'develop' into Three-New-AOS-Props 2025-01-18 10:51:11 -06:00
Dragon Slayer
14ac6f5060 update
Moved to citems from cbaseobjects sinc ethis can only be added to items.
2025-01-16 23:55:15 -06:00
Dragon Slayer
8ad410fe92
Merge branch 'develop' into Lower-Requirement-AOS-Propertie 2025-01-16 23:44:12 -06:00
Dragon Slayer
022612f19d fixed pr 2025-01-16 21:30:32 -06:00
Daniel Stratton
2ecc3d28fc
Merge branch 'develop' into SHIELD-TYPE 2025-01-17 12:23:09 +10:00
Dragon Slayer
6583a518df Revert "Moved Leech Props"
This reverts commit 41c7ee4676.
2025-01-16 19:09:59 -06:00
Dragon Slayer
41c7ee4676 Moved Leech Props
Moved Leech props to just items
2025-01-16 18:36:53 -06:00
Dragon Slayer
465e6e8dca Update cItem.cpp 2025-01-15 21:39:56 -06:00
Dragon Slayer
0f49d28020 Moved from base to item
Moved from cbase to citem
2025-01-14 16:11:19 -06:00
Dragon Slayer
da9267ac98 Added AOS Leech Properties 2024-06-18 18:28:50 -05:00
Dragon Slayer
2694dbc502 Match uox3 Style 2024-06-16 18:57:27 -05:00
Dragon Slayer
363ce296c4 Hit/Defense Chance Properties 2024-06-14 14:38:03 -05:00
Xoduz
b45e4bce48 Minor update
Regen function/property names updated to be more in line with existing naming conventions
Fixed an issue where health regen setting would be loaded for both health, stamina and mana when parsing uox.ini
2024-06-08 17:03:16 +08:00
Dragon Slayer
230fa75b41 Update cItem.cpp 2024-05-26 00:16:03 -05:00
Dragon Slayer
dced9eb03d Update cItem.cpp 2024-05-26 00:14:05 -05:00
Dragon Slayer
231eed38c2 New Shield Type 107
Added New Shield Type 107
2024-05-13 19:20:10 -05:00
Dragon Slayer
2cec24c989 Three New AOS properties 2024-05-13 19:01:20 -05:00
Dragon Slayer
18b338bb79 Fixed cast 2024-05-11 20:17:11 -05:00
Dragon Slayer
0c69a3a11b Fixed cast 2024-05-11 20:15:52 -05:00
Dragon Slayer
a2bffa9900 fixed cast
fixed cast and added it to npcs.cpp so it can be used on them as well.
2024-05-11 18:51:40 -05:00
Dragon Slayer
27461c908a Added ArtifactRarity
-ARTIFACTRARITY=#
	-Artifact Rarity is an item property that is visible on some artifacts and meant to give players an idea of how rare the item is. Items with rarity 1 are supposed to be common while rarity 12 are extremely scarce.
2024-05-09 20:22:58 -05:00
Dragon Slayer
94156fe62d fixed small detail 2024-05-09 20:04:33 -05:00
Dragon Slayer
3f5efab632 Lower Requirements Propertie
Added AOS Lower Requirement propertie.
2024-04-30 23:29:39 -05:00
Dragon Slayer
6b542d512e AOS Properties Regenation 2024-04-30 13:46:57 -05:00
Dragon Slayer
fd58f7cc75 Fixed a potential server crash
Fixed a potential server crash issue related to keeping track of which players have opened which containers
2023-11-26 14:00:25 -06:00
charles
e2cfe011c6 Stream replacement
This changes all routine calls that wanted a specific type of stream ifstream/ofstream to the generic istream/ostream.  So you can use stringstream, or other derived types.
2023-08-27 21:42:47 -04:00
Lloyd Dilley
f4e7e35640
Adjust tab width and parentheses placement 2023-07-09 11:30:26 -04:00
Lloyd Dilley
cf28051ac3
Update cItem.cpp 2023-07-08 15:54:32 -04:00
Lloyd Dilley
bdf3e2192c
Fix compile warnings 2023-07-08 14:25:04 -04: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
Xoduz
6a8c09bb15 Thief Revamp - 0.99.6-RC5
Added script for NPC guildmasters (js/npc/ai/guildmaster.js). Only one NPC guild has been setup in the script so far (more can be easily added) - the Thieves Guild - which if joined grants players the ability to steal from other players and to buy disguise kits
Added two new NPCs, which there will now spawn one of in a random location in each city in Britannia (felucca facet):
	m_thief_guildmaster (dfndata/npc/male_human.dfn)
	f_thief_guildmaster (dfndata/npc/female_Human.dfn)
Added two new character properties to keep track of which NPC guild a player (or NPC) belongs to. These properties have been exposed as the following Character JS properties:
	.npcGuild 		// ID of NPC guild, as defined in script
	.npcGuildJoined // Timestamp for when player joined NPC guild
Added script for Disguise Kits (js/item/disguisekit.js). These allow members of the Thieves Guild to disguise themselves from the prying eyes of other players.
Added two new character properties:
	.isDisguised 	// true/false flag for character being disguised
	.origName 		// used to store character's original name before disguise went into effect
Moved implementation of Stealing skill from code to script (js/skill/stealing.js) and revamped it completely in the process. Changes include:
	New features:
		Town rare stealing - any item marked as "special stealable" with new item property .stealable can be stolen, even if it's locked down by a GM on the ground, or inside a container
		When stealing from item piles, thief can potentially steal the amount of items that makes up the max weight limit for what they can steal, from those piles
		Chance to successfully steal is now affected by whether there are any characters (NPCs or Players) that witness the attempt. Depends on distance to character, and direction character is facing
		Players now become "permagrey" when successfully stealing from another player, regardless of whether it's witnessed
		Players now receive a "stealing" flag when stealing from another player, regardless of whether it's witnessed
		Stolen items cannot be removed from thief's backpack for 30 seconds following the theft of the item (AoS core shard era and above)
		Optional AoS feature to steal special consumable items from monsters
	Updated default stealing rules:
		Updated calculations to determine chance of success when stealing
		Players cannot steal while engaged in combat
		Players are revealed if hidden as soon as they use the stealing skill
		Players can no longer steal items in the secure trade window
		Players can no longer steal items from NPC shopkeepers
		Both hands must be free to steal
		Stealing now checks line of sight to target player/object
		Only members of Thieves Guild (NPC guild) can now steal from other players, unless they are guild enemies
		Players can no longer steal from NPC guards by default
		Players can no longer steal from the same NPC monster more than once
		Only gold and gems can be stolen from innocent players in dungeon/ll areas of Felucca, if core shard era is set to AoS or higher
		Players can no longer steal items held on cursor by other players
		Orcish masks now eplode if player steals from orcs while wearing it
		If core shard era is set to LBR or lower, player is marked as an aggressor if they steal from another player
		Guards can only be called on players that are flagged as criminals within the first 10 seconds of them being flagged
	Stealing script options:
		Allow stealing entire containers (off by default pre-AoS)
		Return stolen items on thief death (off by default)
		Temporarily make stolen items immovable in thief's backpack (on by default post-AoS)
		Temporarily protect traded items (on by default)
		Let dexterity affect chance for successful theft (off by default)
		Let light level affect chance for successful theft (off by default)
		Allow stealing from NPC Guards (off by default)
		Allow stealing special loot from monsters (on by default post-ml)
Moved implementation of Snooping skill from code to script (js/skill/snooping.js), with some changes:
	Players cannot snoop pack animals from inside a house, if the animal is outside
	The deeper inside main backpack a container sits, the harder it becomes to snoop inside it
	Included an optional feature that lets targets of snooping gradually become more aware, increasing the difficulty of succeeding. This awareness fades over time.
	Players have a chance to stay hidden while snooping, based on their Hiding skill
	Karma is now lowered by snooping regardless of success or failure
Added tracking system for "aggressors" in combat. A player attacking someone (regardless of flag status) will be marked as aggressor to that someone for 2 minutes
Added tracking system for "permagrey" flags - these are stored on a per-target basis, so a player can be flagged visibly as permagrey to multiple other players. Persists until player dies.
Player combat targets and war mode are now cleared on logout
Players will now be unable to hide if within visual distance and in line of sight of their attacker or current target in combat
Server leave-announcement now only happens after the logout timer has expired, instead of the exact moment the player presses the logout button
Fixed an issue that could cause swimming NPCs to swim on land
NPCs now have the ability to temporarily ignore unreachable targets in combat. If attacked by someone they are ignoring, they will enter evade state and try to move away from that someone.
SpawnRegions now support NPCLISTS with weighted entries. Example of an NPCLIST with 75% chance of spawning some kind of orc, and 25% chance of spawning a ratman archer:
	[NPCLIST example]
	{
	75|NPCLIST=allorc
	25|ratman
	}
Added 3 additional "all purpose" item properties (.more0, .more1 and .more2) and exposed those to JS engine. These work the same as more/morex/morey/morez
Mark spell now stores a 4th property on recall runes - instanceID. This is stored in the rune's .more0 property.
Recall and Gate spells now check the recall rune (or runebook)'s 4th location property - instanceID - to determine where the player ends up
Fixed a server crash related to equipment being automatically unequipped if character is no longer strong enough to have it equipped
Added new JS Function to check if any characters at specified location potentially block movement:
	DoesCharacterBlock( x, y, z, worldNum, instanceID )	// returns true if a character exists at given coordinate (within z +/- 4)
2023-06-20 02:21:16 +08:00
Xoduz
4bb24709e2 Fixed a server crash
Fixed a server crash caused by an attempt to fetch the serial of a nullptr!
2023-06-05 23:49:54 +08:00
Xoduz
c120679695 Pets and followers mini-revamp
Added new protected property for CChar class to track a player's currently controlled pets/followers/summons, and renamed the on tracking all pets owned:
	GenericList<CChar *> activeFollowers
	GenericList<CChar *> petsControlled -> petsOwned
Added new JS Character Methods to view/manipulate follower list:
	GetFollowerList()
	AddFollower( npcObject )
	RemoveFollower( npcObject )
Added new JS Character Property to fetch current count of followers character has:
	.followerCount
Added new GM commands for spitting out information on all pets/followers a player has, in the following format: Name: %s | ID: %i | Serial: %i | x: %i | y: %i | z: %i | world: %i | instanceID: %i
	'listpets
	'listfollowers
Replaced most instances of GetPetList in code and scripts with GetFollowerList, as that's what we actually care about for the most part
Updated code and relevant scripts to make use of AddFollower and RemoveFollower functions where appropriate
Modified code for restoring pet loyalty upon feeding pet; by default it now restores 10/100 loyalty per time pet is fed, while if CoreShardEra setting in UOX.INI is set to AoS expansion or higher, loyalty is instantly restored to max when pet is fed (regardless of amount)
Updated AreaCharacterFunction and AreaItemFunction JS Functions to still work if third parameter (socket) is provided as null
Modified code and relevant scripts that teleport pets/followers along with player to only do so for pets/followers using the "follow" wandermode with player as follow target
Updated some instances of code and script that checked for both controlSlot AND maxFollowers requirements - now only checks maxFollowers if controlSlots is set to 0 in ini
Added function _restorecontext_() {} to a couple more scripts:
	js/commands/targeting/tele.js
Updated error message shown when attempts are made to add deleted objects to refreshQueue, to include name, ID and serial of the object in question
2023-06-02 01:44:40 +08:00