Scripts/Spells: Update Death Knights Presences
This commit is contained in:
1 parent
3682f0e7b9
commit
844671c5c7
1 file changed
+66
-90
@@ -46,10 +46,10 @@ enum DeathKnightSpells
|
||||
SPELL_DK_GHOUL_EXPLODE = 47496,
|
||||
SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE = 58625,
|
||||
SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1 = 50365,
|
||||
SPELL_DK_IMPROVED_DEATH_STRIKE = 62905,
|
||||
SPELL_DK_IMPROVED_FROST_PRESENCE_R1 = 50384,
|
||||
SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED = 63621,
|
||||
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1 = 50391,
|
||||
SPELL_DK_IMPROVED_DEATH_STRIKE = 62905,
|
||||
SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622,
|
||||
SPELL_DK_ITEM_SIGIL_VENGEFUL_HEART = 64962,
|
||||
SPELL_DK_ITEM_T8_MELEE_4P_BONUS = 64736,
|
||||
@@ -776,25 +776,39 @@ class spell_dk_improved_blood_presence : public SpellScriptLoader
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
void HandleModDamagePctTaken(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if ((target->HasAura(SPELL_DK_FROST_PRESENCE) || target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) && !target->HasAura(SPELL_DK_BLOOD_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
target->CastCustomSpell(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, -aurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void HandleModAttackerMeleeCritChance(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (target->HasAura(SPELL_DK_BLOOD_PRESENCE))
|
||||
if (AuraEffect* triggeredEff = target->GetAuraEffect(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, EFFECT_1))
|
||||
triggeredEff->SetAmount(aurEff->GetAmount());
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target->HasAura(SPELL_DK_BLOOD_PRESENCE))
|
||||
|
||||
if (target->HasAura(SPELL_DK_BLOOD_PRESENCE))
|
||||
{
|
||||
if (AuraEffect* triggeredEff = target->GetAuraEffect(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, EFFECT_1))
|
||||
triggeredEff->SetAmount(0);
|
||||
}
|
||||
else
|
||||
target->RemoveAura(SPELL_DK_BLOOD_PRESENCE_TRIGGERED);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_blood_presence_AuraScript::HandleModDamagePctTaken, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_blood_presence_AuraScript::HandleModAttackerMeleeCritChance, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -817,7 +831,6 @@ class spell_dk_improved_frost_presence : public SpellScriptLoader
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED))
|
||||
return false;
|
||||
@@ -827,19 +840,13 @@ class spell_dk_improved_frost_presence : public SpellScriptLoader
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if ((target->HasAura(SPELL_DK_BLOOD_PRESENCE) || target->HasAura(SPELL_DK_UNHOLY_PRESENCE)) && !target->HasAura(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED))
|
||||
{
|
||||
int32 basePoints1 = aurEff->GetAmount();
|
||||
target->CastCustomSpell(target, SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED, NULL, &basePoints1, NULL, true, NULL, aurEff);
|
||||
}
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target->HasAura(SPELL_DK_FROST_PRESENCE))
|
||||
target->RemoveAura(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED);
|
||||
GetTarget()->RemoveAura(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
@@ -869,7 +876,6 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_FROST_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_UNHOLY_PRESENCE)
|
||||
|| !sSpellMgr->GetSpellInfo(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
return false;
|
||||
return true;
|
||||
@@ -878,19 +884,13 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (target->HasAura(SPELL_DK_UNHOLY_PRESENCE) && !target->HasAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
{
|
||||
// Not listed as any effect, only base points set in dbc
|
||||
int32 basePoints0 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
||||
target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0, &basePoints0, &basePoints0, true, NULL, aurEff);
|
||||
}
|
||||
if ((target->HasAura(SPELL_DK_BLOOD_PRESENCE) || target->HasAura(SPELL_DK_FROST_PRESENCE)) && !target->HasAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
target->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED);
|
||||
GetTarget()->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
@@ -934,91 +934,67 @@ class spell_dk_presence : public SpellScriptLoader
|
||||
return true;
|
||||
}
|
||||
|
||||
void CheckImprovedBloodPresence()
|
||||
void HandleImprovedBloodPresence(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
/// @todo: rune regg (effect 2)
|
||||
Unit* target = GetTarget();
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1, EFFECT_0))
|
||||
if (!target->HasAura(SPELL_DK_BLOOD_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT1, aurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void CheckImprovedFrostPresence()
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_R1, EFFECT_0))
|
||||
if (!target->HasAura(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void CheckImprovedUnholyPresence(bool inUnholy = false)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1, EFFECT_0))
|
||||
if (Aura const* aura = target->GetAuraOfRankedSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1))
|
||||
{
|
||||
if (inUnholy)
|
||||
CustomSpellValues val;
|
||||
if (GetSpellInfo()->Id == SPELL_DK_BLOOD_PRESENCE)
|
||||
{
|
||||
// Not listed as any effect, only base points set
|
||||
int32 bp = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
||||
target->CastCustomSpell(target, SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &bp, &bp, &bp, true, 0, aurEff);
|
||||
if (AuraEffect const* impAurEff = aura->GetEffect(EFFECT_1))
|
||||
val.AddSpellMod(SPELLVALUE_BASE_POINT1, impAurEff->GetAmount());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (AuraEffect const* impAurEff = aura->GetEffect(EFFECT_0))
|
||||
val.AddSpellMod(SPELLVALUE_BASE_POINT0, -impAurEff->GetAmount());
|
||||
}
|
||||
|
||||
if (!target->HasAura(SPELL_DK_BLOOD_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_BLOOD_PRESENCE_TRIGGERED, val, target, TRIGGERED_FULL_MASK, NULL, aurEff);
|
||||
}
|
||||
else if (GetSpellInfo()->Id == SPELL_DK_BLOOD_PRESENCE)
|
||||
target->CastSpell(target, SPELL_DK_BLOOD_PRESENCE_TRIGGERED, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
void HandleImprovedFrostPresence(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (GetSpellInfo()->Id != SPELL_DK_BLOOD_PRESENCE && GetSpellInfo()->Id != SPELL_DK_UNHOLY_PRESENCE)
|
||||
return;
|
||||
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
case SPELL_DK_BLOOD_PRESENCE:
|
||||
target->CastSpell(target, SPELL_DK_BLOOD_PRESENCE_TRIGGERED, true);
|
||||
CheckImprovedFrostPresence();
|
||||
CheckImprovedUnholyPresence();
|
||||
break;
|
||||
case SPELL_DK_FROST_PRESENCE:
|
||||
target->CastSpell(target, SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED, true);
|
||||
CheckImprovedBloodPresence();
|
||||
CheckImprovedUnholyPresence();
|
||||
break;
|
||||
case SPELL_DK_UNHOLY_PRESENCE:
|
||||
CheckImprovedBloodPresence();
|
||||
CheckImprovedFrostPresence();
|
||||
CheckImprovedUnholyPresence(true);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
Unit* target = GetTarget();
|
||||
if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_R1, EFFECT_0))
|
||||
if (!target->HasAura(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, impAurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void HandleImprovedUnholyPresence(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetSpellInfo()->Id != SPELL_DK_BLOOD_PRESENCE && GetSpellInfo()->Id != SPELL_DK_FROST_PRESENCE)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1, EFFECT_0))
|
||||
if (!target->HasAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED))
|
||||
target->CastCustomSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, SPELLVALUE_BASE_POINT0, impAurEff->GetAmount(), target, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->RemoveAura(SPELL_DK_BLOOD_PRESENCE_TRIGGERED);
|
||||
target->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED);
|
||||
target->RemoveAura(SPELL_DK_IMPROVED_FROST_PRESENCE_TRIGGERED);
|
||||
target->RemoveAura(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_TRIGGERED);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
uint32 auraType = 0;
|
||||
|
||||
switch (m_scriptSpellId)
|
||||
{
|
||||
case SPELL_DK_BLOOD_PRESENCE:
|
||||
auraType = SPELL_AURA_MOD_BASE_RESISTANCE_PCT;
|
||||
break;
|
||||
case SPELL_DK_FROST_PRESENCE:
|
||||
auraType = SPELL_AURA_MOD_DAMAGE_PERCENT_DONE;
|
||||
break;
|
||||
case SPELL_DK_UNHOLY_PRESENCE:
|
||||
auraType = SPELL_AURA_MOD_MELEE_HASTE;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleEffectApply, EFFECT_0, auraType, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_presence_AuraScript::HandleEffectRemove, EFFECT_0, auraType, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleImprovedBloodPresence, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleImprovedFrostPresence, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleImprovedUnholyPresence, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user