2002-04-07 20:53:41 +00:00
|
|
|
#ifndef __MAPSTUFF_H__
|
|
|
|
|
#define __MAPSTUFF_H__
|
|
|
|
|
|
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
|
|
|
#include "mapclasses.h"
|
2012-11-03 18:11:04 +00:00
|
|
|
#include <climits>
|
2022-06-15 11:24:57 -04:00
|
|
|
#include "uox3.h"
|
2021-05-30 03:21:05 +08:00
|
|
|
#include "MultiMul.hpp"
|
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
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
constexpr auto MAX_Z_STEP = std::uint8_t( 9 );
|
|
|
|
|
constexpr auto MAX_Z_FALL = std::uint8_t( 20 );
|
2022-06-12 14:31:18 -04:00
|
|
|
//===============================================================================================
|
2022-10-24 18:39:33 +08:00
|
|
|
// TileInfo
|
2022-06-12 14:31:18 -04:00
|
|
|
//===============================================================================================
|
2022-10-24 18:39:33 +08:00
|
|
|
class TileInfo
|
|
|
|
|
{
|
|
|
|
|
constexpr static auto hsSize = 3188736;
|
|
|
|
|
std::vector<CLand> terrainData;
|
|
|
|
|
std::vector<CTile> artData;
|
2023-08-27 21:42:47 -04:00
|
|
|
auto ProcessTerrain( std::istream &input ) -> void;
|
|
|
|
|
auto ProcessArt( std::istream &input ) -> void;
|
2022-10-24 18:39:33 +08:00
|
|
|
bool isHsFormat;
|
2022-06-12 14:31:18 -04:00
|
|
|
public:
|
2022-10-24 18:39:33 +08:00
|
|
|
TileInfo( const std::string &filename = "" );
|
|
|
|
|
auto LoadTiles( const std::string &filename ) -> bool;
|
|
|
|
|
auto TerrainInfo( std::uint16_t tileId ) const -> const CLand&;
|
|
|
|
|
auto TerrainInfo( std::uint16_t tileId ) -> CLand&;
|
|
|
|
|
auto ArtInfo( std::uint16_t tileId ) -> CTile&;
|
|
|
|
|
auto ArtInfo( std::uint16_t tileId ) const -> const CTile&;
|
2022-06-12 14:31:18 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
auto SizeTerrain() const -> size_t;
|
|
|
|
|
auto SizeArt() const -> size_t;
|
2022-06-15 11:24:57 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
auto CollectionTerrain() const -> const std::vector<CLand>&;
|
|
|
|
|
auto CollectionTerrain() -> std::vector<CLand>&;
|
|
|
|
|
auto CollectionArt() const -> const std::vector<CTile>&;
|
|
|
|
|
auto CollectionArt() -> std::vector<CTile>&;
|
|
|
|
|
auto TotalMemory() const -> size_t;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
// Blocks and maps would normally be in separate files, but since we dont want to impact windows
|
|
|
|
|
// project files, we will use the existing files to include them
|
|
|
|
|
class TerrainBlock
|
|
|
|
|
{
|
|
|
|
|
std::array<std::array<Tile_st, 8>, 8> _tiles;
|
2022-06-15 11:24:57 -04:00
|
|
|
|
|
|
|
|
public:
|
2022-10-24 18:39:33 +08:00
|
|
|
TerrainBlock( std::uint8_t *data = nullptr, const TileInfo *info = nullptr );
|
|
|
|
|
auto LoadBlock( std::uint8_t *data, const TileInfo *info = nullptr ) -> void;
|
|
|
|
|
auto TerrainTileAt( int x, int y ) -> Tile_st&;
|
|
|
|
|
auto TerrainTileAt( int x, int y ) const -> const Tile_st&;
|
2022-06-15 11:24:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//=========================================================
|
2022-10-24 18:39:33 +08:00
|
|
|
class ArtBlock
|
|
|
|
|
{
|
|
|
|
|
std::array<std::array<std::vector<Tile_st>, 8>, 8> _tiles;
|
2022-06-15 11:24:57 -04:00
|
|
|
|
|
|
|
|
public:
|
2022-10-24 18:39:33 +08:00
|
|
|
ArtBlock( int length = 0, std::uint8_t *data = nullptr, const TileInfo *info = nullptr );
|
|
|
|
|
auto LoadArtBlock( int length, std::uint8_t *data, const TileInfo *info = nullptr ) -> void;
|
|
|
|
|
auto LoadArtBlock( int length, std::istream &input, const TileInfo *info = nullptr ) -> void;
|
|
|
|
|
auto ArtTileAt( int x, int y ) -> std::vector<Tile_st>&;
|
|
|
|
|
auto ArtTileAt( int x, int y ) const -> const std::vector<Tile_st>&;
|
|
|
|
|
auto Clear() -> void;
|
2022-06-15 11:24:57 -04:00
|
|
|
};
|
|
|
|
|
//=========================================================
|
2022-10-24 18:39:33 +08:00
|
|
|
class UltimaMap : public UopFile
|
|
|
|
|
{
|
|
|
|
|
std::vector<TerrainBlock> _terrain;
|
|
|
|
|
std::vector<ArtBlock> _art;
|
2022-06-15 11:24:57 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
const TileInfo *tileInfo;
|
|
|
|
|
static constexpr int _totalMaps = 6;
|
|
|
|
|
static constexpr std::array<std::pair<int, int>, _totalMaps> _mapSizes {{
|
|
|
|
|
{7168, 4096}, {7168, 4096}, {2304, 1600},
|
|
|
|
|
{2560, 2048}, {1448, 1448}, {1280, 4096}
|
2022-06-15 11:24:57 -04:00
|
|
|
}};
|
2022-10-24 18:39:33 +08:00
|
|
|
int _mapNum;
|
|
|
|
|
int _width;
|
|
|
|
|
int _height;
|
|
|
|
|
bool isUop;
|
|
|
|
|
int _diffCount;
|
|
|
|
|
int _diffTerrain;
|
2022-11-04 00:52:37 -04:00
|
|
|
auto virtual ProcessEntry( std::size_t entry, std::size_t index, std::vector<std::uint8_t> &data ) -> bool final;
|
2022-10-24 18:39:33 +08:00
|
|
|
auto CalcBlock (int x, int y ) const -> int;
|
|
|
|
|
auto CalcXYOffset( int block ) const -> std::pair<int, int>;
|
|
|
|
|
auto LoadTerrainBlock( int blockNum, std::uint8_t *data ) -> void;
|
2022-06-15 11:24:57 -04:00
|
|
|
public:
|
2022-10-24 18:39:33 +08:00
|
|
|
UltimaMap();
|
|
|
|
|
UltimaMap( int mapNum, int width = 0, int height = 0, const TileInfo *info = nullptr );
|
|
|
|
|
auto Width() const -> int;
|
|
|
|
|
auto Height() const -> int;
|
|
|
|
|
auto DiffArt() const -> int;
|
|
|
|
|
auto DiffTerrain() const -> int;
|
|
|
|
|
auto SetSize( int width, int height ) -> void;
|
|
|
|
|
auto Size() const -> std::pair<int, int>;
|
|
|
|
|
auto LoadUOPTerrainFile( const std::string &fileName) -> bool;
|
|
|
|
|
auto LoadMulTerrainFile( const std::string &fileName) -> bool;
|
|
|
|
|
auto LoadArt( const std::string &mulFile, const std::string &idxFile ) -> bool;
|
|
|
|
|
auto ApplyDiff( const std::string &difflPath, const std::string &diffiPath, const std::string &diffPath ) -> int;
|
|
|
|
|
auto ApplyTerrainDiff( const std::string &difflPath, const std::string &diffPath ) -> int;
|
2022-06-15 11:24:57 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
auto BlockAndIndexFor( int x, int y ) const -> std::tuple<int, int, int>;
|
|
|
|
|
auto Uop() const -> bool { return isUop; }
|
2022-06-15 11:24:57 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
auto TerrainAt( int x, int y ) const -> const Tile_st&;
|
|
|
|
|
auto TerrainAt( int x, int y ) -> Tile_st&;
|
|
|
|
|
auto ArtAt( int x, int y ) const -> const std::vector<Tile_st>&;
|
|
|
|
|
auto ArtAt( int x, int y ) -> std::vector<Tile_st>&;
|
2022-06-15 11:24:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//====================================================================================================
|
2022-10-24 18:39:33 +08:00
|
|
|
struct MapDfnData_st
|
|
|
|
|
{
|
2022-06-15 11:24:57 -04:00
|
|
|
int width;
|
|
|
|
|
int height;
|
2022-10-24 18:39:33 +08:00
|
|
|
std::filesystem::path mapFile;
|
|
|
|
|
std::filesystem::path mapUop;
|
|
|
|
|
std::filesystem::path staMul;
|
|
|
|
|
std::filesystem::path staIdx;
|
|
|
|
|
std::filesystem::path mapDiff;
|
|
|
|
|
std::filesystem::path mapDiffl;
|
|
|
|
|
std::filesystem::path staDiff;
|
|
|
|
|
std::filesystem::path staDiffi;
|
|
|
|
|
std::filesystem::path staDiffl;
|
|
|
|
|
MapDfnData_st() : width( 0 ), height( 0 ) {}
|
2022-06-15 11:24:57 -04:00
|
|
|
};
|
2022-06-12 14:31:18 -04:00
|
|
|
|
|
|
|
|
//==========================================================================================
|
|
|
|
|
// until we can replace
|
|
|
|
|
//==========================================================================================
|
2022-10-24 18:39:33 +08:00
|
|
|
class CMulHandler
|
|
|
|
|
{
|
2002-04-07 20:53:41 +00:00
|
|
|
private:
|
2022-06-15 11:24:57 -04:00
|
|
|
// uo eq5q
|
2022-10-24 18:39:33 +08:00
|
|
|
TileInfo tileInfo;
|
|
|
|
|
MultiCollection multiData;
|
|
|
|
|
std::unordered_map<int, UltimaMap> uoWorlds;
|
2022-06-12 14:31:18 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
auto LoadMapsDFN( const std::string &uoDir ) -> std::map<int, MapDfnData_st>;
|
|
|
|
|
auto LoadDFNOverrides() -> void;
|
|
|
|
|
auto LoadTileData( const std::string &uoDir ) -> void;
|
|
|
|
|
auto LoadMultis( const std::string &uoDir ) -> void;
|
|
|
|
|
auto LoadMapAndStatics( const std::map<int, MapDfnData_st> &info ) -> void;
|
2022-06-15 11:24:57 -04:00
|
|
|
|
2002-04-07 20:53:41 +00:00
|
|
|
public:
|
2022-10-24 18:39:33 +08:00
|
|
|
CMulHandler() = default;
|
|
|
|
|
auto Load() -> void;
|
|
|
|
|
auto ArtAt( std::int16_t x, std::int16_t y, std::uint8_t world ) -> std::vector<Tile_st>&;
|
|
|
|
|
auto ArtAt( std::int16_t x, std::int16_t y, std::uint8_t world ) const -> const std::vector<Tile_st>&;
|
|
|
|
|
auto SizeOfMap( std::uint8_t worldNumber ) const -> std::pair<int, int>;
|
|
|
|
|
auto DiffCountForMap( std::uint8_t worldNumber ) const -> std::pair<int, int>;
|
2022-06-14 11:36:04 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
auto MultiHeight( CItem *i, std::int16_t x, std::int16_t y, std::int8_t oldZ, std::int8_t maxZ, bool checkHeight = false ) -> std::int8_t;
|
|
|
|
|
auto MultiTile( CItem *i, std::int16_t x, std::int16_t y, std::int8_t oldZ, bool checkVisible = true ) -> std::uint16_t;
|
2022-06-12 14:31:18 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
auto DoesStaticBlock( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, bool checkWater = false ) -> bool;
|
|
|
|
|
auto DoesDynamicBlock( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::uint16_t instanceId, bool checkWater, bool waterWalk, bool checkOnlyMultis, bool checkOnlyNonMultis ) -> bool;
|
Thief Revamp - 0.99.6-RC5
Added script for NPC guildmasters (js/npc/ai/guildmaster.js). Only one NPC guild has been setup in the script so far (more can be easily added) - the Thieves Guild - which if joined grants players the ability to steal from other players and to buy disguise kits
Added two new NPCs, which there will now spawn one of in a random location in each city in Britannia (felucca facet):
m_thief_guildmaster (dfndata/npc/male_human.dfn)
f_thief_guildmaster (dfndata/npc/female_Human.dfn)
Added two new character properties to keep track of which NPC guild a player (or NPC) belongs to. These properties have been exposed as the following Character JS properties:
.npcGuild // ID of NPC guild, as defined in script
.npcGuildJoined // Timestamp for when player joined NPC guild
Added script for Disguise Kits (js/item/disguisekit.js). These allow members of the Thieves Guild to disguise themselves from the prying eyes of other players.
Added two new character properties:
.isDisguised // true/false flag for character being disguised
.origName // used to store character's original name before disguise went into effect
Moved implementation of Stealing skill from code to script (js/skill/stealing.js) and revamped it completely in the process. Changes include:
New features:
Town rare stealing - any item marked as "special stealable" with new item property .stealable can be stolen, even if it's locked down by a GM on the ground, or inside a container
When stealing from item piles, thief can potentially steal the amount of items that makes up the max weight limit for what they can steal, from those piles
Chance to successfully steal is now affected by whether there are any characters (NPCs or Players) that witness the attempt. Depends on distance to character, and direction character is facing
Players now become "permagrey" when successfully stealing from another player, regardless of whether it's witnessed
Players now receive a "stealing" flag when stealing from another player, regardless of whether it's witnessed
Stolen items cannot be removed from thief's backpack for 30 seconds following the theft of the item (AoS core shard era and above)
Optional AoS feature to steal special consumable items from monsters
Updated default stealing rules:
Updated calculations to determine chance of success when stealing
Players cannot steal while engaged in combat
Players are revealed if hidden as soon as they use the stealing skill
Players can no longer steal items in the secure trade window
Players can no longer steal items from NPC shopkeepers
Both hands must be free to steal
Stealing now checks line of sight to target player/object
Only members of Thieves Guild (NPC guild) can now steal from other players, unless they are guild enemies
Players can no longer steal from NPC guards by default
Players can no longer steal from the same NPC monster more than once
Only gold and gems can be stolen from innocent players in dungeon/ll areas of Felucca, if core shard era is set to AoS or higher
Players can no longer steal items held on cursor by other players
Orcish masks now eplode if player steals from orcs while wearing it
If core shard era is set to LBR or lower, player is marked as an aggressor if they steal from another player
Guards can only be called on players that are flagged as criminals within the first 10 seconds of them being flagged
Stealing script options:
Allow stealing entire containers (off by default pre-AoS)
Return stolen items on thief death (off by default)
Temporarily make stolen items immovable in thief's backpack (on by default post-AoS)
Temporarily protect traded items (on by default)
Let dexterity affect chance for successful theft (off by default)
Let light level affect chance for successful theft (off by default)
Allow stealing from NPC Guards (off by default)
Allow stealing special loot from monsters (on by default post-ml)
Moved implementation of Snooping skill from code to script (js/skill/snooping.js), with some changes:
Players cannot snoop pack animals from inside a house, if the animal is outside
The deeper inside main backpack a container sits, the harder it becomes to snoop inside it
Included an optional feature that lets targets of snooping gradually become more aware, increasing the difficulty of succeeding. This awareness fades over time.
Players have a chance to stay hidden while snooping, based on their Hiding skill
Karma is now lowered by snooping regardless of success or failure
Added tracking system for "aggressors" in combat. A player attacking someone (regardless of flag status) will be marked as aggressor to that someone for 2 minutes
Added tracking system for "permagrey" flags - these are stored on a per-target basis, so a player can be flagged visibly as permagrey to multiple other players. Persists until player dies.
Player combat targets and war mode are now cleared on logout
Players will now be unable to hide if within visual distance and in line of sight of their attacker or current target in combat
Server leave-announcement now only happens after the logout timer has expired, instead of the exact moment the player presses the logout button
Fixed an issue that could cause swimming NPCs to swim on land
NPCs now have the ability to temporarily ignore unreachable targets in combat. If attacked by someone they are ignoring, they will enter evade state and try to move away from that someone.
SpawnRegions now support NPCLISTS with weighted entries. Example of an NPCLIST with 75% chance of spawning some kind of orc, and 25% chance of spawning a ratman archer:
[NPCLIST example]
{
75|NPCLIST=allorc
25|ratman
}
Added 3 additional "all purpose" item properties (.more0, .more1 and .more2) and exposed those to JS engine. These work the same as more/morex/morey/morez
Mark spell now stores a 4th property on recall runes - instanceID. This is stored in the rune's .more0 property.
Recall and Gate spells now check the recall rune (or runebook)'s 4th location property - instanceID - to determine where the player ends up
Fixed a server crash related to equipment being automatically unequipped if character is no longer strong enough to have it equipped
Added new JS Function to check if any characters at specified location potentially block movement:
DoesCharacterBlock( x, y, z, worldNum, instanceID ) // returns true if a character exists at given coordinate (within z +/- 4)
2023-06-20 02:21:16 +08:00
|
|
|
auto DoesCharacterBlock( UI16 x, UI16 y, SI08 z, UI08 worldNumber, UI16 instanceId ) -> bool;
|
2022-10-24 18:39:33 +08:00
|
|
|
auto DynTile( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::uint16_t instanceId, bool checkOnlyMultis, bool checkOnlyNonMultis ) -> CItem *;
|
|
|
|
|
auto DoesMapBlock( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, bool checkWater, bool waterWalk, bool checkMultiPlacement, bool checkForRoad ) -> bool;
|
UOX3 0.99.6-RC4
Fixed an issue that prevented onBuyFromVendor() and onBoughtFromVendor() JS Events from triggering when attached to NPC shopkeepers
Fixed an issue with help gump that prevented password management section from working as intended (js/server/misc/helpgump.js)
Fixed an issue where UOX3 would fail to load pre-HS multi.mul files
Added chess board to Misc->Games add menu (dfndata/items/ItemMenu.bulk.dfn)
Fixed an issue with 'move (alias for 'telestuff) command that referenced the wrong variable name (js/commands/targeting/tele.js)
When a player is teleported via the GM 'wholist menu, any pets within range are now also brought along for the ride
Consolidated error-reporting for JS Functions, Object Methods and Object Properties to provide more context (scriptID, filename, line number) when something goes wrong
Added some missing shield IDs (0xA649, 0xA64A, 0xA831, 0xA832) to IsShieldType() function
MAXRANGE item property previously only worked for ranged weapons; now it works for melee weapons too, and potentially allows melee weapons with combat range longer than 1 tile
MAXRANGE item property can now be used to define max combat range for melee weapons
Fixed an issue (non-critical) with .PlaceInPack() JS Method that would cause UOX3 to try adding items marked for deletion to refreshQueue and spam console with errors
Added missing AI scripts to summoned Blade Spirits and Energy Vortexes (dfndata/npc/magicsummon.dfn)
Fixed an issue with weight calculation for hireling backpacks (js/npc/ai/hireling.js)
Fixed an issue with the 'fix command, which would in most cases set character's Z to -1 regardless of location, but now adheres to map elevation instead
Fixed an issue with Pack AI (js/npc/ai/pack_ai.js) that prevented pack members from attacking target correctly (thanks Dragon Slayer)
Fixed an issue with DoesMapBlock JS Function that incorrectly checked for 6 function arguments, when it actually requires 8
Fixed an issue with DoesDynamicBlock JS Function that incorrectly checked for 8 function arguments, when it actually requires 9
Fixed an issue with runebook script (js/item/runebook.js) that prevented players from being able to use recall charges without having spellbook with spell in inventory
Fixed issues with placement of tall items on ground/floor, and with stacking of items in houses
Fixed incorrect alias for woodland armor (dfndata/items/gear/armor/other/armor/wood.dfn - thanks Dragon Slayer)
Fixed a critical issue with script context sometimes changing while executing a script, because of events in other scripts being triggered. Affected scripts can be safeguarded against this by the addition of a dummy callback function anywhere in the script: function _restorecontext_() {}
Fixed an issue with non-animal pets not gaining loyalty when being fed (thanks Dragon Slayer)
Added new JS Object Methods for Chars/Items/Multis to fetch list of custom tags associated with object:
.GetTagMap() // Gets list of persistent custom tags associated with object
.GetTempTagMap() // Gets list of temporary custom tags associated with object
Added new JS commands ('GETTAGMAP and 'GETTEMPTAGMAP) that spits out details of custom tags associated with targeted object (js/commands/custom/misc-cmd.js)
Added new JS command ('USEITEM) that acts as a short-cut for double-clicking on targeted item (js/commands/custom/misc-cmd.js)
Updated 'ADD # and 'ADD ITEM # JS commands to support targeting a container directly and adding the new item inside (js/commands/targeting/add.js)
Updated axe script to only perform lumberjacking skill-check when there's still wood available in a given area, and to play appropriate animations for Gargoyle players (js/item/axe.js)
Updated script for gameboards to make generated pieces newbiefied so they won't appear on ground if board decays (js/item/gameboards.js)
Updated script for stablemasters to avoid relying on global variables (js/npc/ai/stablemaster.js)
Updated names of items crafted with runic hammers to include the material name of the hammers used to craft them (js/skill/craft/crafting_complete.js)
Fixed a small issue with Detect Hidden skill that would return the wrong message if players found anyone hiding nearby (js/skill/detecthidden.js)
Fixed an issue that prevented tile overrides in dfndata/maps/tiles.dfn from loading properly
Added entries for a couple of walls with missing no-shoot flags to tile overrides in dfndata/maps/tiles.dfn
Updated JS Method .SoundEffect() to support optional third argument (creatureSoundNum) to play creature-defined sounds from dfndata/creatures/creatures.dfn. New syntax:
.SoundEffect( soundID, allHear[, creatureSoundNum] ) // 0=SOUND_STARTATTACK, 1=SOUND_IDLE, 2=SOUND_ATTACK, 3=SOUND_DEFEND, 4=SOUND_DIE
Added new Character JS Methods:
.SetRandomName( nameListID ) // apply a random name from specified namelist to character
.FindItemSection( sectionID ) // find item in player's backpack with specified sectionID
Added new Socket JS Method:
.OpenContainer() // Opens specified container for socket
2023-05-30 01:47:26 +08:00
|
|
|
auto CheckStaticFlag( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, TileFlags toCheck, UI16 &foundTileId, bool checkSpawnSurface = false ) -> bool;
|
|
|
|
|
auto CheckDynamicFlag( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::uint16_t instanceId, TileFlags toCheck, UI16 &foundTileId ) -> bool;
|
2022-10-24 18:39:33 +08:00
|
|
|
auto CheckTileFlag( std::uint16_t itemId, TileFlags flagToCheck) -> bool;
|
2022-06-12 14:31:18 -04:00
|
|
|
|
2002-04-07 20:53:41 +00:00
|
|
|
// height functions
|
2022-10-24 18:39:33 +08:00
|
|
|
auto StaticTop( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::int8_t maxZ ) -> std::int8_t;
|
2022-11-01 02:25:52 +08:00
|
|
|
auto DynamicElevation( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::uint16_t instanceId, std::int8_t maxZ ) -> std::int8_t;
|
2023-11-18 03:15:38 -06:00
|
|
|
auto MapElevation( std::int16_t x, std::int16_t y, std::uint8_t worldNumber, bool ignoreVoid = false ) -> std::int8_t;
|
2022-10-24 18:39:33 +08:00
|
|
|
auto TileHeight( std::uint16_t tileNum ) -> std::int8_t;
|
|
|
|
|
auto Height( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::uint16_t instanceId ) -> std::int8_t;
|
|
|
|
|
auto InBuilding( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::uint16_t instanceId ) -> bool;
|
|
|
|
|
auto IsIgnored( std::uint16_t landNum ) -> bool
|
|
|
|
|
{
|
|
|
|
|
if( landNum == 2 || landNum == 0x1DB || ( landNum >= 0x1AE && landNum <= 0x1B5 ))
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
return true;
|
2022-06-12 14:31:18 -04:00
|
|
|
}
|
2022-10-24 18:39:33 +08:00
|
|
|
else
|
|
|
|
|
{
|
2012-11-03 18:11:04 +00:00
|
|
|
return false;
|
2022-06-12 14:31:18 -04:00
|
|
|
}
|
2012-11-03 18:11:04 +00:00
|
|
|
}
|
2002-04-07 20:53:41 +00:00
|
|
|
// look at tile functions
|
2022-10-24 18:39:33 +08:00
|
|
|
auto MultiArea( CMultiObj *i, std::int16_t &x1, std::int16_t &y1, std::int16_t &x2, std::int16_t &y2 ) -> void;
|
|
|
|
|
auto MultiExists( std::uint16_t multiNum ) const -> bool;
|
2022-06-15 11:24:57 -04:00
|
|
|
|
2022-10-24 18:39:33 +08:00
|
|
|
auto SeekMulti( std::uint16_t multiNum ) const -> const CollectionItem_st &;
|
|
|
|
|
auto IsValidTile( std::uint16_t tileNum ) const -> bool;
|
|
|
|
|
auto SeekTile( std::uint16_t tileNum ) ->CTile&;
|
|
|
|
|
auto SeekTile( std::uint16_t tileNum ) const -> const CTile&;
|
|
|
|
|
auto SeekLand( std::uint16_t landNum ) -> CLand&;
|
|
|
|
|
auto SeekLand( std::uint16_t landNum ) const -> const CLand&;
|
|
|
|
|
auto SeekMap( std::int16_t x, std::int16_t y, std::uint8_t worldNumber ) -> Tile_st&;
|
|
|
|
|
auto SeekMap( std::int16_t x, std::int16_t y, std::uint8_t worldNumber ) const -> const Tile_st&;
|
2022-06-15 11:24:57 -04:00
|
|
|
|
2002-04-07 20:53:41 +00:00
|
|
|
// misc functions
|
2022-10-24 18:39:33 +08:00
|
|
|
auto ValidSpawnLocation( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::uint16_t instanceId, bool checkWater = true ) -> bool;
|
|
|
|
|
auto ValidMultiLocation( std::int16_t x, std::int16_t y, std::int8_t z, std::uint8_t worldNumber, std::uint16_t instanceId, bool checkWater,
|
|
|
|
|
bool checkOnlyOtherMultis, bool checkOnlyNonMultis, bool checkForRoads ) -> std::uint8_t;
|
|
|
|
|
auto MapExists( std::uint8_t worldNumber ) const -> bool;
|
|
|
|
|
auto InsideValidWorld( std::int16_t x, std::int16_t y, std::uint8_t worldNumber = 0xFF ) const -> bool;
|
|
|
|
|
auto MapCount() const -> std::uint8_t;
|
2002-04-07 20:53:41 +00:00
|
|
|
};
|
|
|
|
|
|
2012-11-03 18:11:04 +00:00
|
|
|
extern CMulHandler *Map;
|
2002-04-07 20:53:41 +00:00
|
|
|
#endif
|
|
|
|
|
|