630 Commits

Author SHA1 Message Date
Akkadius
405d963005 [Hotfix] "GM flag" vs "GM Flag" 2024-05-04 18:44:19 -05:00
Alex King
aa0e53f5fc
[Messages] Add GM Status and Invulnerability Messages (#4266)
* [Messages] Add GM Status and Invulnerability Messages

* Update zoning.cpp

* Finalize.

* Update corpse.cpp

* Update message

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
2024-05-04 18:07:17 -05:00
Xackery
39bb7e1723
[Lua] Add IsImmuneToSpell Lua Mod (#4278)
* Add IsImmuneToSpell lua mod

* Add lua_parser.h include in spells.cpp
2024-04-28 08:20:34 -04:00
Paul Coene
ac12ba153e
[Spells] Normal Group Spells (non-raid) landed twice on caster (#4240) 2024-04-15 05:07:24 -05:00
KayenEQ
043eeced6f
[Bug Fix] Client not updating HP bar when an HP Buff with a Heal is applied. (#4237)
* [Bug Fix] HP Bar not updating when applying HP Buff with a heal.

Bug: When an HP buff with a heal effect is applied for first time, the heal portion of the effect heals the client and updates HPs currently server side, but client side the HP bar does not register it as a heal thus you display as less than full HP. However due to server thinking your healed, you are unable to correct it by healing.

Solution: You need to resend the HP update after buff completed and action packet resent.

* add SE_MaxHPChange to fix

would result in same bug
2024-04-02 01:13:29 -05:00
Alex King
d77966797e
[Quest API] Add Spell Blocked Event to Perl/Lua (#4217)
* [Spells] Add Unblockable Spell Table and Spell Blocked Event

- Add `EVENT_SPELL_BLOCKED`, exports `$blocking_spell_id`, `$cast_spell_id`, `$blocking_spell`, and `$cast_spell`.

- Add `event_spell_blocked`, exports `e.blocking_spell_id`, `e.cast_spell_id`, `e.blocking_spell`, and `e.cast_spell`.

- Adds `spells_unblockable` table with a `spell_id` and `is_unblockable` column.
- This table will need to be populated based on known spells that should be unblockable.

- This event will allow operators to perform events when spells are blocked.

* Cleanup

* Cleanup

* Update spells.cpp

* Remove unused repositories.

* Finalize

* Update lua_parser_events.cpp
2024-03-31 22:58:30 -05:00
KayenEQ
9e3bf91374
[Spells] Implemented SPA 463 SE_SHIELD_TARGET (#4224)
SPA 463 SE_SHIELD_TARGET

Live description: "Shields your target, taking a percentage of their damage".

Only example spell on live is an NPC who uses it during a raid event "Laurion's Song" expansion. SPA 54492 'Guardian Stance' Described as 100% Melee Shielding

Example of mechanic. Base value = 70. Caster puts buff on target. Each melee hit Buff Target takes 70% less damage, Buff Caster receives 30% of the melee damage.
Added mechanic to cause buff to fade if target or caster are separated by a distance greater than the casting range of the spell. This allows similar mechanics to the /shield ability, without a range removal mechanic it would be too easy to abuse if put on a player spell. *can not confirm live does this currently

Can not be cast on self.
2024-03-30 13:34:03 -04:00
KayenEQ
20d9417628
[Spells] SPA148 Stacking Fix (#4206)
Update to SPA148 which acts to block spells buffs that are of lesser value than the current buff for specific effect slots. This effected was preventing detrimental debuffs from being applied that were using same effect slot. This bug affected a very small amount of spell interactions and was fixed on live in 2018.  Example being Vishmitars Corruption (6642) being blocked by SteelOak Skin (5352)

 I confirmed the behavior on live myself. The detrimental buff  if in conflict should now be applied instead of blocked.
2024-03-27 14:39:40 -04:00
Alex King
abdec39cdd
[Quest API] Add Archetype Methods to Perl/Lua (#4181)
* [Quest API] Add Archetype Methods to Perl/Lua

- Add `$mob->GetArchetypeName()`.
- Add `$mob->IsIntelligenceCasterClass()`.
- Add `$mob->IsPureMeleeClass()`.
- Add `$mob->IsWisdomCasterClass()`.

- Add `mob:GetArchetypeName()`.
- Add `mob:IsIntelligenceCasterClass()`.
- Add `mob:IsPureMeleeClass()`.
- Add `mob:IsWisdomCasterClass()`.

- Allows operators to use mob archetypes to perform different operations.
- Add a namespace for archetypes instead of constants.
- Utilize `IsIntelligenceCasterClass()`, `IsPureMeleeClass()`, and `IsWisdomCasterClass()` where necessary.
-

* Update mob.cpp
2024-03-23 14:37:35 -05:00
Paul Coene
0c582cc4f9
[Bug Fix] Cleanup NPC Mana Tap Logic (#4134)
* [Bug Fix] Cleanup NPC Mana Tap Logic

Mana Tap rule logic was invalid - Cleaned up and simplified, either we care about npc mana or we dont.

* Updated for bypass all rule

* Change so melee targets get blocked even with requiremana rule off

---------

Co-authored-by: Trust <fryguy503@gmail.com>
2024-03-01 22:48:50 -05:00
hg
e920e35a5c
[Cleanup] Use explicit conversions for enum formatting (#4064)
This is prep for updating to fmt 10 which removed implicit conversions
for enums.
2024-02-12 02:58:48 -06:00
Fryguy
772fed5e30
[Feature] Corpse Overhaul (#3938)
# Corpse Overhaul

Changelog:

- Player corpses now have two timers, one specific to the rezability of the corpse and the other to cover the overall rot timer of the player corpse.
- The rezability timer is based on the online presence of the player/account and is not affected by being offline.
- The rot timer is not affected by offline/online status and will count to the rot status of the corpse.
- Corpses can be rezzed multiple times, however only the first rez that yeilds returned xp will be counted. Not other rez will return any xp. This allows for a "Poor mans COTH" as was used many times in the early eras.
- All Corpse class private/protected member variables are all now prefixed with m_
- Added Corpses logging category along with many debug logs
- Removed LoadCharacterCorpseData
- Removed LoadCharacterCorpseEntity
- Added LoadCharacterCorpse(const CharacterCorpsesRepository::CharacterCorpses, const glm::vec4 &position) which simplifies areas of consumption and reduces double queries from removing LoadCharacterCorpseData and replacing LoadCharacterCorpseEntity
- All parameters that were prefixed with in_ have been dropped
- Removed two queries from CheckIsOwnerOnline and have it query the world's CLE by account_id since that is how live works
- Regenerated repository character_corpses
- Cleaned up many list iterators to use range based for loops
- Rate limit Corpse::Process m_is_rezzable with a 1 second check timer
- General code cleanup
- Added a Server Up check to bury all corpses in instances to prevent lost corpses if an instance is released during server down. This facilitates player recovery via shadowrest or priests of luclin.


This PR also now fixes a long standing issue with HasItem performance in our script plugins. It is significantly faster, we will need to coordinate quest changes and comms with operators.

```lua
    if ($client->HasItemOnCorpse($item_id)) {
        return 1;
    }
```

```lua
    --corpse
    if self:HasItemOnCorpse(itemid) then
        return true
    end
```


Testing Completed:

- Create a Corpse
- Standard rezzing
- Ghetto Coth (No Extra XP)
- Rezzing after graveyard move
- Divine Rez works as intended
- No XP Rez (Corpse Call) does not give XP
- Corpse Burying
- Cross Instance Graveyard Corpse movement/Rezzing
- DZ End/Quit Corpse Movement/Rezzing
- Server Shutdown/Reinit DZ Corpse Movement/Rezzing


---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
2024-02-07 23:02:30 -05:00
Paul Coene
86705000b0
Push discpline messages under melee->disciplines (#3987)
* Push discpline messages under melee->disciplines

* Added safe_delete()

* Remove fryguy's new message code and fix existing instead
2024-01-19 08:55:26 -05:00
Paul Coene
27256215b8
[Messages] Fix disciple message added by previous patch. (#3986) 2024-01-15 14:01:24 -05:00
Fryguy
e6dc980315
[Bug Fix] Harm Touch Critical Ratio (#3915)
* [Bug] HT Crit Ratio

This is used to tune and bring HT Crits more in line with the correct values as proven in screenshots.

* requested changes

* mistakenly kept mob::
2024-01-08 22:27:56 -06:00
Fryguy
ec465616b4
[Feature] Rule: UseLiveBlockedMessage Bard Spam (#3933)
When using `UseLiveBlockedMessage` rule, bard will get massively spammed when doing aoe songs that are blocked. Not sure it is resonable to try and filter out all stacking messages from songs, but rather just block bards as a whole. I can not think of many cases where bards care of songs land or not when using this rule.
2024-01-08 22:26:10 -06:00
Fryguy
409b6bf424
[Bug Fix] IsOfClientBotMerc() for Discipline Messages (#3940) 2024-01-08 23:23:09 -05:00
Fryguy
e5db19965f
[Rule] Ensure mana taps only effect NPC's that have mana. (#3907)
* [Rule] Ensure mana taps only effect NPC's that have mana.

* Requested Changes

* fail at the beginning of a cast.

* Fixes
2024-01-08 06:23:54 -05:00
Fryguy
b2d5007466
[Bug Fix] TGB - Added logic to stop bard errors on group songs. (#3906)
* [Bug Fix] TGB - Added logic to stop bard errors on group songs.

Occasionally bards would get an error when singing songs with another group member targetted.

* Logic Fix

* Fixed missing brace
2024-01-08 01:27:45 -06:00
Fryguy
c36b3f030b
[Bug Fix] Disciplines should show when someone casts them. (#3901)
* [Bug] Discs should show when someone casts them.

* Correction to location

* requested changes

* Additional fixes
2024-01-07 22:17:30 -05:00
Fryguy
6db6d7dca9
[Bug Fix] Depop Charm Pet and Detach Debuffs on Evacuate (#3888)
* [Bug Fix] depop charm pet and detach debuffs on evac.

This will depop charm pets and deteach debuffs to prevent some social aggro issues and exploitable conditions with charming and pulling a mob across the zone with no aggro concerns.

* Added Rules
2024-01-07 16:44:15 -05:00
Fryguy
00eb462d47
[Bug Fix] Snare and DOT Stacking (#3897)
Dots won't overwrite regen but regen won't stack with dots.

Sow type spells won't stack if a snare effect is already in place.
2024-01-07 16:01:33 -05:00
Fryguy
48c6db3a9c
[Bug Fix] Buff Sync (#3896)
Align client and server on buff position (easiest fix to sync client/server)
2024-01-07 15:56:27 -05:00
Fryguy
9d5d13fbd0
[Rule] Casting Charm on over level = Aggro (#3886)
Casting charm on target with level above max level of spell will give resist message and aggro
2024-01-07 14:53:42 -05:00
Fryguy
d9cfc3a858
[Feature] Legacy Manaburn Rule (#3872)
* [Feature] Legacy Manaburn Rule

Enabling this rule allows the legacy style Manaburn and LifeBurn early 2003 and earlier.

* Requested Changes

* Requested Change
2024-01-07 12:34:43 -05:00
Fryguy
e52e4d5b3f
[Bug Fix] Bard Caster Level Fixes (#3883)
Bards do not gain benefits from spells like Intellectual Superiority
2024-01-07 12:13:44 -05:00
Fryguy
0c3149a6e5
[Bug Fix] Rez Effects Stacking (#3882)
Nothing conflicts with stacking with resurrection effects
2024-01-07 12:13:36 -05:00
Fryguy
c08200188f
[Bug Fix] Harm Touch Unholy Disc Type (#3874)
* [Bug Fix] Harm Touch Unholy Disc Type

Added an small if block in the ResistSpell() function to set the correct resist type, disease,when HT is casted while the Unholy Disc is up.

* Remove Extra Space
2024-01-07 12:12:21 -05:00
Fryguy
41d9a15c74
[Bug Fix] Vampiric Embrace Fixes (#3873)
* [Bug Fix] Vampiric Embrace Fixes

Fixed the difference of procs for Vampiric Embrace between Necros and Shadow Knights.

* Space

* Cleanup

* Update spdat.h

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2024-01-07 12:12:15 -05:00
Fryguy
6ec09f300a
[Bug Fix] Dire Charm Reset (#3875)
* [Bug Fix] Dire Charm Reset

Added Druid and Necro Dire Charm to Failure Check

* [Rule] RequireMnemonicRetention for Spells 9-12 Rule

Rule is default false to maintain current server setup.

Enabling will require clients to have the required ranks of Mnemonic Retention in order to cast.

This is a stopgap as on live, the buttons are not even available to use. This will mimic the functionality but denying the cast.

* Revert "[Rule] RequireMnemonicRetention for Spells 9-12 Rule"

This reverts commit c65e86223da7fbd961ff1f54f059ccb4e20b5290.
2024-01-07 04:47:09 -05:00
Fryguy
079f612730
[Feature] Legacy Fizzle Code (#3868)
* [Feature] Legacy Fizzle Code
Enabling UseLegacyFizzleCode will enable the legacy fizzle code system.

New fizzle codes modeled on extensive testing in 2001/2002 (thank you druid's grove and graffe)

* requested adjustments

* Requested Changes
2024-01-07 04:46:27 -05:00
Fryguy
2c971fb2de
[Rules] Resist Softcap rules (#3863)
* [Rules] Resist Softcap rules

This rule will allow you to adjust the Resist softcap to help tune resists as you need.

* Fix naming

* Cleanup
2024-01-07 04:46:14 -05:00
Alex King
a724e92638
[Character] Convert Clear/Delete/Get/Update of Character Item Recast to Repositories (#3857)
* [Character] Convert Clear/Delete/Get/Update of Character Item Recast to Repositories

- Convert `ClearOldRecastTimestamps`, `DeleteItemRecast`, `GetItemRecastTimeStamp`, `GetItemRecastTimestamps`, and `UpdateItemRecast` to repositories.

* Update shareddb.cpp

* Update shareddb.cpp

* Update zonedb.cpp
2024-01-07 00:21:14 -06:00
Alex King
2dd0e51936
[Character] Convert Delete/Load/Save of Character Disciplines to Repositories (#3850)
* [Character] Convert Delete/Load/Save of Character Disciplines to Repositories

- Convert `DeleteCharacterDiscipline` and `SaveCharacterDiscipline` to repositories.
- `LoadCharacterDiscipline` already used repositories, cleaned up the logic.

* Update effects.cpp

* Update client.cpp

* Update effects.cpp

* Update client.cpp

* Update zonedb.cpp

* Update client.cpp
2024-01-06 23:41:01 -06:00
Alex King
eb5eb0ca30
[Character] Convert Delete/Load/Save of Character Spells to Repositories (#3842)
* [Character] Convert Delete/Load/Save of Character Spells to Repositories

- Converts `DeleteCharacterSpell`, `LoadCharacterSpellBook`, and `SaveCharacterSpell` to repositories.

* Update zonedb.cpp
2024-01-06 23:12:40 -06:00
Alex King
bc4bebb4a9
[Character] Convert Delete/Save of Character Memmed Spells to Repositories (#3841)
* [Character] Convert Delete/Save of Memmed Spells to Repositories

- Converts `DeleteCharacterMemorizedSpell` and `LoadCharacterMemmedSpells` to repositories.

* Update zonedb.cpp

* Update zonedb.cpp
2024-01-06 23:09:12 -06:00
nytmyr
028ebc3a0c
[Bots] Remove unnecessary error on SetItemReuse (#3795)
This error is not necessary as it can be triggered when clicked spells have secondary effects that run through the same spell checks for clicked items but aren't actually clicked by the item. Spells that trigger other spell effects and some Bard scaling songs could trigger this after the initial click.
2023-12-20 10:01:54 -05:00
Alex King
5cc87cbda7
[Bug Fix] Fix Bard Invisibility Songs breaking every 4 ticks (#3783)
# Notes
- Fixes #2361.
2023-12-18 18:10:28 -06:00
nytmyr
bdf5f8b4a3
[Bots] [Quest API] Add ^clickitem, ^timer, fix GetBestBotSpellForCure (#3755)
* [Bots][Quest API] Add ^clickitem, ^timer, revamp bot timers, fix GetBestBotSpellForCure

This adds the command **^clickitem** for bots.
Bots can click items they are wearing with the provided slot ID, players can use **^invlist** on their bots to see items and slot IDs.
This supports actionables.
**^itemclick 13 byclass 11** would command all Necromancer bots to attempt to click their Primary item.

This adds and supports charges for items to bots, when an item is used, it will lose a charge and cannot be clicked once no charges remain.

This adds the following rules:
**Bots, BotsClickItemsMinLvl** - Minimum level bots can use **^clickitem**.
**Bots, BotsCanClickItems** - Whether or not **^clickitem** is allowed for bots.
**Bots, CanClickMageEpicV1** - Whether or not players are allowed to command their bots to use the Magician Epic 1.0

This adds quest methods to Perl/Lua for:
ClearDisciplineReuseTimer, ClearItemReuseTimer, ClearSpellRecastTimer
GetDisciplineReuseTimer, GetItemReuseTimer, GetSpellRecastTimer
SetDisciplineReuseTimer, SetItemReuseTimer, SetSpellRecastTimer

Discipline and Spell methods use the spell_id to check, get and set. Item uses the item_id.
Clear and Get support wildcards (no spell/item id) to clear all timers of the type or get the first timer of the type.
Get will return the remaining time on the chosen timer, if any.
Set supports a wildcard (no recast/reuse provided) to use the default of the provided type, you can also specify a recast/reuse timer to set that timer to the chosen value.

**^timer** has been added as a bot command, defaulted for GM access.
This can be used to set, get and clear timers of different types. Use **^timer help** for info.

This revamps the way timers are set, stored, loaded for bots.

**GetBestBotSpellForCure** was previously checking only the first spell found and not properly iterating through the checks.

This requires modifications to the **bot_timers** table and is included in this commit.

* Rebase Conflicts

* Update queries to use repositories

* Minor adjustment

* Formatting

* Handle delete as well

* Cleanup.

* Adjust primary keys to prevent conflicts

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
2023-12-17 14:53:34 -05:00
Alex King
aeeb350068
[Cleanup] Cleanup classes.cpp/classes.h (#3752)
* [Cleanup] Cleanup classes.cpp/classes.h

# Notes
- Remove unused methods and cleanup logic.

* Update classes.cpp

* Final push.
2023-12-13 18:38:45 -05:00
nytmyr
a46443b95e
[Bots] Add rule to toggle DT hitting owner (#3757)
**Bots, CazicTouchBotsOwner** is a rule that will toggle whether or not DT will hit the targeted bot or the owner. Similar to how **Spells, CazicTouchTargetsPetOwner** functions except for  bots.
2023-12-11 14:31:33 -05:00
Fryguy
c24834de5d
[Database] Pull Spell Group Cache from Content DB (#3749) 2023-12-08 15:41:09 -05:00
Fryguy
f7780b0247
[Bug Fix] NPC Faction War prevention. (#3595)
* [Bug] NPC Faction War prevention.

This should assist with prevention of NPC Faction waring. I have been using this code on my server for over 5 years with no coredumps or any noted bugs. This was brought up as users have reported a few events where they can trigger NPC's to fight each other.

* Correct a few entries to line up with updated code.

* Re-add missing RestTimer functionality
2023-11-19 11:40:15 -05:00
regneq
1420983700
[Spells] Added IsNightTime() for Dance of the Fireflies (#3667)
* Added IsNightOnly for Dance of the Fireflies spell which should only be cast at night from 7pm to 4pm.

* Update to include IsDayTime and replace magic numbers.
2023-11-04 13:58:08 -04:00
Chris Miles
adc64005f1
[Rules] Add rule to configure max number of procs per round Combat:MaxProcs (#3640) 2023-10-20 14:57:50 -04:00
Alex King
1212ccefef
[Quest API] Add target ID and spell exports to events (#3620)
* [Quest API] Add target ID and spell exports to events

# Notes
- Add `$spell` export to `EVENT_CAST`, `EVENT_CAST_BEGIN`, `EVENT_CAST_BEGIN`, `EVENT_ITEM_CLICK`, `EVENT_ITEM_CLICK_CAST`, `EVENT_ITEM_CLICK_CLIENT`, `EVENT_ITEM_CLICK_CAST_CLIENT`, `EVENT_SPELL_EFFECT_BUFF_TIC_BOT`, `EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT`, `EVENT_SPELL_EFFECT_BUFF_TIC_NPC`, `EVENT_SPELL_EFFECT_BOT`, `EVENT_SPELL_EFFECT_CLIENT`, `EVENT_SPELL_EFFECT_NPC`, `EVENT_SPELL_FADE`, `EVENT_DEATH`, `EVENT_DEATH_COMPLETE`, `EVENT_DEATH_ZONE`, `EVENT_DAMAGE_GIVEN`, and `EVENT_DAMAGE_TAKEN` in Perl.
- Add `$target_id` export to `EVENT_CAST`, `EVENT_CAST_BEGIN`, and `EVENT_CAST_ON` in Perl.
- Add `e.target_id` export to `EVENT_CAST`, `EVENT_CAST_BEGIN`, and `EVENT_CAST_ON` in Lua.

* Add $target/e.target exports.

* Update spells.cpp
2023-10-15 19:40:25 -04:00
Alex King
cf27f2bc88
[Quest API] Add Caster ID Parameter to FindBuff in Perl/Lua (#3590)
* [Quest API] Add Caster ID Parameter to FindBuff in Perl/Lua

# Perl
- Add `$mob->FindBuff(spell_id, caster_id)`.

# Lua
- Add `mob:FindBuff(spell_id, caster_id)`.

# Notes
- Allows operators to check if the spell ID is cast by a specific entity ID.
- We don't use `Mob*` reference here since the mob may have died, left zone, etc.

* Formatting.
2023-09-29 19:38:36 -04:00
Clayton Dunwell
65d4533568
[Bug Fix] Check for Song Skill Increase on Bard Pulse (#3586)
* check for song skill increase on bard pulse

* style changes

* fix spacing
2023-09-17 13:29:48 -05:00
Paul Coene
4357b8c731
[Charm] Fix to update target windows on charm on/off (#3549)
* [Charm] Fix to update target windows on charm on/off

* Removed accidental change

* Removed magic #

* reformated brace style in function that was modified

* Use better names for clear variables

* Forgot header with name change

* More header name changes
2023-08-20 15:43:10 -05:00
Alex King
a75648f73f
[Data Buckets] Distributed Databucket Caching (#3500)
* [Data Buckets] Zone-Based Data Bucket Caching

# Notes
- Adds a data bucket cache so we're not needlessly hitting the database every time we need to read a data bucket value.

* Cleanup and unify GetData access patterns

* Cache work

* Push

* Add to cache when we fetch and do a db hit

* Handle bucket misses in cache

* Formatting

* Logging

* [Data Buckets] Zone-Based Data Bucket Caching

- Adds a data bucket cache so we're not needlessly hitting the database every time we need to read a data bucket value.

* Cleanup and unify GetData access patterns

* Cache work

* Push

* Add to cache when we fetch and do a db hit

* Handle bucket misses in cache

* Formatting

* Remove redundant fetches from cache since GetData does the same thing

* Push progress

* Distributed cache work

* Logging

* Fix issue with scoping where same named keys could return overlapping results

* Misses cache tweak, logging, comments

* Add bot, client, and NPC bucket methods to Lua.

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
2023-07-24 12:22:50 -05:00