From 2d70ae159f0cfbd466c3dd26552f436d7e28a80a Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Fri, 4 Oct 2024 08:56:34 -0400 Subject: [PATCH 01/16] fix(DB/Spell): Link triggered Shattrath flask effects to flask aura and proper area. (#20122) * Init. * Add Bloodberry Elixir link. * Update `spell_area` entries. * Add root spell, toggle autocast for area effects. --- .../pending_db_world/shattrath-flasks.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 data/sql/updates/pending_db_world/shattrath-flasks.sql diff --git a/data/sql/updates/pending_db_world/shattrath-flasks.sql b/data/sql/updates/pending_db_world/shattrath-flasks.sql new file mode 100644 index 000000000..0b8720a4e --- /dev/null +++ b/data/sql/updates/pending_db_world/shattrath-flasks.sql @@ -0,0 +1,17 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (-41608, -41609, -41610, -41611, -46837, -46839, -45373); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(-41609, -41607, 0, 'Shattrath Flask of Fortification'), +(-41610, -41605, 0, 'Shattrath Flask of Mighty Restoration'), +(-41611, -41604, 0, 'Shattrath Flask of Supreme Power'), +(-41608, -41606, 0, 'Shattrath Flask of Relentless Assault'), +(-46837, -46838, 0, 'Shattrath Flask of Pure Death'), +(-46839, -46840, 0, 'Shattrath Flask of Blinding Light'), +(-45373, -45374, 0, 'Bloodberry Elixir'); + +UPDATE `spell_area` SET `spell` = 41607, `aura_spell` = 41609, `autocast` = 1 WHERE `spell` = 41609; +UPDATE `spell_area` SET `spell` = 41605, `aura_spell` = 41610, `autocast` = 1 WHERE `spell` = 41610; +UPDATE `spell_area` SET `spell` = 41604, `aura_spell` = 41611, `autocast` = 1 WHERE `spell` = 41611; +UPDATE `spell_area` SET `spell` = 41606, `aura_spell` = 41608, `autocast` = 1 WHERE `spell` = 41608; +UPDATE `spell_area` SET `spell` = 46838, `aura_spell` = 46837, `autocast` = 1 WHERE `spell` = 46837; +UPDATE `spell_area` SET `spell` = 46840, `aura_spell` = 46839, `autocast` = 1 WHERE `spell` = 46839; +UPDATE `spell_area` SET `spell` = 45374, `aura_spell` = 45373, `autocast` = 1 WHERE `spell` = 45373; From dda54fd6383fb608134cf861dbea519b70e434d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 4 Oct 2024 12:57:33 +0000 Subject: [PATCH 02/16] chore(DB): import pending files Referenced commit(s): 2d70ae159f0cfbd466c3dd26552f436d7e28a80a --- .../shattrath-flasks.sql => db_world/2024_10_04_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/shattrath-flasks.sql => db_world/2024_10_04_00.sql} (96%) diff --git a/data/sql/updates/pending_db_world/shattrath-flasks.sql b/data/sql/updates/db_world/2024_10_04_00.sql similarity index 96% rename from data/sql/updates/pending_db_world/shattrath-flasks.sql rename to data/sql/updates/db_world/2024_10_04_00.sql index 0b8720a4e..028045138 100644 --- a/data/sql/updates/pending_db_world/shattrath-flasks.sql +++ b/data/sql/updates/db_world/2024_10_04_00.sql @@ -1,3 +1,4 @@ +-- DB update 2024_10_03_00 -> 2024_10_04_00 DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (-41608, -41609, -41610, -41611, -46837, -46839, -45373); INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-41609, -41607, 0, 'Shattrath Flask of Fortification'), From 01b86ec7a6c9307075bd7580290fa0790b84fa6d Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Fri, 4 Oct 2024 16:01:36 +0200 Subject: [PATCH 03/16] fix(Core/Unit): update death state before handling RemoveAllAurasOnDeath() (#20124) fix setDeathState [PATCH] Don't allow units to enter combat upon death https://github.com/TrinityCore/TrinityCore/commit/91ebea4a77e1db10cea85ff8e891a2ea3f3587ab.patch Co-authored-by: trickerer --- src/server/game/Combat/ThreatMgr.cpp | 2 +- src/server/game/Entities/Creature/Creature.cpp | 2 +- src/server/game/Entities/Unit/Unit.cpp | 7 +++---- src/server/game/Entities/Unit/Unit.h | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/server/game/Combat/ThreatMgr.cpp b/src/server/game/Combat/ThreatMgr.cpp index 185ad3f9d..620556c5f 100644 --- a/src/server/game/Combat/ThreatMgr.cpp +++ b/src/server/game/Combat/ThreatMgr.cpp @@ -416,7 +416,7 @@ ThreatMgr::ThreatMgr(Unit* owner) : iCurrentVictim(nullptr), iOwner(owner), iUpd void ThreatMgr::ClearAllThreat() { - if (iOwner->CanHaveThreatList() && !isThreatListEmpty()) + if (iOwner->CanHaveThreatList(true) && !isThreatListEmpty()) iOwner->SendClearThreatListOpcode(); clearReferences(); } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 83373b681..f52e4569b 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1875,7 +1875,7 @@ bool Creature::IsInvisibleDueToDespawn() const if (Unit::IsInvisibleDueToDespawn()) return true; - if (IsAlive() || m_corpseRemoveTime > GameTime::GetGameTime().count()) + if (IsAlive() || isDying() || m_corpseRemoveTime > GameTime::GetGameTime().count()) return false; return true; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index aa14b9287..97a7ecde5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -14518,6 +14518,7 @@ void Unit::setDeathState(DeathState s, bool despawn) { // death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that // it can be used to check creation of death items (such as soul shards). + m_deathState = s; if (s != DeathState::Alive && s != DeathState::JustRespawned) { @@ -14567,8 +14568,6 @@ void Unit::setDeathState(DeathState s, bool despawn) { RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) } - - m_deathState = s; } /*######################################## @@ -14576,14 +14575,14 @@ void Unit::setDeathState(DeathState s, bool despawn) ######## AGGRO SYSTEM ######## ######## ######## ########################################*/ -bool Unit::CanHaveThreatList() const +bool Unit::CanHaveThreatList(bool skipAliveCheck) const { // only creatures can have threat list if (!IsCreature()) return false; // only alive units can have threat list - if (!IsAlive() || isDying()) + if (!skipAliveCheck && !IsAlive()) return false; // totems can not have threat list diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 165e8917e..7be0fbc88 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -831,7 +831,7 @@ public: void SetCombatTimer(uint32 timer) { m_CombatTimer = timer; } // Threat related methods - [[nodiscard]] bool CanHaveThreatList() const; + [[nodiscard]] bool CanHaveThreatList(bool skipAliveCheck = false) const; void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = nullptr); float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL); void TauntApply(Unit* victim); From 508b7369c708112e7434863f9c5cf6d1a7a24bd7 Mon Sep 17 00:00:00 2001 From: Grimdhex <176165533+Grimdhex@users.noreply.github.com> Date: Sat, 5 Oct 2024 11:02:06 +0200 Subject: [PATCH 04/16] fix(Scripts/BlackTemple): exclude off tank of the Azzinoth Flame's charge (#20133) * fix(Scripts/BlackTemple): exclude off tank of the Azzinoth Flame's charge * remove an unecessary elseif * Update boss_illidan.cpp --- .../scripts/Outland/BlackTemple/boss_illidan.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 067970420..80a152a4f 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -1317,8 +1317,18 @@ struct npc_flame_of_azzinoth : public ScriptedAI { ScheduleTimedEvent(10s, [&] { if (Creature* _blade = ObjectAccessor::GetCreature(*me, _bladeGUID)) + { + Unit* offTank = nullptr; + + if (Creature* secondBlaze = me->FindNearestCreature(NPC_BLAZE, 100.0f, true)) + offTank = secondBlaze->GetVictim(); + if (Unit* target = _blade->AI()->SelectTarget(SelectTargetMethod::Random, 0, -40.0f, true)) - DoCast(target, SPELL_CHARGE); + { + if (!offTank || offTank != target) + DoCast(target, SPELL_CHARGE); + } + } }, 5s, 20s); ScheduleTimedEvent(10s, 20s, [&] { From d340ae029b19c5c8ddfa61f0bb0d4725234f3452 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 5 Oct 2024 06:02:31 -0300 Subject: [PATCH 05/16] fix(Scripts/Dragonblight): Fix Torturer Leclaft spamming abilities (#20130) fix(Scripts/Dragonblight): Fix Toturer Leclaft spamming abilities --- src/server/scripts/Northrend/zone_dragonblight.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 4f7d18fd9..3cf2d71ef 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -2137,6 +2137,7 @@ public: { _textCounter = 1; _playerGUID.Clear(); + _events.Reset(); } void JustEngagedWith(Unit* who) override From a57d8db81a247b23823703be78e22dad6ddba8b0 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Mon, 7 Oct 2024 07:55:00 -0400 Subject: [PATCH 06/16] fix(Core/CharmInfo): Add exception for Kil'jaeden dragon charm spells. (#20150) Init. --- src/server/game/Entities/Unit/CharmInfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Entities/Unit/CharmInfo.cpp b/src/server/game/Entities/Unit/CharmInfo.cpp index c278bd366..425d15579 100644 --- a/src/server/game/Entities/Unit/CharmInfo.cpp +++ b/src/server/game/Entities/Unit/CharmInfo.cpp @@ -87,6 +87,7 @@ void CharmInfo::InitPossessCreateSpells() case 27664: // Crashin' Thrashin' Racer case 40281: // Crashin' Thrashin' Racer case 23109: // Vengeful Spirit + case 25653: // Power of the Blue Flight break; default: InitEmptyActionBar(); From cc5c582b4d0cb941a3c28bf49fe3fed80bc85e98 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Mon, 7 Oct 2024 07:55:28 -0400 Subject: [PATCH 07/16] fix(Core/Spell): Include damaging spells for starting combat. (#20154) Init. --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e28ee5626..dfc8d1f0d 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2929,7 +2929,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) { if (missInfo != SPELL_MISS_EVADE && !m_caster->IsFriendlyTo(effectUnit) && (!m_spellInfo->IsPositive() || m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL))) { - if (!m_triggeredByAuraSpell.spellInfo || (!(m_triggeredByAuraSpell.spellInfo->Effects[m_triggeredByAuraSpell.effectIndex].TriggerSpell == m_spellInfo->Id) && !(m_triggeredByAuraSpell.spellInfo->IsAuraEffectEqual(m_spellInfo)))) + if (!m_triggeredByAuraSpell.spellInfo || m_damage || (!(m_triggeredByAuraSpell.spellInfo->Effects[m_triggeredByAuraSpell.effectIndex].TriggerSpell == m_spellInfo->Id) && !(m_triggeredByAuraSpell.spellInfo->IsAuraEffectEqual(m_spellInfo)))) m_caster->CombatStart(effectUnit, !(m_spellInfo->AttributesEx3 & SPELL_ATTR3_SUPRESS_TARGET_PROCS)); // Patch 3.0.8: All player spells which cause a creature to become aggressive to you will now also immediately cause the creature to be tapped. From d5d5df67ba0f792e8c80e78ef3d21357b9c2cd0c Mon Sep 17 00:00:00 2001 From: Rorschach91 <108557877+Rorschach91@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:53:42 +0200 Subject: [PATCH 08/16] fix(Script/Mother Shahraz) Add new teleport points. (#20137) * fix(Script/Mother Shahraz) Increase min teleport range and add new teleport points. This fix increase minimum teleport range for Fatal Attraction and It adds 5 new teleport points if the boss is near the platform. * Update boss_mother_shahraz.cpp --- .../Outland/BlackTemple/boss_mother_shahraz.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index d0028399a..1149c7b69 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -196,12 +196,22 @@ class spell_mother_shahraz_saber_lash_aura : public AuraScript } }; -const Position validTeleportStairsPos[4] = +const Position validTeleportStairsPos[9] = { + //Platform teleports + + {945.00f, 149.17f, 197.07483}, + {956.92f, 153.20f, 197.07483}, + {933.69f, 154.15f, 197.07483}, + + //Floor teleports + {966.87f, 184.45f, 192.84f}, {927.22f, 187.04f, 192.84f}, {922.54f, 110.09f, 192.84f}, - {958.01f, 110.47f, 192.84f} + {958.01f, 110.47f, 192.84f}, + {939.95f, 108.29f, 192.84f}, + {945.68f, 205.74f, 192.84f} }; constexpr float minTeleportDist = 30.f; @@ -227,7 +237,7 @@ class spell_mother_shahraz_fatal_attraction : public SpellScript // Check if the boss is near stairs to avoid players falling through the platform with random teleports. if (GetCaster()->GetPositionY() < 194.f) - finalDest = validTeleportStairsPos[urand(0, 3)]; + finalDest = validTeleportStairsPos[urand(0, 8)]; else { finalDest = GetCaster()->GetNearPosition(frand(minTeleportDist, maxTeleportDist), static_cast(rand_norm()) * static_cast(2 * M_PI), true); From 8e7463e8bc3cc0d3e156690e6d87a9e5b13b32c6 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:40:06 -0400 Subject: [PATCH 09/16] fix(DB/Spell): Add armor ignore attribute to Shared Rule damage spell. (#20160) Init. --- data/sql/updates/pending_db_world/shared-rule-damage.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/shared-rule-damage.sql diff --git a/data/sql/updates/pending_db_world/shared-rule-damage.sql b/data/sql/updates/pending_db_world/shared-rule-damage.sql new file mode 100644 index 000000000..ec07b7eb0 --- /dev/null +++ b/data/sql/updates/pending_db_world/shared-rule-damage.sql @@ -0,0 +1,2 @@ +DELETE FROM `spell_custom_attr` WHERE `spell_id` = 41342; +INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (41342, 32768); From 98b03c07f09f47c9e7cb8a4af95f3090f06a2c18 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 8 Oct 2024 14:41:02 +0000 Subject: [PATCH 10/16] chore(DB): import pending files Referenced commit(s): 8e7463e8bc3cc0d3e156690e6d87a9e5b13b32c6 --- .../shared-rule-damage.sql => db_world/2024_10_08_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/shared-rule-damage.sql => db_world/2024_10_08_00.sql} (76%) diff --git a/data/sql/updates/pending_db_world/shared-rule-damage.sql b/data/sql/updates/db_world/2024_10_08_00.sql similarity index 76% rename from data/sql/updates/pending_db_world/shared-rule-damage.sql rename to data/sql/updates/db_world/2024_10_08_00.sql index ec07b7eb0..1e87d9351 100644 --- a/data/sql/updates/pending_db_world/shared-rule-damage.sql +++ b/data/sql/updates/db_world/2024_10_08_00.sql @@ -1,2 +1,3 @@ +-- DB update 2024_10_04_00 -> 2024_10_08_00 DELETE FROM `spell_custom_attr` WHERE `spell_id` = 41342; INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (41342, 32768); From a8d970caa77d4c0ef8935c294c5192b4f8792ccc Mon Sep 17 00:00:00 2001 From: Jelle Meeus Date: Tue, 8 Oct 2024 21:44:32 +0200 Subject: [PATCH 11/16] fix(Core/Unit): add rage gain when attack is fully blocked, dodged or parried (#19377) * generate rage if victim fully block, dodge, parry * update rage calculation * calc pct at the end * update comment to link to Rage formulae and mention Bornak's bluepost archived link to Bornak's bluepost https://web.archive.org/web/20090604123729/http://forums.worldofwarcraft.com/thread.html?topicId=17367760070&pageNo=13#02500 --- src/server/game/Entities/Unit/Unit.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 97a7ecde5..694313015 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1893,6 +1893,23 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) Unit::DealDamage(this, victim, damageInfo->damages[i].damage, &cleanDamage, DIRECT_DAMAGE, SpellSchoolMask(damageInfo->damages[i].damageSchoolMask), nullptr, durabilityLoss); } + // gain rage if attack is fully blocked, dodged or parried + if (HasActivePowerType(POWER_RAGE) && (damageInfo->TargetState == VICTIMSTATE_BLOCKS || damageInfo->TargetState == VICTIMSTATE_DODGE || damageInfo->TargetState == VICTIMSTATE_PARRY)) + { + switch (damageInfo->attackType) + { + case BASE_ATTACK: + case OFF_ATTACK: + { + uint32 weaponSpeedHitFactor = uint32(GetAttackTime(damageInfo->attackType) / 1000.0f * (damageInfo->attackType == BASE_ATTACK ? 3.5f : 1.75f)); + RewardRage(damageInfo->cleanDamage, weaponSpeedHitFactor, true); + break; + } + default: + break; + } + } + // If this is a creature and it attacks from behind it has a probability to daze it's victim if ((damageInfo->damages[0].damage + damageInfo->damages[1].damage) && ((damageInfo->hitOutCome == MELEE_HIT_CRIT || damageInfo->hitOutCome == MELEE_HIT_CRUSHING || damageInfo->hitOutCome == MELEE_HIT_NORMAL || damageInfo->hitOutCome == MELEE_HIT_GLANCING) && !IsPlayer() && !ToCreature()->IsControlledByPlayer() && !victim->HasInArc(M_PI, this) @@ -20112,6 +20129,7 @@ void Unit::SendRemoveFromThreatListOpcode(HostileReference* pHostileReference) void Unit::RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker) { + // Rage formulae https://wowwiki-archive.fandom.com/wiki/Rage#Formulae float addRage; float rageconversion = ((0.0091107836f * GetLevel() * GetLevel()) + 3.225598133f * GetLevel()) + 4.2652911f; @@ -20122,9 +20140,10 @@ void Unit::RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker) if (attacker) { - addRage = (damage / rageconversion * 7.5f + weaponSpeedHitFactor) / 2; - - // talent who gave more rage on attack + // see Bornak's bluepost explanation (05/29/2009) + float rageFromDamageDealt = damage / rageconversion * 7.5f; + addRage = (rageFromDamageDealt + weaponSpeedHitFactor) / 2.0f; + addRage = std::min(addRage, rageFromDamageDealt * 2.0f); AddPct(addRage, GetTotalAuraModifier(SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT)); } else From fd6d2efccbd739c2931a9ced5b9ddfe65f6d25c0 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Wed, 9 Oct 2024 05:00:20 -0400 Subject: [PATCH 12/16] fix(Core/Unit): Add mana drain effect to Black Bow of the Betrayer. (#20155) * Init. Co-authored by: stfxpi (stfx) Original CMaNGOS commit: https://github.com/cmangos/mangos-tbc/commit/c750533b5ec7f688d7f026b18edd19acccd68f2f * Add/adjust comments. --- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 694313015..edb198478 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -8987,9 +8987,9 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 67772; } break; } - // Mana Drain Trigger - case 27522: - case 40336: + case 27522: // Mana Drain Trigger + case 40336: // Mana Drain Trigger + case 46939: // Black Bow of the Betrayer { // On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target. if (IsAlive()) From b2f61161e8139dfc2a2e89e1b7aedc373dc09da3 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Wed, 9 Oct 2024 05:01:03 -0400 Subject: [PATCH 13/16] fix(DB/Spell): Remove Arcane Missile spell info overrides. (#20054) Init. --- data/sql/updates/pending_db_world/arcane-missile-dbc.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/arcane-missile-dbc.sql diff --git a/data/sql/updates/pending_db_world/arcane-missile-dbc.sql b/data/sql/updates/pending_db_world/arcane-missile-dbc.sql new file mode 100644 index 000000000..a6397b280 --- /dev/null +++ b/data/sql/updates/pending_db_world/arcane-missile-dbc.sql @@ -0,0 +1 @@ +DELETE FROM `spell_dbc` WHERE `ID` IN (5143, 5144, 5145, 8416, 8417, 10211, 10212, 25345, 27075, 38699, 38704, 42843, 42846); From 0fa770d56788196bda608343dde4ceb452848f89 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 9 Oct 2024 09:01:16 +0000 Subject: [PATCH 14/16] chore(DB): import pending files Referenced commit(s): fd6d2efccbd739c2931a9ced5b9ddfe65f6d25c0 --- .../arcane-missile-dbc.sql => db_world/2024_10_09_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/arcane-missile-dbc.sql => db_world/2024_10_09_00.sql} (74%) diff --git a/data/sql/updates/pending_db_world/arcane-missile-dbc.sql b/data/sql/updates/db_world/2024_10_09_00.sql similarity index 74% rename from data/sql/updates/pending_db_world/arcane-missile-dbc.sql rename to data/sql/updates/db_world/2024_10_09_00.sql index a6397b280..1ee95eede 100644 --- a/data/sql/updates/pending_db_world/arcane-missile-dbc.sql +++ b/data/sql/updates/db_world/2024_10_09_00.sql @@ -1 +1,2 @@ +-- DB update 2024_10_08_00 -> 2024_10_09_00 DELETE FROM `spell_dbc` WHERE `ID` IN (5143, 5144, 5145, 8416, 8417, 10211, 10212, 25345, 27075, 38699, 38704, 42843, 42846); From 31cb7579e0f2240a4e68d8d8d499dc4160f82988 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:08:37 -0300 Subject: [PATCH 15/16] fix(Core/Scripts): Further improve the ScheduleHealthCheck() function (#20163) --- .../game/AI/ScriptedAI/ScriptedCreature.cpp | 32 ++++++++++--------- .../game/AI/ScriptedAI/ScriptedCreature.h | 1 + 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index fb7b01fec..5c6387d06 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -584,7 +584,8 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature), instance(creature->GetInstanceScript()), summons(creature), - _bossId(bossId) + _bossId(bossId), + _nextHealthCheck(0, { }, false) { callForHelpRange = 0.0f; if (instance) @@ -733,22 +734,20 @@ void BossAI::UpdateAI(uint32 diff) void BossAI::DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) { - if (!_healthCheckEvents.empty()) - { - for (auto& check : _healthCheckEvents) + if (_nextHealthCheck._valid) + if (me->HealthBelowPctDamaged(_nextHealthCheck._healthPct, damage)) { - if (check._valid && me->HealthBelowPctDamaged(check._healthPct, damage)) - { - check._exec(); - check._valid = false; - } - } + _nextHealthCheck._exec(); + _nextHealthCheck._valid = false; - _healthCheckEvents.remove_if([&](HealthCheckEventData data) -> bool - { - return !data._valid; - }); - } + _healthCheckEvents.remove_if([&](HealthCheckEventData data) -> bool + { + return data._healthPct == _nextHealthCheck._healthPct; + }); + + if (!_healthCheckEvents.empty()) + _nextHealthCheck = _healthCheckEvents.front(); + } } /** @@ -760,6 +759,7 @@ void BossAI::DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /* void BossAI::ScheduleHealthCheckEvent(uint32 healthPct, std::function exec) { _healthCheckEvents.push_back(HealthCheckEventData(healthPct, exec)); + _nextHealthCheck = _healthCheckEvents.front(); }; void BossAI::ScheduleHealthCheckEvent(std::initializer_list healthPct, std::function exec) @@ -768,6 +768,8 @@ void BossAI::ScheduleHealthCheckEvent(std::initializer_list healthPct, st { _healthCheckEvents.push_back(HealthCheckEventData(checks, exec)); } + + _nextHealthCheck = _healthCheckEvents.front(); } // WorldBossAI - for non-instanced bosses diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 69830d815..f7e55f32e 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -503,6 +503,7 @@ protected: private: uint32 const _bossId; std::list _healthCheckEvents; + HealthCheckEventData _nextHealthCheck; }; class WorldBossAI : public ScriptedAI From 6ef16f18bbceba37399871981cffc3d3b475a174 Mon Sep 17 00:00:00 2001 From: ConorB <126167126+ConorB1745@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:43:57 +0200 Subject: [PATCH 16/16] fix(Script): Fix npc following player after starting duel (#20161) * fix(Script): Changed npc move script Death Knight Initiate (id: 28406) was not turning to face the player after they engaged a duel instead the npc followed the player wherever they went. Change was to remove script line for follow and replace with SetFacingToObject and specify the player as the object. Closes AzerothCore issue #20108 * fix(script): Fix npc following player whitespace issue Attempt to fix code styling fail on whtiespace * fix(script): Fix npc following player another whitespace issue Found more whitespace that was made by the fix to previous whitespace --- src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 5b8d272f6..b983b0b30 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -289,7 +289,7 @@ public: _duelInProgress = true; timer = 600000; // clear playerGUIDs after 10 minutes if no one initiates a duel - me->GetMotionMaster()->MoveFollow(caster, 2.0f, 0.0f); + me->SetFacingToObject(caster); events.ScheduleEvent(EVENT_SPEAK, 3s); events.ScheduleEvent(EVENT_SPEAK + 1, 7s);