fix(Core/Spells): Fixed Glyph of Kilrogg. (#13802)

Fixes #13623
This commit is contained in:
UltraNix
2022-11-16 05:26:05 +01:00
committed by GitHub
parent a490a9ac31
commit ae84bf67c4
2 changed files with 23 additions and 5 deletions

View File

@@ -16681,11 +16681,29 @@ void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, std::list<AuraAppli
Player* Unit::GetSpellModOwner() const
{
if (Player* player = const_cast<Unit*>(this)->ToPlayer())
{
return player;
}
if (Unit* owner = GetOwner())
{
if (Player* player = owner->ToPlayer())
{
return player;
}
}
// Special handling for Eye of Kilrogg
if (GetEntry() == NPC_EYE_OF_KILROGG)
{
if (TempSummon const* tempSummon = ToTempSummon())
{
if (Unit* summoner = tempSummon->GetSummonerUnit())
{
return summoner->ToPlayer();
}
}
}
return nullptr;
}

View File

@@ -62,7 +62,8 @@ enum WarlockSpells
SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106,
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_R1 = 18213,
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC = 18371
SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC = 18371,
SPELL_WARLOCK_EYE_OF_KILROGG_FLY = 58083
};
enum WarlockSpellIcons
@@ -84,16 +85,15 @@ class spell_warl_eye_of_kilrogg : public AuraScript
// Glyph of Kilrogg
if (player->HasAura(58081))
{
if (Unit* charm = player->GetCharm())
{
charm->SetSpeed(MOVE_RUN, 2.14f, true);
if (charm->GetMapId() == 530 || charm->GetMapId() == 571)
{
charm->SetCanFly(true);
charm->SetSpeed(MOVE_FLIGHT, 2.14f, true);
charm->SendMovementFlagUpdate();
charm->CastSpell(charm, SPELL_WARLOCK_EYE_OF_KILROGG_FLY, true);
}
}
}
}
}