From 95ee81ae2a982a76d1074b7e83cf452259eda822 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Tue, 5 Apr 2022 10:29:36 +0200 Subject: [PATCH] fix(Core/Spells): Razorgore's Explosion ignores LoS. (#11253) * fix(Core/Spells): Razorgore's Explosion ignores LoS. Fixes #11180 * Update. * Update. * Update. --- .../rev_1648906248199850600.sql | 5 ++++ .../game/Spells/SpellInfoCorrections.cpp | 2 ++ .../BlackwingLair/boss_razorgore.cpp | 29 +++++++++---------- 3 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1648906248199850600.sql diff --git a/data/sql/updates/pending_db_world/rev_1648906248199850600.sql b/data/sql/updates/pending_db_world/rev_1648906248199850600.sql new file mode 100644 index 000000000..aa7a34ce2 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1648906248199850600.sql @@ -0,0 +1,5 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1648906248199850600'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=20038; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13,1,20038,0,0,31,0,4,0,0,0,0,0,'','Explosion targets players'); diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index c7f494b15..4c1a95971 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4252,6 +4252,8 @@ void SpellMgr::LoadSpellInfoCorrections() ApplySpellFix({ 20038 }, [](SpellInfo* spellInfo) { spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS); + spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES; + spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT; }); for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp index 4029ab9f0..fb1ab43cd 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_razorgore.cpp @@ -79,7 +79,6 @@ public: void Reset() override { _Reset(); - _died = false; _charmerGUID.Clear(); secondPhase = false; summons.DespawnAll(); @@ -92,6 +91,18 @@ public: { _JustDied(); } + else + { + // Respawn shorty in case of failure during phase 1. + me->SetCorpseRemoveTime(25); + me->SetRespawnTime(30); + me->SaveRespawnTime(); + + // Might not be required, safe measure. + me->SetLootRecipient(nullptr); + + instance->SetData(DATA_EGG_EVENT, FAIL); + } } bool CanAIAttack(Unit const* target) const override @@ -191,24 +202,11 @@ public: void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (!secondPhase && damage >= me->GetHealth() && !_died) + if (!secondPhase && damage >= me->GetHealth()) { - // This is required because he kills himself with the explosion spell, causing a loop. - _died = true; - Talk(SAY_DEATH); DoCastAOE(SPELL_EXPLODE_ORB); DoCastAOE(SPELL_EXPLOSION); - - // Respawn shorty in case of failure during phase 1. - me->SetCorpseRemoveTime(25); - me->SetRespawnTime(30); - me->SaveRespawnTime(); - - // Might not be required, safe measure. - me->SetLootRecipient(nullptr); - - instance->SetData(DATA_EGG_EVENT, FAIL); } } @@ -256,7 +254,6 @@ public: private: bool secondPhase; - bool _died; ObjectGuid _charmerGUID; GuidVector _summonGUIDS; };