418 Commits

Author SHA1 Message Date
Emagi
24f5a566ae Assure HearDispell is not accidentally sent to old clients causing a crash 2025-08-15 21:06:36 -04:00
Emagi
093cba8c37 WS_HearDispell wasn't added until past KoS, the code isn't properly rejecting the packet based on missing opcode so fixing version on the struct 2025-08-15 21:06:21 -04:00
Emagi
c38eab8325 extend player check logic from groups to raids 2025-08-15 19:06:45 -04:00
Emagi
231ce9e9bb break out of the for loop if we successfully find the instance 2025-08-15 18:19:28 -04:00
Emagi
8a4eacdb70 Fixed when a client/player was transitioning and we couldn't establish their zone correctly, pull it based on their instance id from the zone list 2025-08-15 18:17:58 -04:00
Emagi
653d504c8d added tracking of spell recast when player zones so we know not to re-add buffs to existing players 2025-08-15 18:17:33 -04:00
Emagi
fa44363a97 added aura vision as vision 5 2025-08-15 18:16:59 -04:00
Emagi
69f257303d added int32 redlight, greenlight, bluelight into info struct for character sheet spell state colors 2025-08-14 17:44:28 -04:00
Emagi
8d8aa020dd support ultravision, infravision, sonicvision and fishvision in KoS, DoF and earlier classic clients 2025-08-14 17:17:54 -04:00
Emagi
2dedddabf0 don't limit the hate to 1 or higher since we can return negative values for calculating hate amount 2025-08-14 09:49:16 -04:00
Emagi
097ee61ea4 item stat 624 (hate gain % mod) now supported 2025-08-14 09:06:17 -04:00
Emagi
a7260e9f72 Keep player at same Y position and grid_id (added new column to characters table) to address falling through objects after logging out
DB Update:
alter table characters add column grid_id int(10) unsigned not null default 0;
2025-08-13 09:57:27 -04:00
Emagi
2f558184b9 added proc type 20 (physical attack damage attempt) and type 21 (magical attack damage attempt) -- these will serve as attempts to hit, not requiring a successful hit 2025-08-10 17:15:33 -04:00
Emagi
2515b55e56 Disable the zone enter timer until we need it later on in the client process 2025-08-09 10:30:05 -04:00
Emagi
5d1dbf962d Zone in process for player is now delayed until player is no longer on pending spawn list, assures player_entry is called after and spells bonuses are properly assigned to the player. 2025-08-09 08:36:44 -04:00
Emagi
1c61c95f4a Fixed if we do not call obtained (potential of removing item) we skip the item_deleted task because the item could not have been deleted (and there is no lua data to validate it anyway since the runitemscript failed) 2025-08-08 19:46:36 -04:00
Emagi
dded41a000 protect DeleteCasterSpell since spell->spell may be nullptr 2025-08-08 16:36:57 -04:00
Emagi
a663178bda Address issue with spawns getting stuck when using MoveToLocation 2025-08-08 16:14:00 -04:00
Emagi
4d0ef974ae On zone shutdown purge all spells pending to be deleted so we do not reference dead spell->zone ptr 2025-08-08 14:40:30 -04:00
Emagi
480086d85d Fix allowing equipment during engagement based on the engaged_encounter info struct, not the engagedincombat (melee attack enabled flag) 2025-08-08 14:39:56 -04:00
Emagi
25325477ab Fixed loading player scripts for zones by their zones table name parameter 2025-08-02 15:42:36 -04:00
Emagi
baf74d0bdd Added LUA Function to adjust hate position up or down: AdjustHatePosition(Caster, NPC, Increase) increase is boolean, true to increase, false to decrease 2025-08-02 06:35:03 -04:00
Emagi
6a6573e339 Addressing a number of coincidental lock conditions with removing a dead spawn (out of order), clearing hate (deadlock due to early dead spawn removal), saving a player to database (before player loaded) 2025-07-31 18:38:39 -04:00
Emagi
6e25f0062f Segmented queries and query escaped the character name (in case) 2025-07-31 18:36:36 -04:00
Emagi
b7f56e3b73 Prevent accessing spawn list outside of read lock, removal of pending spawn removals (redundant) 2025-07-31 13:23:42 -04:00
Emagi
9ef48d3bab limiting spawn list write lock further 2025-07-30 19:15:47 -04:00
Emagi
8f47a27b1d better DB inserting of the query to not move around the char array later 2025-07-30 08:44:01 -04:00
Emagi
74fa672e65 enforce attempting a DB deleting on broker, even if the item does not exist in the broker memory 2025-07-30 08:22:25 -04:00
Emagi
e1a759a1a2 this seems to be better behavior with ASAN due to not constant locking/unlocking the spawn list.. 2025-07-29 19:25:26 -04:00
Emagi
9e255408ce misc cleanup 2025-07-29 18:44:34 -04:00
Emagi
020058b395 LUA Functions Added, AttackAllowed, IsInRaid, InSameRaid, GetRaid
AttackAllowed(Spawn, Target, Distance, RangeAttack)
    Distance default is 0.0f and just checks if you can attack the target.
    Otherwise distance greater than 0.0f relates to the distance between the Spawn and Target which you first obtain using GetDistance(Spawn, Target).
    RangeAttack is a boolean (default: false) when true we use range info for the ranged attack min/max distance versus max distance melee combat range.

IsInRaid(Spawn, IsLeaderGroup) - Establishes if the Spawn is currently in a raid.    IsLeaderGroup is boolean (default: false) returns true if Spawn is the leader group of the raid.

InSameRaid(Spawn, Target, IsLeaderGroup) - determines if Spawn and Target are within the same raid groups.  IsLeaderGroup is boolean (default: false) returns true if Spawn is the leader group of the raid.

GetRaid(Spawn, PlayersOnly) - gets the array of all the members in the raid.  PlayersOnly is boolean (default: false), if true we return only clients/players in the list for the raid.
2025-07-27 17:40:05 -04:00
Emagi
8838ca9b2b Don't send message to players when we can't update shop window 2025-07-27 17:39:28 -04:00
Emagi
9f7a0d0e53 use the seller_cid not the seller ptr 2025-07-26 07:26:02 -04:00
Emagi
f60d261f00 Vault, Broker support for DoF, KoS, AoM. Shop support for DoF, KoS.
Broker/Vault (Fix #10):
- Traditional broker integrated (/frombroker), GM itemsearch is still available via /itemsearch.  AoM client cannot sell/use shop, can only buy from broker.
- DoF and KoS client now support House Shop (sell inventory, vault to broker).
- House containers now function like actual containers and can be stored in the vault which will allow placement in the home (to serve as a merchant).
- Sales crate merchant windows in player houses implemented for broker.
- Peering URI's added for broker/shop support: /addseller, /removeseller, /additemsale, /removeitemsale
- House vault and vault slots implemented for DoF, KoS and AoM clients.

Stability and Functionality:
- World Database now has seq_character_items (Sequence) to sync self and peers instantiating new unique IDs for character items.  This is to avoid conflict/overriding another unique id.
- spawn and spawn_houses tables have a lua_script that can now be defined outside the existing spawn_scripts table for a singular spawn.
- Fixed a watchdog/hangup when clearing hate lists inside a spawn list lock.
- Item unique id is being transitioned to int64 (although older clients still only support int32, clients later on are int64).
- Fixed so that spells that have no duration will no longer be added to maintained effects.
- Fixed spell cleanup, maintained effect does not remain on the Player causing a crash.
- Fixed spell conflicts to that check all targets are applicable for the spell.
- Fixed issues with maintained effects or spell effects stacking repeatedly.
- Fixed assigning items to non inventory slots when 'adding' an item to the Player.
- Fixed locking orders between maintained effects and spell effects to avoid deadlocks.
- Fixed entering house and visiting houses, targetting of the house door is now enforced server side.
- Item locking is now enforced by the type of locking (eg. house placement, crafting, shop list for sale).  Locks no longer override/interfere with each other.
- Additional logging around spell casting and targets.
- Spawns/Objects/Widgets so on related to houses now have their own sub tables _houses, eg. spawn_houses, spawn_npc_houses, spawn_object_houses, so on to avoid conflicting with existing tables non-house.

- new LUA Functions:
	ShowShopWindow(Player, FromSpawn) - opens shop window for player (if in their house) for listing, pricing items, retrieving sales log and coin, etc.
	SetSpawnHouseScript(Target, LuaScript) - Utilized in the item script 'placed' function to set the spawned house item's lua script.
	SendBook(Target, ItemID) - Sends the book to the target player based on the item id.
	GetPickupItemID(Spawn) - Gets the item id that the house spawn would represent
	SetHouseCharacterID(Spawn, CharID) - Sets the house spawn character id (should be used on Spawn).  Set CharID to 0 to set to the current houses character id.

- Updated LUA Functions:
	StartHeroicOpportunity(Caster, ClassID, OverrideTarget)  - OverrideTarget now available to change the heroic opportunity target
	HasItem(Player, ItemID, IncludeBank) - No parameter change, include bank, which serves as 'all' should now work correctly (previously did not check bank/other negative slots),  default is false.

- Slash Commands Added:
	/sle - Fix #41, Set Location Entry (DB command for setting spawn location entry values such as offsets and overrides)
	/store_list_item - used to list an item for broker shop
	/store_set_price - used for setting items price for shop
	/store_set_price_local - used for inventory items price for shop
	/store_start_selling - Begin selling from inventory for shop
	/store_stop_selling - Stop selling from inventory
	/store_unlist_item - used to unlist an item from broker shop
	/close_store_keep_selling - Closes store shop window, but keep selling from inventory while in house
	/cancel_store - cancel selling from inventory
2025-07-26 07:10:07 -04:00
Emagi
21052e3289 Found the vault_slots setting in character sheet for the house, also fixed the upkeep display for the house in DoF/KoS clients 2025-07-10 10:04:29 -04:00
Emagi
9f129586fb make sure to memset if the house item info isn't set properly in the database 2025-07-08 13:41:49 -04:00
Emagi
878c422c0f Support house containers being placed inside house. Need to have an appearance set with equip_type as model type/id 2025-07-08 10:32:56 -04:00
Emagi
b0f24aea5d small comments + gnu cleanup 2025-07-04 07:48:40 -04:00
Emagi
cb5371793e reduce MSpawnList writelock from outside the for loop 2025-07-02 14:50:01 -04:00
Emagi
9e1f77e28e HTTP Persistence for world client/server peering 2025-07-01 20:24:15 -04:00
Emagi
93b7620364 Need to also track the not deleted to re-add after attempting a DeleteSpawns loop, need to also release the read lock if we continue 2025-07-01 07:54:58 -04:00
Emagi
40e83f5e2d Redesign of ZoneServer::DeleteSpawns to avoid deadlocks 2025-07-01 07:39:51 -04:00
Emagi
398a4ef1f4 Fixed target type 9 (AE other groups) like Shout getting implied or proper targets
- (Enemy) Players targetting NPCs and their spawn groups
- (Friendly) NPCs targetting NPCs and their own spawn groups
2025-07-01 07:39:16 -04:00
Emagi
bc925887ad Fixed missing return for /activequery 2025-06-30 11:16:01 -04:00
Emagi
1ba65aba78 DB async query synching to peers, code/logging cleanup 2025-06-29 14:03:23 -04:00
Emagi
2a133292b0 Deadlock fix for adding pending spawns, zoneserver.cpp cleanup 2025-06-29 06:48:30 -04:00
Emagi
260a48be1e Fix #38 address issues with food/drink cross zone
Custom spells now survive cross zone with their modified spell stats saved to the database for reloading later.  The design is such that a spell can be custom defined for its spell stats, but a character/player cannot have more than one of that spell (eg. food can share a spell id since only one food can be applied to you, but you can't have many spells apply using the same custom spell id).

CREATE TABLE character_custom_spell_dataindex (
    charid INT UNSIGNED NOT NULL,
    spell_id INT UNSIGNED NOT NULL,
    idx INT UNSIGNED NOT NULL,
    type ENUM('int', 'float', 'bool', 'string') NOT NULL,
    value1 TEXT,
    value2 TEXT,
    PRIMARY KEY (charid, spell_id, idx)
);

CREATE TABLE character_custom_spell_display (
    charid INT UNSIGNED NOT NULL,
    spell_id INT UNSIGNED NOT NULL,
    idx INT UNSIGNED NOT NULL,
    field VARCHAR(64) NOT NULL,
    value TEXT,
    PRIMARY KEY (charid, spell_id, idx, field)
);

CREATE TABLE character_custom_spell_data (
    charid INT UNSIGNED NOT NULL,
    spell_id INT UNSIGNED NOT NULL,
    field VARCHAR(64) NOT NULL,
    type ENUM('int', 'float', 'bool', 'string') NOT NULL,
    value TEXT NOT NULL,
    PRIMARY KEY (charid, spell_id, field)
);
2025-06-26 18:27:35 -04:00
Emagi
11a6a80647 Fixed CheckRemoveTargetFromSpell we should handle RemoveSpawnFromSpell outside MRemoveTargetList lock 2025-06-23 13:19:12 -04:00
Emagi
e54ed5e730 make sure spell data exists for the spell to check detrimental 2025-06-22 13:41:18 -04:00
Emagi
a8eb9c9ebc Extensive changes to remove SpellTargets write and read mutex locks to avoi ddeadlocks 2025-06-22 13:20:07 -04:00