Commit graph

37 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
strattond
91dd763409 Change from 32 bit to 64 bit timer 2025-05-27 08:40:00 +10:00
Xoduz
667f948be3 0.99.6-RC6x
Added dummy context restore function to additional scripts
Updated 'go command to support specifying location to teleport to by name, mapped to locations from locations.dfn (Thanks Dragon Slayer!)
Updated Smart Turn script for furniture (js/server/misc/furniture_smartturn.js) with more optimized code (Humility)
Fixed latitude/longitude output of GetMapCoordinates helper function (js/server/data/map_coordinates.js), and updated scripts that relied on it
Fixed an issue where trying to craft fletching tools would produce hatchets instead (js/skill/craft/fletching.js)
Updated js/item/bankcheck.js to display value of checks using onTooltip JS Event, or onNameRequest JS Event if tooltips are disabled
Fixed a couple of DFN formatting issues (thanks, punt)
Fixed an issue where blank deeds (and bank checks) would be pileable if dropped on the same container (dfndata/items/tools/inscription.dfn)
Added dedicated [bankcheck] DFN item (dfndata/items/misc/money.dfn)
Updated Banker AI script (js/npc/ai/banker.js) to use dedicated [bankcheck] item instead of blank deeds as base for bank checks, and to have banker NPCs pause and turn towards player when talked to
Fixed an issue with script for Healing/Veterinary (js/skill/healing.js) which incorrectly used Anatomy as supplementary skill for Veterinary instead of Animal Lore, and which checked dex of wrong character when calculating healing slips
Added two missing tile flags to tileflag enum that threw order of such flags added with HS expansion out of order (thanks, punt)
Fixed an issue with travel-commands in GM menu which handled travelling between facets incorrectly
Added region spawners for dungeons, towns and overworld in Ilshenar facet
Enabled Trammel and Ilshenar facet decorations/spawns by default in admin welcome script (js/server/misc/admin_welcome.js)
Reworked portions of admin welcome gump to display optional "addon" decorations per facet, which might be client/era-specific (js/server/misc/admin_welcome.js)
Added new NPCs to dfndata/npc/femalehuman.dfn: f_executioner, f_chaosdragoon, f_chaosdragoonelite, f_gypsybanker
Added new NPCs to dfndata/npc/femalevendors.dfn: f_gypsymaiden, f_gypsyanimaltrainer, f_gypsyfortuneteller, f_vagabond, f_ironworker
Added new NPCs to dfndata/npc/malehuman.dfn: m_executioner, m_chaosdragoon, m_chaosdragoonelite, m_gypsybanker
Added new NPCs to dfndata/npc/malevendors.dfn: m_gypsyanimaltrainer, m_vagabond, m_ironworker
Added new NPC to dfndata/npc/miscmonsters.dfn: darkwisp
Added new NPC to dfndata/npc/undead.dfn: ancientlich
Added new Item DFNs for "camps" that when spawned will create a camp with specific decorations ([ilsh_orc_camp], [ilsh_healer_camp], [ilsh_mage_camp], [ilsh_banker_camp])
Added scripts for camps (js/item/camps/ilsh_banker_camp.js, js/item/camps/ilsh_healer_camp.js, js/item/camps/ilsh_mage_camp.js, js/item/camps/ilsh_orc_camp.js)
Added new colorlist to dfndata/colors/colors.dfn: [RANDOMCOLOR 33] (Bright Primary Colors)
Fixed an issue with gargish cloth chest DFN which prevented LBR version from working properly (dfndata/items/gear/armor/gargish_armor/gargish_cloth.dfn)
Added a bunch of new NPCLISTS in various npclist DFN files to support regional spawns in Ilshenar
Added missing BACKPACK tag to [golem] NPC DFN (dfndata/npc/clockwork.dfn)
Fixed misspelled section header for Fire Elemental NPC - from firele to fireele (dfndata/npc/elementals.dfn)
Murderous brigand NPCs are no longer willing to teach players skills (dfndata/npc/femalehuman.dfn, dfndata/npc/malehuman.dfn)
Corrected coordinates of Rock Dungeon region (dfndata/regions/regions.dfn)
Added regions for Sea Market (Felucca/Trammel), Blackthorn Dungeon (Felucca/Trammel) and Lakeshire (Ilshenar) (dfndata/regions/regions.dfn)
Fixed an issue with 'radditem and 'raddspawner GM commands which would not correctly set the Z of the added item/spawner to match target location (js/commands/custom/repeatingcmds.js)
Added two new repeating commands (js/commands/custom/repeatingcmds.js):
	'rmovable #	// Repeats bringing up targeting cursor to set movable property on multiple objects
	'rnodecay	// Repeats bringing up targeting cursor to set decayable property to false on multiple objects
Added new areacommand (js/commands/targeting/areacommand.js):
	'areacommand name [string]	// Sets name of all objects within targeted area to [string]
Updated 'decorate command script to better handle flags passed in via admin welcome script for things like facet addons (js/commands/decorate.js)
Updated fire breath script (js/npc/special/fire_breath.js) to get fire breath info per NPC based on their sectionID rather than their base body ID
Updated facet ruleset script (js/server/misc/facetRuleset.js) with an override for GMs trying to snoop players even in places where snooping is disallowed
Updated facet ruleset script (js/server/misc/facetRuleset.js) to allow damage that's not coming from a player/NPC source even in Trammel/Ilshenar
Added teleport locations for entering/leaving Blackthorn Dungeon in Felucca/Trammel (js/teleport.scp)
Updated 'remove and 'rremove commands to release any targeted objects from potential multis they are locked in to properly update lockdown count (js/commands/targeting/remove.js, js/commands/custom/repeatingcmds.js)
Updated felucca/ilshenar world templates with decorations (js/jsdata/worldtemplates/felucca_*/ilshenar_*)
Added world templates with decorations for Trammel (js/jsdata/worldtemplates/trammel_*)
Added DFN entry for Power Generators, and spawn entries for these in Ilshenar (dfndata/item/puzzles/puzzles.dfn, dfndata/spawn/ilshenar/spawn_ilshenar_world_general.dfn)
Added script for Power Generators, which initializes random puzzles on creation and rewards player with diamonds/arcane gems/shadow iron ore when solved, or lightning when failing to solve (js/item/power_generator.js)
Added support for overriding newbie-state of items added to players via dfndata/newbie/newbie.dfn. Supported syntax:
	PACKITEM=sectionID[, amount[, newbieFlag]] 	// To use newbieFlag with PACKITEM, amount must also be specified. Flag can be 0/1
	EQUIPITEM=sectionID[, itemHue[, newbieFlag]	// To use newbieFlag with EQUIPITEM, itemHue must also be specified. Flag can be 0/1
Casting the Earthquake spell will no longer affect the caster, or cause them to become criminal when cast out of town with no impacted targets
Fixed a bug where caster would remain frozen after finishing casting targetless spells like Earthquake
Fixed a bug where caster would remain frozen if spellcast was cancelled half-ways through by picking up or equipping an item
Fixed a bug where caster would remain frozen if spellcast was interrupted by losing concentration from taking melee damage in combat
Fixed a bug where a paralyzed player would remain frozen even if taking magic or poison damage, which releases them from paralyzis
Fixed a bug where target of Paralyze spell would not visually be shown as frozen in target's client
Fixed a bug where a caster frozen while casting a spell could become unfrozen mid-cast because of incoming magic damage
Address overflow issue in MultiMul.cpp (punt)
Address various cast issues (punt)
Corrected jscript project, to not include two files that where for stand alone programs (and resulted in main being added twice in the library (and once was incorrect all ready). (punt)
Replaced RoundNumber with std::round (punt)
The original physical appearance of characters targeted by 'make admin/gm/cns is now kept track of, and restored upon being targeted by 'make player
Fixed an issue where the .HasSpell JS Method was off by 1 when looking for specific spells in player's spellbook, due to 0-based array indexing in code vs 1-based indexing for Spells in DFNs
2023-10-14 05:03:53 +08:00
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
Charles Kerr
fc0345678f Update worldmain.cpp 2022-06-14 07:38:13 -04:00
Charles Kerr
030993832d modernization, separation of CServerData initialization. 2022-06-11 19:15:00 -04:00
Charles Kerr
c092195cec cleanup and world main made non dynamic 2022-06-10 19:22:30 -04:00
Charles Kerr
afb7f38d2a Modernized spawn map 2022-06-06 12:17:38 -04:00
Charles Kerr
8761f4059f TOWNREGIONMAP modernization 2022-06-06 12:02:26 -04:00
Charles Kerr
d5cde9a243 asctime,localtime replacements
still have strncpy,strcpy,fopen to go
2022-03-04 19:04:58 -05:00
Charles Kerr
d540835eb4 2022 project filters, and name change for strutil 2022-03-04 07:35:46 -05:00
Xoduz
e54dec97d8 Fishing revamp
Extended Character JS Method DoAction() to support two additional parameters - frameCount and playBackwards - which define the length of the animation (defaults to 7) and whether the animation should be played backwards (defaults to false). Note that this only works for old-style animations, and thus is not available for Gargoyle characters. Updated method syntax:
	.DoAction( actionID ) // Old animation packet
	.DoAction( actionID, null, frameCount) // Old animation packet with frameCount
	.DoAction( actionID, null, frameCount, frameDelay ) // Old animation packet with frameCount, frameDelay
	.DoAction( actionID, null, frameCount, frameDelay, playBackwards) // Old animation packet with frameCount, frameDelay, playBackwards
	.DoAction( actionID, subActionID ) // New animation packet
Extended fishing JS script to include:
	Fishing special fishing nets, big fish, messages in a bottle/SOS messages and associated shipwreck treasures, with chances of attracting sea serpents, deep sea serpents, water elementals and krakens while fishing.
	Enhanced detection of fishing in shallow vs deep water, with deep water now being defined as any water tile that's 16 or more tiles away from the nearest land area.
	Updated timer system, LoS checks,
Implemented SOS messages and shipwreck locations, with areas valid for potential shipwreck locations being defined in a new section of regions.dfn named [SOSAREAS], which follows the same syntax as the INSTALOG section in the same file. Once a message in a bottle is opened, a SOS message is generated with coordinates for a random shipwreck location, which players can sail to and fish near in order to find a sunken treasure (and other items).
Implemented shipwreck treasures, which come in 3 levels of quality (with an optional 4th quality level available), with increasing amount of gold, gems, scrolls, reagents and magic items (coming in next commit!) per quality level of treasure
Implemented special fishing nets, which can be used to fish up a variety of sea creatures (sea serpents, deep sea serpents, water elementals, kraken), which have a high chance of having SOS bottles on their corpses when defeated
Updated fishinglist.dfn, itemlist.dfn and lootlist.dfn to support new fishing updates
Updated movable state of various items that can be fished up (pillows, some pieces of furniture) to ensure players can move them!
Renamed ORERESPAWNAREA ini setting to RESOURCEAREASIZE (it's also used for ore, and logs) and reduced it from 10 to 8 to divide each world into 8x8 sized resource areas
Fixed a bug where the new fish resource type was not getting regenerated or saved properly
Added INSTANCEID support to INSTALOG section of regions.dfn, and added default WORLD and INSTANCEID entries to all areas
Fixed an issue with Runebooks (js/item/runebook.js) where the coordinates of a rune location would not be displayed properly
Separated map coordinate function from Runebook script to its own script (js/server/data/map_coordinates.js), which other scripts can call upon to get map coords using TriggerEvent() JS function
Ported sextant implementation from code to JS (5033=js/item/sextant.js), and removed the hard-coded version of this.
Updated Item DFN entry for sextants to include script=5033 tag
Fixed a bug in handling of the LOOT tag for NPCs where server would crash if a number was specified behind the item/itemlist to add as loot
The DFN tags PACKITEM and LOOT are now handled similarly when used for NPCs and Items respectively. PACKITEM can be used for adding items with specific IDs, or "list objects" from itemlists.dfn, while LOOT can be used to add items from lootlists.dfn. One big difference between these is that if the optional amount parameter is specified for either tag when used with itemlists/lootlists (PACKITEM=listObject,amount vs LOOT=lootlist,amount), PACKITEM will add the specified amount of the specified/randomly chosen item, while LOOT will add X amount of random items.
Updated implementation of ITEMLISTs and LOOTLISTs to support an optional weighting system, which can be used to adjust the probability of some items being chosen from these lists over other items. In the below example, specialfishingnet has a weight of 10, while the blank entry has a weight of 90, making it 9 times more likely for the blank entry to be chosen than the specialfishingnet! Note that higher weighted items should be sorted first for this to be accurate:
	[LOOTLIST shipwreck_treasure_special]
	{
	90|blank
	10|specialfishingnet
	}
Using bladed weapons on stacks of fish will now cut the entire stack at once, instead of one fish at a time
Updated DFN entries for various sea creatures (dfndata/npc/seacreatures.dfn) to adjust color of NPCs, loot and NPC AI
Extended functionality of JS Function DoMovingEffect() to allow a set of coordinates as source location, without having to specify a character as either the source or target of the effect
Fixed an issue with sea creatures being unable to pathfind in shallow water due to underwater land tiles being treated as blocking
Moved fishing skill out of code and into js for more user friendly control
Added js/item/magicfish.js for the magic fish food
2021-09-20 18:47:54 +08:00
Xoduz
d0b4493513 Decaying corpse parts, memory leak fixes
Corpse parts carved from human corpses will now have weight, and decay - as they're added as script items instead of base items
Fixed some memory leaks in CMultiObj::GetBuildTimestamp(), CMultiObj::GetTradeTimestamp(), CWorldMain::SaveNewWorld() and cEffects::tempeffect()
Misc smaller code cleanup
2021-07-02 07:46:32 +08:00
Charles Kerr
75fc56b0dd NULL to nullptr 2021-06-12 07:30:23 -04: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
d7ac5c3218 Housing Revamp and more
Updated JS SysMessage function to accept up to 10 extra, optional arguments, which can be used with dictionary messages that require additional parameters like %s or %i
Added new type of house privilege in cMultiObj.cpp to keep track of friends of the multi - HOUSEPRIV_FRIEND - which is stored during worldsaves as one or more Friend=<player serial> tags in house.wsc
Added new type of house privilege in cMultiObj.cpp to keep track of guests of the multi - HOUSEPRIV_GUEST - which is stored during worldsaves as one or more Guest=<player serial> tags in house.wsc
When items are created for houses upon house placement, a reference to the multi's serial is now stored in the house sign's MORE property to allow easier tracking of which house a particular sign belongs to
Added tracking of new, persistent properties for houses via cMultiObj.cpp/h:
	lockdowns, secure containers, vendors, guests, friends, owners, ban location, public status, number of visits, timestamps
Added a multitude of  new methods in cMultiObj.cpp/h to assist in improving the functionality of houses
Added new tags for houses in house.dfn (default values applied if tag not specified):
	MAXSECURECONTAINERS=4 - Max amount of secure containers allowed in a multi
	MAXLOCKDOWNS=256 - Max amount of lockdowns allowed in a multi
	MAXVENDORS=10 - Max amount of vendors allowed in a multi
	MAXBANS=50 - Max amount of bans in a multi's ban list
	MAXFRIENDS=50 - Max amount of friends in a multi's friend list
	MAXGUESTS=50 - Max amount of guests in a multi's guest list
	MAXOWNERS=8 - Max amount of owners and co-owners in a multi's owner list
	MAXTRASHCONTAINERS=1 - Max amount of trash containers allowed in multi
	SCRIPT=<scriptID> - Assign a JS script-ID directly to a multi
	FRONTDOOR - indicates that a door is the front door of a house. Cannot be locked in public houses!
	INTERIORDOOR - indicates that a door is an interior door of a house. Can be locked in public houses.
	BANX - Location X offset for multi's ban location, if not used, will try to use SE corner of multi instead
	BANY - Location Y offset for multi's ban location, if not used, will try to use SE corner of multi instead
Added JS Event:
	onHouseCommand( tSock, multiObj, cmdID ) - For handling spoken house commands via JS scripts attached to multi.
Updated JS Events:
	onEntrance() - can now trigger both for multi being entered and/or object entering
	onLeaving() - can now trigger both for multi being left and/or object entering
	onSpeech() - can now also trigger for items (in addition to chars) with event & script attached, if UOX.INI setting ITEMSDETECTSPEECH is enabled
Added JS Multi methods:
	.IsBoat() - Returns whether the item (or multi) is a boat
	.IsOwner( playerToCheck ) - Returns whether a player is the owner of a multi
	.IsOnOwnerList( playerToCheck ) - Returns whether a player is on the (co-)owner list of a multi
	.IsOnFriendList( playerToCheck ) - Returns whether a player is on the friend list of a multi
	.IsOnGuestList( playerToCheck ) - Returns whether a player is on the guest list of a multi
	.IsOnBanList( playerToCheck ) - Returns whether a player is on the ban list of a multi
	.AddToFriendList( playertoAdd ) - Adds player to the friend list of a multi
	.RemoveFromFriendList( playertoRemove ) - Removes player from the friend list of a multi
	.AddToGuestList( playertoAdd ) - Adds player to the guest list of a multi
	.RemoveFromGuestList( playertoRemove ) - Removes player from the guest list of a multi
	.ClearOwnerList() - Clears all entries from a multi's (co-)owner list
	.ClearFriendList() - Clears all entries from a multi's friend list
	.ClearGuestList() - Clears all entries from a multi's guest list
	.ClearBanList() - Clears all entries from a multi's ban list
	.SecureContainer( itemToSecure ) - Secures a container in a multi
	.UnsecureContainer( itemToUnsecure ) - Unsecures a container in a multi
	.IsSecureContainer( itemToCheck ) - Checks if specified item is a secure container in a multi
	.LockDownItem( itemToLockDown) - Locks down an item in a multi
	.ReleaseItem( itemToRelease ) - Releases a locked down item in a multi
	.KillKeys() - Deletes ALL keys associated with a multi
	.AddTrashCont( itemToAdd ) - Add trash container to multi's list of trash containers
	.RemoveTrashCont( itemToRemove ) - Remove trash container from multi's list of trash containers
Added JS Item (Multi only) properties:
	.lockdowns - Get the number of lockdowns in a multi
	.maxLockdowns - Get/Set the max number of lockdowns allowed in a multi
	.secureContainers - Get the number of secure containers in a multi
	.maxSecureContainers - Get/Set the max number of secure containers allowed in a multi
	.trashContainers - Get the number of trash containers in a multi
	.maxTrashContainers - Get/Set the max number of trash containers allowed in a multi
	.friends - Get the number of friends in a multi's friend list
	.maxFriends - Get/Set the max number of friends allowed in a multi's friend list
	.guests - Get the number of guests in a multi's guest list
	.maxGuests - Get/Set the max number of guests allowed in a multi's guest list
	.owners - Get the number of owners in a multi's owner list
	.maxOwners - Get/Set the max number of owners allowed in a multi's owner list
	.bans - Get the number of banned players in a multi's ban list
	.maxBans - Get/Set the max number of banned players allowed in a multi's ban list
	.vendors - Get the number of player vendors in a multi
	.maxVendors - Get the max number of player vendors allowed in a multi
	.deed - Get the item sectionID for deed used to place multi
	.isPublic - Get/Set the private/public state of a multi
	.buildTimestamp - Get the timestamp for when the house was originally placed
	.tradeTimestamp - Get the timestamp for when the house was last traded to another player
	.banX - Get/Set the ban location X offset for the multi
	.banY - Get/Set the ban location Y offset for the multi
Added JS Character properties:
	.multi = Get/Set the multi object the character is in
	.accountNum = Get the account number the character belongs to
	.housesOwned = Get a count of houses owned by the character
	.housesCoOwned = Get a count of houses co-owned by the character
Updated JS cBaseObject Methods .FirstItem(), .NextItem() and .FinishedItems() to also support iterating through items in multis
Updated JS multi Methods .FirstChar(), .NextChar() and .FinishedChars() to support an additional parameter to specify what kind of characters to loop through:
	"default" or no parameter - all characters inside the multi
	"owner" - players on multi's owner list
	"friend" - players on multi's friend list
	"guest" - players on multi's guest list
	"banned" - players on multi's ban list
Added new INI tags to a new section of uox.ini called [houses]
	DECAYTIMERINHOUSE=3600 // Decay timer in seconds for non-locked down items inside houses
	PROTECTPRIVATEHOUSES=1 // Toggles whether private houses will automatically boot unauthorized visitors (1) or not (0)
	TRACKHOUSESPERACCOUNT=1 // Toggles whether to track (and restrict) house ownership per account (1) or per character (0)
	MAXHOUSESOWNABLE=1 // Specifies the max amount of houses a player can own per account/char, depending on how house ownership is tracked
	MAXHOUSESCOOWNABLE=10 // Specifies the max amount of houses a player can co-own per character
	CANOWNANDCOOWNHOUSES=1 // Toggles whether players can own and co-own houses at the same time
	COOWNHOUSESONSAMEACCOUNT=1 // Toggles whether characters on same account as house owner will be treated as co-owners
Added new INI tags in [settings] section of uox.ini:
	ITEMSDETECTSPEECH=0 // If enabled, server will search for nearby items with onSpeech JS event running whenever a character speaks. Disabled by default.
	MAXPLAYERPACKITEMS=125 // Defines max item capacity for player (and NPC) backpacks. Defaults to 125.
Moved most of the existing house functionality to JS and expanded upon it to reach feature parity with houses in regular UO around Publish 15/16, with various extras thrown in for good measure and all functionality being customizable:
	js/server/house/house.js (15000) - handles detection of house commands and characters entering/leaving houses
	js/server/house/houseSign.js (15001) - contains and handles all house-related gumps/menus and what is shown when players interact with house sign
	js/server/house/houseCommands.js (15002) - handles functionality of house commands and other functionality such as transfer of ownership, demolishing house, etc.
	js/server/house/houseDeed.js (15003) - handles initial rules that allow/disallow placement of additional houses for players
	All house-related menus now fully handled through JS
	All house commands and other functionality now fully handled through JS
	Removed redundant hard-coded house functionality
	Implemented Co-owners, friends, guests for houses, with access rules in place for entry, lockdowns, house commands, etc.
	Implemented Private and Public houses
	Implemented Secure Containers and Trash Barrels
	Definable max lockdowns, secure containers, player vendors, bans, friends, guests, owners, trash containers and more - per house type
	JS scripts can now be attached directly to houses
	Doors in houses can be marked as front doors or interior doors, and will be treated differently with regards to private and public houses
	Added new item to dfndata/items/containers/misc.dfn - [trashbarrel]
	Added new JS script (js/items/trashbarrel.js) with trash barrel functionality for houses. Trash barrels that are marked as secure containers are only accessible by owners, co-owners and friends of the house. Various options available at top of script.
	Updated js/items/axe.js to support chopping up trash barrels and house add-ons in houses owned by the player
	Fixed an issue with house doors being left behind after demolishing houses while their doors were open
	Fixed an issue where GMs could be banned from player houses
	Added Line of Sight checks to speech, to give players some privacy in their own homes
	Updated house placement code to more accurately check for other multis, dynamic and static objects when placing houses; now requires free space around each house that cannot be blocked by other houses or items that can block player movement, and disallows placement of houses on roads
	Updated house placement code to move characters blocking house placement to SE corner of the house
	Updated house placement code to disallow placing houses in guarded regions, or in dungeons
	Added new DFN tag for regions to enable/disable player houses in specific regions: HOUSING=0/1
	Added new region (247) that covers path to Valley of Eodon in Felucca
	Added new region (248) that covers Valley of Eodon in Ter-Mur, with player housing disabled
	Added new region (249) that covers entire T2A lands, with player housing disabled
	Updated SPACEX and SPACEY values for all houses in dfndata/house/house.dfn to match updated house placement code
	Added new JS property to Regions that can be used to determine or change state of player housing in a region: .canPlaceHouse()
	Updated rules for usage of dye tubs to dye locked down items; now only house owners or co-owners may dye locked down items
	Updated rules for usage of the following locked down items in a house, which are now only usable by house owners and co-owners
		Dyes, Guildstone Deeds, Recall Runes (renaming), Rename Deeds, Townstone Deeds, House Deeds, Boat Models, Player Vendor Deeds, Ore, Hair Dye
	Updated rules for usage of the following locked down items in a house, which are now only usable by house owners, co-owners	and friends:
		Keys, Dye Tubs, Magic Scrolls, Fireworks Wands, Magic Wands, Smithing Tools, Mining Tools, Fishing Poles
	Updated item lockdown rules to allow locking down (and releasing) items in a container as long as the container is locked down, and to only allow releasing a locked down container if it's empty of locked down items
	Updated item lockdown rules to only allow locking down movement-blocking items further than 2 tiles away from doors
	Updated rules for releasing items in houses - now the house owner can release any locked down items, co-owners can release items locked down by themselves or by friends, while friends can release only items locked down by themselves
	Added some feedback to player about why their attempted house placement failed
	Items added by GMs directly into multis will now decay based on the house-specific decay timer instead of the regular one
	Fixed an issue that could cause items to almost instantly decay after being released from lockdown in a house
	Placing house add-ons now properly takes into account SPACEX and SPACEY values when checking if they can fit in selected area of houses
	Re-added SPACEX and SPACEY values for Pentagram and Loom house add-ons
	House add-ons can now be converted back into house add-on deeds by chopping them with an axe
	Added new item type - IT_HOUSEADDON (201) - used by house add-ons placed in player houses
	Fixed a bug where keys would stop working after being added to a keyring, and would turn into blank keys upon release from the keyring
	Added visitor count for public player houses, which keeps track of how many visits a public house has received, with each player counted max 1 time every 24 hours
	Fixed an issue with FindPlayersInOldVisrange() where it didn't take into account that players could see buildings further away than the standard update range. This could cause players to see ghost images of buildings if they were at the "right" distance when the building was being demolished
	Added NODECAY tag to all signs and doors in dfndata/house/house.dfn
	Added FRONTDOOR or INTERIORDOOR (as appropriate) to all doors in dfndata/house/house.dfn
	Added BANX and BANY to specify ban location for some houses in dfndata/house/house.dfn instead of relying on finding SE corner automatically
	Implemented strongboxes (js/server/house/strongbox.js) for co-owners of a house, which can be placed with the house command "i wish to place a strongbox". Max capacity is 25 items
Updated 'REMOVE command to take an optional parameter - itemID. If supplied, the command will remove all items with this itemID from a targeted container
Fixed a bug when checking if dynamic items were blocking valid spawn locations for NPCs, some function arguments were in the wrong order!
Improved code that finds valid spawn locations for items and NPCs spawned via spawn regions. As server gradually builds up lists of valid spawn locations per region over time, it will start using these lists more often, rather than always look for brand new spawn locations.
Fixed a bug with CMulHandler::CheckStaticFlag() that prevented NPCs from spawning inside buildings with no static floors!
Fixed an issue with repeating commands that prevented GMs from being able to cancel them when using the ClassicUO client
Exposed character property .accountNum to JS engine
Extended CDataList class to include a Clear() method for clearing lists
Updated JS File method .Open() to support an optional, third argument - subFolderName - that defines in which sub-folder of UOX3/shared/ to store/look for a file. If no third argument is supplied, UOX3 will default to using the shared folder itself.
Updated JS File method .Length() to return a value of -1 for files that don't exist
Added new code function, exposed to JS engine with same parameters, which simply checks if a given tile ID has a specific flag
	bool CheckTileFlag( UI16 itemID, TILEFLAG flagToCheck )
Added JS function used to find the root container of an item (if any)
	FindRootContainer( itemSerial )
	FindRootContainer( item )
Added new JS function that allows deleting files from UOX3/shared/ folder or subfolders of shared folder. If no subFolderName is provided, looks for file directly in shared folder itself. Restrictions on file- and folder-names apply.
	bool DeleteFile( fileName, subFolderName )
Added new JS functions for checking if a specific client or server feature is enabled. See documentation for full list of client/server features.
	GetClientFeature( bitNum ) // Returns true if specified client feature is enabled on server
	GetServerFeature( bitNum ) // Returns true if specified server feature is enabled on server
Added new JS function for returning the value of almost any server setting from UOX.INI
	GetServerSetting( settingNameInDoubleQuotes )
Updated JS function DoesDynamicBlock() with two new parameters - checkOnlyMultis and checkOnlyNonMultis
Updated JS function DoesMapBlock() with two new parameters - checkMultiPlacement and checkForRoad
Fixed an issue where a LoS check would prevent players from accessing containers in their own backpack
Added new functions in findfuncs.cpp to make it easier to find items near another object or location:
	findNearbyItems( object, distance )
	findNearbyItems( x, y, worldNumber, instanceID, distance )
Added new Item property - maxItems - used by containers to determine their max item capacity
Added new Item property - totalItemCount - used to get total item count in a container (including sub-containers)
Added check for max item capacity when creating new items that are added to a character's backpack - items will be created below character's feet if backpack is full!
Added new DFN tag for items, used by containers to determine item capacity for a given container:
	MAXITEMS=# // 125 is the default for all containers if not set
Added new JS Item properties:
	.maxItems // gets/sets item capacity for a given container
	.totalItemCount // gets total item count in a container, including sub-containers
Updated item tooltips for containers to show accurate total item count, as well as to display max item capacity
Fixed a bug where picking up items from a non-locked down pile of items on the floor inside a multi could cause the remaining pile to be seen as no longer inside the multi, disallowing locking it back down and causing it to decay based on regular decay timer instead of house-specific one
Updated JS command set to allow setting poison-level on items ('set poison #) and hunger-level on characters ('set hunger #)
Fixed an issue with js/item/food.js that prevented poisoned food from poisoning characters when eaten
Fixed an issue with js/skill/poisoning.js that prevented players from poisoning food!
Updated various JS scripts and hardcoded targeting functions to disallow the targeting of locked down resources using skills and tools
Updated JS Method TextMessage() to support three extra, optional parameters. Note that if one optional parameter is included, all preceding optional parameters are also required!
	speechTarget - What kind of target is this message intended for?
		0 - Only visible for sender and receiver of message
		1 - Visible to all players in range
		2 - Visible to all NPCs and players in range
		3 - Visible to all PCs everywhere + NPCs in range
		4 - Visible to all PCs everywhere (broadcast)
		5 - Only visible for the receiver of the message
	speechTargetSerial - The serial of the receiver of the message, used if speechTarget is 0 or 5
	speechFontType - The type of font to display the text in. Defaults to normal.
	    0 - Bold
	    1 - Normal with shadow
	    2 - Bold with shadow
	    3 - Normal
	    4 - Gothic
	    5 - Italic
	    6 - Small, dark
	    7 - Colourful
	    8 - Runic (only works with CAPS)
	    9 - Small, light
Added timestamp to worldsaves in console, to make it easier to see when a particular world-save was done
Added info about compiler/environment displayed at the top of the UOX3 console during startup
Updated dictionary files with new messages primarily related to housing
2020-11-04 02:00:37 +08:00
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
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
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
16ba505535 Mainly little smallish fixes. I think this covered double speech, and in valid speech when actually in range(not sure). And just general little code cleanups 2003-03-08 06:51:01 +00:00
Matthew Randall
2f1421d0fb *** empty log message *** 2003-03-05 02:35:22 +00:00
Matthew Randall
0999c86248 Included:
-Removed namespace dependance on std
-Fix for Items vanisishin when dragged to the paperdoll (xuri)
-Fix for multiple  Item equip (xuri)
-Fix for linux complie issues under gcc3.2+ (maarc)
-Fix for performance dump/Logs (Dreoth)
-Fix for npcSpawn (maarc)
-Fix VC precompiler issues, For some resons warnings were not surprsesed
-Added onCommand, and GetCommandSize meathods (Brakhtus)
-Added some additional logging information for an effect and its ID (maarc)
-Replaced previous account system with new re-write(DB Support soon)
2003-01-20 16:24:24 +00:00
Matthew Randall
86cbfc0f3d Region.wsc fix, and misc 2002-10-25 05:31:09 +00:00
Matthew Randall
4ba3910a02 *** empty log message *** 2002-09-26 20:27:34 +00:00
Matthew Randall
2c0345813b Fixes: ShutDown HTML, Cleaned up Console, removed Wave file, Resurrection Fix, Locked rune marking, wood choping range fix, Taming Fix, Carved body bart name fix, NPC Flee Fix, Added config for Allowing character to hide while mounted. 2002-09-23 05:26:26 +00:00
duckhead
f5473e9b95 Reconcile w/ rel-0-97-pathes branch 4/18/2002 duckhead 2002-04-18 23:57:23 +00:00
duckhead
ffd7a25027 Add files that were skipped due to dead revisions.
Add in changes to cServerDefinitions that will permit relative paths in DIRECTORY Setting in uox.ini
2002-04-07 21:27:53 +00:00
Charles Kerr
edd9557190 Deleted old unused source. Use the new directory tree 2001-02-27 01:37:28 +00:00
Thiago Correa
ad034ede2c Merge with Official Release 0.70.03.21c2
Exploit fix: Equiping weapon when dead.
Also has some improvements in SNOOPING
2001-02-06 18:21:41 +00:00
anshil
3ce38ce2ae merge 0.70.03.21c 2001-02-05 17:17:20 +00:00
anshil
63acf90438 release 0.70.03.21a 2001-01-31 19:29:09 +00:00
anshil
2b6fdb7780 corr�a beauty-stuff 2001-01-27 19:02:43 +00:00
anshil
91addd1571 initial tree creation from official source release 0.70.03.21 2001-01-25 14:05:17 +00:00