37 Commits

Author SHA1 Message Date
Emagi
f1c4a91b01 Enforce regen refresh after combat, avoid loot method being out of range 2025-08-27 07:42:20 -04:00
Emagi
1bc87d6617 LUA RemoveSpell(Spawn, spell_id, ..) added, Illusion is a control effect, Redesign of control effects, immunities, effect flags away from mutex lists
RemoveSpell(Spawn, SpellID, MaintainedSpell, ReasonString) - maintainedspell is a boolean, default false it will remove an effect (per target) otherwise setting to true will remove the entire spell, maintained, if that is the caster.  Reason String is "canceled" by default unless overwritten

Illusions made to a control effect so we can enforce an existing illusion
2025-08-25 09:18:34 -04:00
Emagi
eb6da37e3b keep propertiesMutex only for the initial set attempt, not for Register/SetProperty 2025-08-18 15:12:41 -04:00
Emagi
fae7cf7773 character properties not hard coded are now dynamically fed into the info struct string, we can now SetInfoStruct(Player, "somevar", "avalue") and it will save to the DB to persist cross zone with GetInfoStruct(Player, "somevar") 2025-08-18 13:56:53 -04:00
Emagi
2858455d9d IsAggroed is redundant in these areas now since its based on engaged_encounter 2025-08-17 14:31:17 -04:00
Emagi
8f402eb781 IsAggroed now defers to info struct for engaged_encounter to assure we are in/out of combat for various game instructions. Add /spawn details hated to show hated by list for players/entities, 2025-08-17 14:29:01 -04:00
Emagi
c5e9adc069 Support SLOW item stat (percentage, ideally 1.0 - 100.0%). If enough slow stacks then it will immobilize the entity completely (could not find any classic limit). 2025-08-17 08:46:42 -04:00
Emagi
879a00676c Avoid CheckWards->DeleteCasterSpell->RemoveWard(LuaSpell) deadlocking 2025-08-17 06:19:12 -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
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
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
108af53730 avoid adding heroic op spell effects (usually have no icon set) with no duration to the spell effects (ends up adding them to the db unnecessarily) 2025-06-19 18:53:48 -04:00
Emagi
4c60615c39 Lua Functions DeleteQuest, DeleteAllQuests added (Fix #29). Ward crash issues (Fix #30). Item Scripts now auto bug report to bugs table (Fix #31).
Fix #29 - DeleteQuest(Player, QuestID, ForceDelete) and DeleteAllQuests(Player, ForceDelete) added.
Fix #30 - Ward crash protection
Fix #31 - track item scripts missing on food/drink auto bug report
2025-06-13 19:52:37 -04:00
Emagi
1176a16d43 Revert "Going to still check wards if the caster is not who we are currently checking wards on (eg. not self)"
This reverts commit 2677fc5fac7d53ec9a4505a1c5f58ef4cc79dac4.
2025-06-12 15:17:12 -04:00
Emagi
2677fc5fac Going to still check wards if the caster is not who we are currently checking wards on (eg. not self) 2025-06-12 15:15:25 -04:00
Emagi
9038e3a2ff Fixed a deadlock if a spell ward had redirect damage for self, it kept looping into CheckWards on the victim 2025-06-12 14:46:42 -04:00
Emagi
a73c6386eb Fix locking of equipment so that we don't add changed spawns causing a hangup 2025-06-12 13:59:21 -04:00
Emagi
e79cffd658 Address sending bogus spell effect icon data to the client in the Spawn Info packet. 2025-06-09 14:05:08 -04:00
Emagi
82a5e96000 Work in progress for 0.9.9 so far (making its own branch for now)
- Fixed a repeated rubberband like behavior that Spawn's would run forward toward their target in combat or on their return run to their starting point.
- WS_HearCastSpell for 546-561 version has an extra byte at the end of the packet we were missing (might be in later clients too have to confirm)
- PlayerScripts support added, new function calls, AddTimer support for Players.
- Static Zones / Special Zones will now silently check to startup zones without reporting the log message, log message only on startup or taking on peer leadership.
- Broadcast and Global Announcement are now supported through peering.
- Fix #22 identified a number of loose spawn pointers and changed to int32 spawn id reference.
- Fix #1 support for all known chat codes for various channels, spell casting and damage.
- In conjunction with Fix #1 spell combat messages are fixed, no longer 'YOU cast' when another spawn casts, added last_tell_name to track the chat code %RT server side.
- size_mod added to InfoStruct Float, supports shrinking and growing Non Player's. InfoStruct also has a UINT ignore_size_mod_calc set to 0 by default, when 1 it will let you set the size_mod and items/spells will not override it from stat calculation.
- XP Table is now static (global) in the Player class so we do not constantly call the database each time the player needs to know a level's XP requirement.
- Removal of duplicate spell cast success and effect messages.
- Fix #21 blue xp bar for KoS and DoF displays properly now.
- GetExpRequiredByLevel(level) added to return the EXP required for to reach the level.
- Fix #25 teleporters cleaned up during /reload spawns to avoid crash
- Fix #16 /reload items supported in peering mode.
2025-06-08 14:53:52 -04:00
Emagi
4e43c73f9c Fix #23 - Wards deleted while in use causing crash 2025-06-03 10:03:31 -04:00
Emagi
b937444425 Fix leashing, leading, rubberbanding mobs. Work in progress for size mod.
Fix #18 Leashing, leading, rubberbanding issues with spawns resolved
Issue #17 Work in Progress, size mod stat support in the works, setting temporary_scale in info struct seems to modify size, the pos_size values in the position struct are not for KoS and older clients.
AddSpellBonus was translating values from float to sint32 early, now we take bonus values into player add bonus so that float values will be honored, as well as sint32.  This applies to uncontested parry, block, dodge, riposte and the size mod.
2025-05-30 21:55:10 -04:00
Emagi
5ef2458026 Rule support for R_Combat, MaxChaseDistance and info struct float max_chase_distance
Rule support for R_Combat, MaxChaseDistance to restrict by server or zone the max chase distance instead of hardcoded 80.0.
Additionally GetInfoStruct float max_chase_distance added.

info struct takes precident when set greater than 0.0 for the max chase distance, otherwise we check the rule being greater than 0.0, otherwise we use the default 80 in the hardcode define
2025-05-06 19:48:01 -04:00
Emagi
1c35309538 fix behavior on zoning for clients to not impact other players 2025-02-09 19:06:49 -05:00
Emagi
a22a56acc6 Update Entity.cpp 2025-02-09 19:00:24 -05:00
Emagi
469487b35d avoid changing the maintained or spell effects on the entity without being in write locks 2025-02-09 18:53:39 -05:00
Emagi
8b4a623f42 more /reload spells junk 2025-02-09 16:37:16 -05:00
Emagi
9250118b05 More work for /reload spells when multiple zones / players are on 2025-02-09 15:25:16 -05:00
Emagi
921f00410b don't need to delete spell effects in the deconstructor any longer for non players. 2025-02-05 16:03:12 -05:00
Emagi
2d4e3f4888 Fix to clear the stealth/invis list when CancelAllStealth is called, additionally to send the update to clients 2025-02-01 06:52:55 -05:00
Emagi
b8738480b2 mitigation_modifier sint16 added to info struct to allow modification of mitigation after the base is obtained from items 2025-01-26 14:59:55 -05:00
Emagi
abfba27112 mitigation vs physical support added (independently had slash, crush, pierce, physical is a combo of all 3) 2025-01-25 08:13:12 -05:00
Emagi
bd9f1bd8ce Fix accidentally not nullifying the spell pointer when we remove a spell effect 2025-01-21 07:37:22 -05:00
Emagi
82a1885887 Added classic spell level support (aka mini ding spells) like warrior getting knee break at lvl 19.6 2025-01-13 09:06:11 -05:00
Emagi
42173ceef2 Added support to create duplicated zones of public zones (non city zone). Additionally spawn locations can be limited to the primary public zone and not replicated (for epics). 2024-12-23 08:46:11 -05:00
Emagi
e4fc6aad5a Zone ruleset_id support for most rules 2024-10-20 09:35:41 -04:00
Emagi
4ee282c460 Immunity Spell Type is int8 no int16 support 2024-09-21 09:27:17 -04:00
Emagi
89194da149 EQ2Emu Source Base July 2024 2024-07-22 08:52:28 -04:00