Commit graph

27 commits

Author SHA1 Message Date
Xoduz
29ac82cc21 Misc fixes
Fixed an error on shutdown when running UOX3 in debug mode in VS due to CCommands constructor attempting to unnecessarily clear CommandMap, TargetMap and JSCommandMaps
	Fixed an issue in Portuguese dictionary where a commented line was lacking a forward slash
	Fixed some soft exceptions related to loading of dictionary files
	Fixed soft exceptions related to checking file sizes of potentially non-existing worldfiles on startup
	Fixed some soft exceptions related to loading of regions from DFNs and townregions from WSC
	Fixed misordered datatype entries in dfnDataTypes for DFNTAG_DYEHAIR and DFNTAG_DEFENSECHANCE
	Fixed double "GET" entry in strToDFNTag mapping. One of them should've been "GETUO"
	Fixed strToDFNTag mapping error for "LOYALTY" DFN tag, which was being incorrectly mapped to DFNTAG_MAXLOYALTY
	Added missing strToDFNTag entry for WILLTHIRST DFN tag
	Removed unknown and unused DFN tag/mapping named SKILLVAR
	Fixed misordered DFNTAG_SWINGSPEEDINCREASE entry in DFNTAGS enum, which caused tags following it to be associated with incorrect datatypes
	Fixed some crash/slowdown issues with reloading of all JS scripts (console menu option 8), especially noticable in VS debug mode
	Fixed an issue where shopkeepers would sometimes fail to recognize items they should want to buy from players due to section ID case sensitivity
2025-05-04 01:54:56 +08:00
Dragon Slayer
0518ee5310 ResourceCount
ResourceCount can be used for both characters and items.

Updated documents for resourcecount and useresource to reflex what code shows.
2025-01-30 12:16:29 -06:00
Xoduz
31804fd098 Updated a couple of JS methods, fixed issue with HirelingCombatTraining setting,minor cleanup
Updated .ResourceCount() and .UseResource() JS Object Methods to include optional parameter for sectionId. New supported syntax:
	int ResourceCount( realId, colour )
	int ResourceCount( realId, colour, moreVal )
	int ResourceCount( realId, colour, moreVal, sectionId )
	int UseResource( amount, realItemId )
	int UseResource( amount, realItemId, colour )
	int UseResource( amount, realItemId, colour, moreVal )
	int UseResource( amount, realItemId, colour, moreVal, sectionId )
Fixed an issue where the bit flag for the HirelingCombatTraining setting was not set properly
Fixed an issue in SpiderMonkey VS project that prevented compiling a x64 debug build (thanks, punt!)
Some minor cleanup
2022-12-03 22:56:40 +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
75969075dd changed some values to const references 2022-06-16 08:17:28 -04:00
Charles Kerr
b10fa71ec5 GenericList c++ usage update for iterators 2022-06-08 18:24:33 -04:00
Charles Kerr
74881c04a8 ITEMLIST modernization 2022-06-06 09:47:35 -04:00
Xoduz
c4dc320719 0.99.5[RC4]
UOX3 now stores a timestamp for when an account receives its first login, which can be accessed via the new (read-only) JS Account Property .firstLogin.
UOX3 now stores a timestamp for when a player character is created, which can be accessed via the new (read-only) JS Character Property .createdOn. For legacy player characters, the creation timestamp is set the first time UOX3 loads the characters after this update.
Fixed an issue on Linux where pressing the arrow keys in the console would cause UOX3 to shut down
Updated UOX3 documentation
2022-01-10 07:33:51 +08:00
Xoduz
68e71b83df 0.99.5[RC2]
Added support for an additional optional parameter in the RESOURCE tag in Create/Crafting system to make it easier to distinguish between resources with same ID, color but different name - moreValue. This can be set for a resource using the Item DFN tag MORE=#. Syntax:
	RESOURCE=id/resourcename amount color moreValue
Updated ResourceCount() and UseResource() JS Methods to support optional paramter moreValue
Updated internal quantity functions (GetSubItemAmount, GetItemAmount, DeleteItemAmount, DeleteSubItemAmount, GetBankCount and DeleteBankItem) in code to also compare against moreValue, if passed in.
The above functions will now also prioritize reducing remaining uses on an item (if any) over consuming the item itself
Added new crafting menu and create DFN entries for Cooking skill
Fixed an error with wheat.js that could cause flour mills to get incorrect IDs assigned
Added some missing doors in a Serpent's Hold building to default world templates
Players can now demolish a tent multi and convert it back to a deed by chopping up the tent's (empty) chest with an axe
GMs can now force the removal of a tent multi by using the 'remove command and targeting the tent's chest (whether empty or not)
Fixed some issues with 'wipe command that prevented some items (including multis) from being removed
Added a new admin-command to force the removal of a targeted multi and all items contained within: 'removemulti
2022-01-06 14:46:04 +01:00
Xoduz
31a9e6b1e6 More updates to crafting system
Added new Item DFN tags:
	usesleft=# 	// The current amount of uses remaining for an item with limited use
	maxuses=# 	// The maximum amount of uses for an item with limted use
Added new JS Item properties to match DFN tags:
	.usesLeft
	.maxUses
Updated scripts to make use of .usesLeft property instead of custom "UsesLeft" tag
Updated DFNs to include usesleft and maxuses tags and uses_left_tooltip script for all tools with limited use
Crafting and gathering tools bought from NPC vendors will now support a random and limited amount of uses (between what is defined as "current" and "max" uses)
Crafting and gathering tools created by player crafters will support a limited amount of uses based on the quality of the item crafted
2022-01-01 07:58:45 +01:00
Xoduz
4cf424d0a8 Misc small fixes
Fixed an issue where Socket JS Property .account did not properly return an object reference to the account associated with the socket
Added sound-effect for when lockpicks break (js/skill/lockpicking.js)
Cleaned up door-section of add-menu so only doors in their closed state remain (dfndata/items/building/doors.dfn)
Misc fixes to default world templates (some missing doors, a few duplicate decorations)
Fixed an issue where incorrect property name for max health, max stamina and max mana were used in taming script (js/skill/taming.js) and fire breath script (js/npc/special/fire_breath.js)
Updated JS Character Method .ResourceCount() to support -1 as value for the color argument, which will cause UOX3 to count all items of the specified ID, regardless of color
2021-12-19 17:57:57 +08:00
Xoduz
efd8067820 0.99.4z++
Updated 'decorate save command to not save items that are inside multis (the multis themselves are not saved anyway!)
Fixed some issues that would crash decorate script when attempting to use event subcommands without event names
Renamed 'fixcontweight command to 'fixcont and updated it to also fix maxItems property for containers that don't already have that set
Updated container world file template for Felucca with containers with proper maxWeight and maxItems seet
Updated admin welcome gump (js/server/misc/admin_welcome.js) to also include containers (previously missing) and disable facets that don't have any decorations yet. Anyone who already used the admin welcome gump to place default decorations for their shards can use 'decorate load containers to add the missing containers.
Changed how house addons are marked as addons; they will no longer have their item type set to 201 (IT_HOUSEADDON), as this would override any existing item type functionality of the items being setup as addons (like the dresser, which is a container). Instead, house addons are now marked with a custom tag "addon", which is used by scripts like axe.js to identify them as house addons instead of relying on the item type.
Uncommented the dresser house-addon from 'add menu, as it now works as intended
Added house-addons to ArchitectShopping SHOPLIST so they can be bought from Architect shopkeepers for roughly the cost of the material it would have taken to craft them. This is a temporary solution until crafting these have been implemented.
Updated default region spawn file to evict the beekeeper from Skara Brae bank to make room for some actual bankers! The beekeeper is now tending to the bees outside the bank instead.
Fixed issue where NPC vendors would not restock more than 1 leather tunic and/or leather gloves, because of a missing restock tag in the DFN entries for those items
Removed kindling from the shoplist of Armourer vendors
Bananas are now edible
Bowyer shopkeepers will now restock more than 1 shaft and/or feather
Provisioner shopkeepers will now restock more than 1 candle, lantern, various masks, kindling, flour
Jeweler shopkeepers will now buy some gems (star sapphire and tourmaline) they were previously not so interested in
Bowyer shopkeepers now sell fletching tools
Added fletcher's tools as newbie item for players starting with Bowcraft/Fletching skill
NPC shopkeepers now spawn with full stocks of goods, instead of the bare minimum
Fixed item weight tooltip for pileable items appearing in vendor shoplists
Fixed an issue where selling items to NPC shopkeepers would sometimes not visually remove the items from player's backpack
Fixed missing base_item inheritance and missing restock property for mount statues sold by animal trainers/stablekeepers, which prevented them from being presented for sale
Hairs and Beards no longer count towards the total item count showing for corpses
All leather containers are now dyable
Animals that belong in the Arctic (polar bears, snow leopards, walrus) will no longer spawn in forests and jungles
Hellhounds will no longer spawn in forest and jungles; they can now only be found in dungeons
Silver Serpents have been removed from the "weakforestlist" NPCLIST, because they are anything but
GM/Admin characters can now drag immovable items out of their own backpack even with "allmove" disabled
A tip to enable "allmove" or modify item's movable property now shows for GMs attempting to pick up immovable items from the ground
Hungry creatures with AI type 6 (AI_ANIMAL) will no longer suicide by indiscriminately attacking creatures with AI type 2 (AI_EVIL), but will instead only attack "peaceful" animals, or - if really hungry - other types of predatory animals (including humans...)
2021-11-02 07:11:09 +08:00
Xoduz
18786ff88d CDataList replaced with GenericList
Replaced CDataList with the new GenericList class throughout UOX3, and removed CDataList from the project files
Reverted an earlier change where scriptsections were supposed to be reapplied to items bought from NPC shopkeepers - didn't actually work!
2021-05-07 04:33:13 +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
17947a3cdb Misc fixes - 0.99.3a
Undid dictionary rename from ENG to ENU and FRE to FRA; these are not actual language codes, but groups of language codes - ENU covers all English language codes, FRA covers all French ones.
Refined build notes
Updated Debug Information Format for Debug x64 platform in VS project properties to Program Database for Edit and Continue
Minor fix for a half-broken system (automatic adding of items to add-menu) that needs to be revamped or removed
Commented out some thread-locking code that was causing UOX3 to crash under certain circumstances
Fixed a few cases of threads sleeping for microseconds instead of milliseconds
Replaced all calls to UOXSleep with direct call to std::this_thread::sleep_for(), and removed UOXSleep function from funcdecl.h
Fixed an issue with "Gold" ore/ingot type, which was mislabelled as "Golden" in the ORE_LIST section of skills.dfn
Fixed an issue where crafting skills might consume the wrong resource if additional resources of the same ID but different color were present in player's backpack
Improved AmbientFootsteps feature so footstep sounds are played more in tune with character movement
AmbientFootsteps now also play for NPC movement
Changed how code handles randomizing between MINTIME and MAXTIME values from region spawners; now multiplies values by 60 (to get seconds) before randomizing, instead of after, to make use of full range of seconds between the values (which are in minutes)
Adjusted default global NPC movement speeds in [speedup} section of uox.ini to use less extreme values
Added a DEBUGMOVEMULTIPLIER define in cChar.cpp used to multiply NPC movement delays by the specified value (1.75 by default) when running UOX3 in debug mode, due to reduced server performance in debug mode
Documentation updates:
	Added section on DFN tags for Character, Item, Region, SpawnRegion and Weather DFNs.
	Added Feature documentation for Mining and customizable ores
	Added More details in feature documentation for Spawn Regions
	Updated feature documentation for Dictionaries
	Added more details in UOX3 history section
2020-09-16 02:51:20 +08:00
Xoduz
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
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
ef296a7997 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)
  -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 caused by changing an items layer
  -Fixed a bug causing NPC's to always be the first attacker
  -Armor DEF system overhauled to match OSI system
  -Updated Hash Table Remove() calls to remove unrefrenced parameter "index"
  -Changed cSocket::Get/SetDWord() to a UI32 to fix problems checking it against
   INVALIDSERIAL and storing large serial numbers
  -Changed cSocket::AddID() to a UI32 for the same reason as above
  -Changed cSocket:::Get/SetWord() to a UI16 to fix possible problems storing ID's
  -Fixed up calcStealDiff() to match new weight system
  -Minor updates to CPStatsWindow to match the new Armor DEF system and Weight
   system
  -Fixed calls to getTileName() so the names container was set with MAX_NAME
  -Fixed up getFieldDir() using direction typedefs
  -Changed Get/SetMagic() to Get/SetMovable()
  -Cleaned up some unrefrenced params
  -Changed some int's to UI16's in books.cpp
  -WorldSave Changes:
  -XYZ and worldnum to Location=x,y,z,worldnum
  -HiDamage and LoDamage into Damage=hidamage,lodamage
  -Strength,st2,Dexterity,dx2,Intelligence,in2 changed to Strength=str,st2,
   Intelligence=int,in2, Dexterity=dex,dx2
  -DWord0-3 changed to DWords=0,1,2,3
  -FX1,FY1,FX2,FY2,FZ1 changed to WanderArea=FX1,FY1,FX2,FY2,FZ1
  -MoreX,MoreY,MoreZ changed to MoreXYZ=morex,morey,morez
  -More,More2 changed to More=more,more2
  -Type,Type2 changed to Type=type,type2
  -Light,Rain,Heat,Cold,Snow,Lightning changed to
   RaceDamage=Light,Rain,Heat,Cold,Snow,Lightning
  -Fame,Karma,Kills changed to Reputation=fame,karma,kills
  -Complete rewrite to the Weight system
  -Weight is more permanent, removed need to recalc it constantly
  -Packs now show the weight of themselves and all their contents
  -Packs now have a weight limit (currently hardcapped to 400, should make it
   based on type of container and possibly scriptable)
  -All items use the weight value given to them in the scripts unless the entry
   is 0 in which case they pull weight from the MUL's
  -Better handling of overloaded for teleport / recall / walking
  -Weight will max out at 65535 stones and can not go lower than 0 stones
  -Items container is now set as a cBaseObject
  -Fixed up itemsfx() and renamed it to itemSound(), now better handles Gold
   sfx and where an item was dropped (ie in a pack or on the ground)
  -Cleaned up goldsfx() and renamed it to goldSound()
  -Many fixes to get/drop/wear/packItem functions
  -Minor fixes/cleanups in movement.cpp
  -Fixed a worldsave crash with tamed creatures
  -Pressing 0 in console reloads items as well as everything else
  -Made dagger usable for carve again
  -Fixed a horse mounting distance check
  -Noted (and in some cases fixed) unrefrenced variables throughout the code
  -Converted inscribe.gmp to inscribe.dfn and used NewMakeMenu() in favor of the
   old make menu system
  -Updated GetMagic() == 3 calls to IsLockedDown() calls (as that is all it
   should be used for)
  -Fixed up all IsLockedDown() calls, resources that are LockedDown can NOT be
   used, even by GM, until released
  -Also note, items that should be usable if locked: Skill items (looms, training
   dummies, etc, Recall runes)
  -Moved the two functions from newbie.cpp to pcmanage.cpp and removed newbie.cpp
   from the project
  -Moved action() and impaction() to effects.cpp
  -Moved isHuman() to npcs.cpp
  -Where possible made functions that were part of classes private
  -Made use of cCombat::getWeaponTyp
2003-03-13 09:05:58 +00:00
Matthew Randall
7d92f1f6e6 NOTE: Someone might have my SF Password.. Please be advised! - EviLDeD 2003-03-05 21:32:40 +00:00
Matthew Randall
439cd0a7f3 *** empty log message *** 2003-03-05 01:51:10 +00:00
Matthew Randall
92b900b749 uox3_v0_97_1_Build9: minor fixes, and Fixes for Weight issues 2002-09-25 21:22:55 +00:00
Matthew Randall
0b76eac128 Resource Bug fix, Fix for HideWhileMounted fix, and other small things 2002-09-25 09:33:10 +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
d0b22bd8b8 Imported Sources 2002-04-07 20:53:41 +00:00