44 Commits

Author SHA1 Message Date
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
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
11a6a80647 Fixed CheckRemoveTargetFromSpell we should handle RemoveSpawnFromSpell outside MRemoveTargetList lock 2025-06-23 13:19:12 -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
Emagi
6b0f551552 fix mishandling of the ProcessSpell return, we need to return false if we fail to call the lua function correctly 2025-06-22 08:55:11 -04:00
Emagi
c25ac12cd6 Make sure all spell references are removed when a spell is removed from an entity 2025-06-21 21:13:45 -04:00
Emagi
f03069a475 Update SpellProcess.cpp 2025-06-17 08:42:31 -04:00
Emagi
a6a0ca85ef Crash fix on spell deletion, remove from pending spells if we already plan to delete 2025-06-17 08:14:10 -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
8b48f9f902 Fix persist through death for things like food/drink spell effects 2025-06-12 09:49:04 -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
6d52f19108 Additional changes made to remove use of spell pointer in recast timer unlock spell logic, assure we have no crash in this area 2025-05-30 11:03:36 -04: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
5d191927cf Fix spells to properly cleanup in function SpellProcess::CheckRemoveTargetFromSpell -- RemoveEffectsFromLuaSpell was not properly cleaning up special effects like sneak/snare/root/so on lingered on to cause a crash with dead spells with /reload spells or other activity 2025-02-04 18:45:48 -05:00
Emagi
41cc36de83 if no targets left in the spell its ok to remove, flip the flag to just remove the maintained part of the spell 2025-01-31 20:06:45 -05:00
Emagi
d463ed3dc5 avoid crash for disabled spell/no spell ptr 2025-01-29 22:01:51 -05:00
Emagi
e9936f1c80 script protection on spells against reuse of the lua state between proc / other spell processes 2025-01-18 18:54:10 -05:00
Emagi
dad7873dc5 LUA functions added: GetSpellCaster(Spell) and GetCasterSpellLevel(Spell) the Spell field is optional if in a spell script
db additionally had field added:

alter table character_spell_effects add column caster_level smallint(5) unsigned not null default 0;
2025-01-18 09:16:35 -05:00
Emagi
c300a5b066 Fixed hangup with remove spell due to remove target list lock 2025-01-16 12:51:09 -05:00
Emagi
3efce0abd6 call spell remove function for reason "target_dead" and "target_removed" also address the long delay between calling the remove function and the death of a spawn. Lastly made it so we can reference the spawn group id after death for a spawn since we remove it from a spawn group. 2025-01-16 12:29:24 -05:00
Emagi
c029874469 assure the spell is friendly when applying only to group members 2025-01-10 19:13:03 -05:00
Emagi
3162106580 Added Lua Functions PlayAnimationString(Spawn: Spawn, String: EmoteStringCommand, Spawn: OptTarget, Boolean: SetNoTarget, Boolean: UseAllSpellTargets, Boolean: IgnoreSelf) and GetSpellTargets(Optional_Spell) if no argument must be in spell script. Fixed spells with no range that are group based to apply to all in group. 2025-01-10 19:08:47 -05:00
Emagi
0a52ab2933 Update SpellProcess.cpp 2024-12-13 18:21:34 -05:00
Emagi
a736e1865f DoT/DD stacking with timers were causing lua state overruns, lua state was being removed from spell too early" 2024-12-02 09:19:28 -05:00
Emagi
716caffb14 Have zone pointer tracked in the luaspell so we can assure we delete the spell properly when zone shuts down or spawn is gone 2024-12-01 18:24:56 -05:00
Emagi
14bb60caf8 avoid crash on remove caster when in a spell attack 2024-12-01 06:29:13 -05:00
Emagi
52ed0cf1d3 make sure spell caster does not persist if they are removed from the spawn list 2024-11-29 09:49:57 -05:00
Emagi
d03c86efef CheckEncounterState behavior added 2024-11-27 17:17:26 -05:00
Emagi
68d1777cf4 avoid stacking spells when you have a conflicted spell removed, should address multiple tick/control effects stacking 2024-11-24 07:46:09 -05:00
Emagi
6b73d3617a avoid a lockup condition due to already locked mutexes 2024-11-22 17:35:53 -05:00
Emagi
315ab1d0e7 Project Nebulark Part 1, So much to list, this is a rough summary
- Raid support and cross peer support for Isle of Refuge, DoF, KoS and AoM clients.
- Zone Persistence added to non-instanced zones.
- Commands: /whogroup, /whoraid, /raidinvite, /raid_looter, /kickfromgroup, /kickfromraid, /leaveraid, /split, /raidsay (rsay) added.
- Cross peer zone and instance support
- Cross tell support (along with ignore)
- Cross ooc support
- Cross group support (can chat, leave group, disband cross peers, update group options)
- Cross who all support
- houses/instances fixed no more cross objects/spawns/etc from other houses
- houses now display characters name with the house zone description
- 1000's of house items now properly work with wall/ceiling
- debug messages removed from housing placement
- Encounters locked to raid instead of group
- group options restricted to raid leader
- reload rules for following are peer wide:
COMMAND_RELOADSTRUCTS
COMMAND_RELOAD_QUESTS
COMMAND_RELOAD_SPELLS
COMMAND_RELOAD_ZONESCRIPTS
COMMAND_RELOAD_FACTIONS
COMMAND_RELOAD_MAIL
COMMAND_RELOAD_GUILDS
COMMAND_RELOAD_RULES
COMMAND_RELOAD_STARTABILITIES
COMMAND_RELOAD_VOICEOVERS
COMMAND_RELOADSPAWNSCRIPTS
COMMAND_RELOADREGIONSCRIPTS
COMMAND_RELOADLUASYSTEM
- special/static zones (always_loaded) are now defined by a peer_priority unsigned short (smallint(5)) in zones table.  peer_priority = server_config world.peerpriority will spawn on that exe instance, if it is not available it is distributed to all peers.  Using the value of 0 (assuming no peer has priority of 0) or 65535 will result in peer distribution of zones.
server_config.json "WorldServer" block updated with the following (web peer port information), priority must be unique for EACH peer:
        "peeraddress": "10.1.1.2",
        "peerport": "9102",
        "peerpriority": "1",

New Command Line Run Arguments for World Exe to override server_config.json values
Allowed options:
  --worldaddress arg         World address
  --internalworldaddress arg Internal world address
  --worldport arg (=0)       Web world port
  --webworldaddress arg      Web world address
  --webworldport arg (=0)    Web world port
  --peerpriority arg (=0)    Peer priority

- fixed Isle of Refuge client group struct (raids added also)
- new log category Peering
- new LUA Functions AddRespawn(Zone, LocationID, RespawnTime) and CreatePersistedRespawn(LocationID, SpawnType, RespawnTime, ZoneID)
2024-11-18 11:13:04 -05:00
Emagi
e4fc6aad5a Zone ruleset_id support for most rules 2024-10-20 09:35:41 -04:00
Emagi
8ac01db525 address spell state not getting reset if call process failed to trigger 2024-09-25 07:35:27 -04:00
Emagi
e7a187cf86 active spells updates 2024-09-22 21:11:48 -04:00
Emagi
555045cbe2 reload spells now works with the lua state redesign and we delete spell in the spell_scripts instead of other places (casttimer, active_spells, so on) 2024-09-10 09:14:40 -04:00
Emagi
297c17b177 Changed to have DestroySpells handle luaspell delete instead of active_spells 2024-09-10 08:27:05 -04:00
Emagi
c4002c363e relocate RemoveCurrentSpell to apply whenever DeleteActiveSpell called (since its removal deletes the lua spell ptr) 2024-09-07 17:12:26 -04:00
Emagi
14003ee3a4 LUA Spell Scripts updated to have a queue much like SpawnScripts, but extended to LuaSpell for tracking procs and lifetime of the lua state
Need to avoid crashes/overrun of the lua stack.
2024-09-04 06:44:04 -04:00
Emagi
b7802d84db fix lua functions being called that don't exist 2024-09-02 10:01:04 -04:00
Emagi
184bc94aa1 lua function call protection 2024-09-02 09:45:36 -04:00
Emagi
950b8e1564 revert and check if "remove" function exists in script 2024-09-02 09:19:47 -04:00
Emagi
727040d2dd Attempt to fix deleting spells more than once if short durations 2024-09-02 08:15:41 -04:00
Emagi
89194da149 EQ2Emu Source Base July 2024 2024-07-22 08:52:28 -04:00