mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Spells&GOs: Fix Ritual of Doom.
Thanks QAston and Shocker for helping. Closes #2535
This commit is contained in:
@@ -1393,6 +1393,21 @@ void GameObject::Use(Unit* user)
|
||||
triggered = true;
|
||||
}
|
||||
|
||||
// Cast casterTargetSpell at a random GO user
|
||||
// on the current DB there is only one gameobject that uses this (Ritual of Doom)
|
||||
// and its required target number is 1 (outter for loop will run once)
|
||||
if (info->summoningRitual.casterTargetSpell && info->summoningRitual.casterTargetSpell != 1) // No idea why this field is a bool in some cases
|
||||
{
|
||||
for (int i = 0; i < info->summoningRitual.casterTargetSpellTargets; i++)
|
||||
{
|
||||
std::set<uint32>::const_iterator itr = m_unique_users.begin();
|
||||
std::advance(itr, rand() % m_unique_users.size());
|
||||
|
||||
if (Unit* target = Unit::GetUnit(*this, uint64(*itr)))
|
||||
spellCaster->CastSpell(target, info->summoningRitual.casterTargetSpell, true);
|
||||
}
|
||||
}
|
||||
|
||||
// finish owners spell
|
||||
if (owner)
|
||||
owner->FinishSpell(CURRENT_CHANNELED_SPELL);
|
||||
|
||||
@@ -419,6 +419,7 @@ void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex)
|
||||
damage = unitTarget->CountPctFromMaxHealth(50);
|
||||
break;
|
||||
}
|
||||
case 20625: // Ritual of Doom Sacrifice
|
||||
case 29142: // Eyesore Blaster
|
||||
case 35139: // Throw Boom's Doom
|
||||
case 55269: // Deathly Stare
|
||||
|
||||
@@ -3095,6 +3095,7 @@ void SpellMgr::LoadDbcDataCorrections()
|
||||
case 51852: // The Eye of Acherus (no spawn in phase 2 in db)
|
||||
spellInfo->EffectMiscValue[0] |= 1;
|
||||
break;
|
||||
case 18541: // Ritual of Doom Effect (temp hack, current targeting system requires implicit targets to be set. Was target_dest_caster)
|
||||
case 51904: // Summon Ghouls On Scarlet Crusade (core does not know the triggered spell is summon spell)
|
||||
spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER;
|
||||
break;
|
||||
|
||||
@@ -36,6 +36,57 @@ enum WarlockSpells
|
||||
WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693,
|
||||
};
|
||||
|
||||
class spell_warl_banish : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { }
|
||||
|
||||
class spell_warl_banish_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_banish_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
_removed = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleBanish()
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0))
|
||||
{
|
||||
//No need to remove old aura since its removed due to not stack by current Banish aura
|
||||
PreventHitDefaultEffect(EFFECT_0);
|
||||
PreventHitDefaultEffect(EFFECT_1);
|
||||
PreventHitDefaultEffect(EFFECT_2);
|
||||
_removed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveAura()
|
||||
{
|
||||
if (_removed)
|
||||
PreventHitAura();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish);
|
||||
AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura);
|
||||
}
|
||||
|
||||
bool _removed;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_banish_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 47193 Demonic Empowerment
|
||||
class spell_warl_demonic_empowerment : public SpellScriptLoader
|
||||
{
|
||||
@@ -204,6 +255,33 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 18541 Ritual of Doom Effect
|
||||
class spell_warl_ritual_of_doom_effect : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_ritual_of_doom_effect() : SpellScriptLoader("spell_warl_ritual_of_doom_effect") { }
|
||||
|
||||
class spell_warl_ritual_of_doom_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_ritual_of_doom_effect_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffect += SpellEffectFn(spell_warl_ritual_of_doom_effect_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_ritual_of_doom_effect_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_warl_seed_of_corruption : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -230,62 +308,12 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_warl_banish : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_warl_banish() : SpellScriptLoader("spell_warl_banish") { }
|
||||
|
||||
class spell_warl_banish_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_warl_banish_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
_removed = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleBanish()
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0))
|
||||
{
|
||||
//No need to remove old aura since its removed due to not stack by current Banish aura
|
||||
PreventHitDefaultEffect(EFFECT_0);
|
||||
PreventHitDefaultEffect(EFFECT_1);
|
||||
PreventHitDefaultEffect(EFFECT_2);
|
||||
_removed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveAura()
|
||||
{
|
||||
if (_removed)
|
||||
PreventHitAura();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
BeforeHit += SpellHitFn(spell_warl_banish_SpellScript::HandleBanish);
|
||||
AfterHit += SpellHitFn(spell_warl_banish_SpellScript::RemoveAura);
|
||||
}
|
||||
|
||||
bool _removed;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_warl_banish_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_warlock_spell_scripts()
|
||||
{
|
||||
new spell_warl_banish();
|
||||
new spell_warl_demonic_empowerment();
|
||||
new spell_warl_create_healthstone();
|
||||
new spell_warl_everlasting_affliction();
|
||||
new spell_warl_ritual_of_doom_effect();
|
||||
new spell_warl_seed_of_corruption();
|
||||
new spell_warl_banish();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user