mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-13 03:22:40 -04:00
Core/Spells: Removed some more deprecated spells code
This commit is contained in:
@@ -5579,8 +5579,9 @@ SpellCastResult Spell::CheckCasterAuras() const
|
||||
bool usableInStun = m_spellInfo->AttributesEx5 & SPELL_ATTR5_USABLE_WHILE_STUNNED;
|
||||
|
||||
// Glyph of Pain Suppression
|
||||
// Allow Pain Suppression and Guardian Spirit to be cast while stunned
|
||||
// there is no other way to handle it
|
||||
if (m_spellInfo->Id == 33206 && !m_caster->HasAura(63248))
|
||||
if ((m_spellInfo->Id == 33206 || m_spellInfo->Id == 47788) && !m_caster->HasAura(63248))
|
||||
usableInStun = false;
|
||||
|
||||
// Check whether the cast should be prevented by any state you might have.
|
||||
|
||||
@@ -401,73 +401,12 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
// Incinerate Rank 1 & 2
|
||||
if ((m_spellInfo->SpellFamilyFlags[1] & 0x000040) && m_spellInfo->SpellIconID == 2128)
|
||||
{
|
||||
// Incinerate does more dmg (dmg*0.25) if the target have Immolate debuff.
|
||||
// Incinerate does more dmg (dmg/6) if the target have Immolate debuff.
|
||||
// Check aura state for speed but aura state set not only for Immolate spell
|
||||
if (unitTarget->HasAuraState(AURA_STATE_CONFLAGRATE))
|
||||
{
|
||||
if (unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x4, 0, 0))
|
||||
damage += damage/4;
|
||||
}
|
||||
}
|
||||
// Conflagrate - consumes Immolate or Shadowflame
|
||||
else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE)
|
||||
{
|
||||
AuraEffect const* aura = NULL; // found req. aura for damage calculation
|
||||
|
||||
Unit::AuraEffectList const &mPeriodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
for (Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
|
||||
{
|
||||
// for caster applied auras only
|
||||
if ((*i)->GetSpellInfo()->SpellFamilyName != SPELLFAMILY_WARLOCK ||
|
||||
(*i)->GetCasterGUID() != m_caster->GetGUID())
|
||||
continue;
|
||||
|
||||
// Immolate
|
||||
if ((*i)->GetSpellInfo()->SpellFamilyFlags[0] & 0x4)
|
||||
{
|
||||
aura = *i; // it selected always if exist
|
||||
break;
|
||||
}
|
||||
|
||||
// Shadowflame
|
||||
if ((*i)->GetSpellInfo()->SpellFamilyFlags[2] & 0x00000002)
|
||||
aura = *i; // remember but wait possible Immolate as primary priority
|
||||
}
|
||||
|
||||
// found Immolate or Shadowflame
|
||||
if (aura)
|
||||
{
|
||||
uint32 pdamage = uint32(std::max(aura->GetAmount(), 0));
|
||||
pdamage = m_caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount());
|
||||
pdamage = unitTarget->SpellDamageBonusTaken(m_caster, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount());
|
||||
uint32 pct_dir = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 1));
|
||||
uint8 baseTotalTicks = uint8(m_caster->CalcSpellDuration(aura->GetSpellInfo()) / aura->GetSpellInfo()->Effects[EFFECT_0].Amplitude);
|
||||
damage += int32(CalculatePctU(pdamage * baseTotalTicks, pct_dir));
|
||||
|
||||
uint32 pct_dot = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 2)) / 3;
|
||||
m_spellValue->EffectBasePoints[1] = m_spellInfo->Effects[EFFECT_1].CalcBaseValue(int32(CalculatePctU(pdamage * baseTotalTicks, pct_dot)));
|
||||
|
||||
apply_direct_bonus = false;
|
||||
// Glyph of Conflagrate
|
||||
if (!m_caster->HasAura(56235))
|
||||
unitTarget->RemoveAurasDueToSpell(aura->GetId(), m_caster->GetGUID());
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Shadow Bite
|
||||
else if (m_spellInfo->SpellFamilyFlags[1] & 0x400000)
|
||||
{
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())
|
||||
{
|
||||
if (Player* owner = m_caster->GetOwner()->ToPlayer())
|
||||
{
|
||||
if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, 214, 0))
|
||||
{
|
||||
int32 bp0 = aurEff->GetId() == 54037 ? 4 : 8;
|
||||
m_caster->CastCustomSpell(m_caster, 54425, &bp0, NULL, NULL, true);
|
||||
}
|
||||
}
|
||||
damage += damage / 6;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -498,20 +437,10 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
// Ferocious Bite
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags[0] & 0x000800000) && m_spellInfo->SpellVisual[0] == 6587)
|
||||
{
|
||||
// converts each extra point of energy into ($f1+$AP/410) additional damage
|
||||
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
|
||||
float multiple = ap / 410 + m_spellInfo->Effects[effIndex].DamageMultiplier;
|
||||
int32 energy = -(m_caster->ModifyPower(POWER_ENERGY, -30));
|
||||
damage += int32(energy * multiple);
|
||||
damage += int32(CalculatePctN(m_caster->ToPlayer()->GetComboPoints() * ap, 7));
|
||||
}
|
||||
// Wrath
|
||||
else if (m_spellInfo->SpellFamilyFlags[0] & 0x00000001)
|
||||
{
|
||||
// Improved Insect Swarm
|
||||
if (AuraEffect const* aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 1771, 0))
|
||||
if (unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00200000, 0, 0))
|
||||
AddPctN(damage, aurEff->GetAmount());
|
||||
// converts each extra point of energy ( up to 25 energy ) into additional damage
|
||||
int32 energy = -(m_caster->ModifyPower(POWER_ENERGY, -25));
|
||||
// 25 energy = 100% more damage
|
||||
AddPctN(damage, energy * 4);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -591,54 +520,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
if (m_caster->HasAura(57627)) // Charge 6 sec post-affect
|
||||
damage *= 2;
|
||||
}
|
||||
// Steady Shot
|
||||
else if (m_spellInfo->SpellFamilyFlags[1] & 0x1)
|
||||
{
|
||||
bool found = false;
|
||||
// check dazed affect
|
||||
Unit::AuraEffectList const& decSpeedList = unitTarget->GetAuraEffectsByType(SPELL_AURA_MOD_DECREASE_SPEED);
|
||||
for (Unit::AuraEffectList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter)
|
||||
{
|
||||
if ((*iter)->GetSpellInfo()->SpellIconID == 15 && (*iter)->GetSpellInfo()->Dispel == 0)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: should this be put on taken but not done?
|
||||
if (found)
|
||||
damage += m_spellInfo->Effects[EFFECT_1].CalcValue(m_caster);
|
||||
|
||||
if (Player* caster = m_caster->ToPlayer())
|
||||
{
|
||||
// Add Ammo and Weapon damage plus RAP * 0.1
|
||||
if (Item* item = caster->GetWeaponForAttack(RANGED_ATTACK))
|
||||
{
|
||||
ItemTemplate const* weaponTemplate = item->GetTemplate();
|
||||
float dmg_min = weaponTemplate->DamageMin;
|
||||
float dmg_max = weaponTemplate->DamageMax;
|
||||
if (dmg_max == 0.0f && dmg_min > dmg_max)
|
||||
damage += int32(dmg_min);
|
||||
else
|
||||
damage += irand(int32(dmg_min), int32(dmg_max));
|
||||
damage += int32(weaponTemplate->Delay * 0.001f);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_PALADIN:
|
||||
{
|
||||
// Hammer of the Righteous
|
||||
if (m_spellInfo->SpellFamilyFlags[1]&0x00040000)
|
||||
{
|
||||
// Add main hand dps * effect[2] amount
|
||||
float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
|
||||
int32 count = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, EFFECT_2);
|
||||
damage += count * int32(average * IN_MILLISECONDS) / m_caster->GetAttackTime(BASE_ATTACK);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
@@ -813,15 +694,6 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
|
||||
// special cases
|
||||
switch (triggered_spell_id)
|
||||
{
|
||||
// Mirror Image
|
||||
case 58832:
|
||||
{
|
||||
// Glyph of Mirror Image
|
||||
if (m_caster->HasAura(63093))
|
||||
m_caster->CastSpell(m_caster, 65047, true); // Mirror Image
|
||||
|
||||
break;
|
||||
}
|
||||
// Vanish (not exist)
|
||||
case 18461:
|
||||
{
|
||||
@@ -854,10 +726,6 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
|
||||
unitTarget->CastSpell(unitTarget, 7870, true);
|
||||
return;
|
||||
}
|
||||
// just skip
|
||||
case 23770: // Sayge's Dark Fortune of *
|
||||
// not exist, common cooldown can be implemented in scripts if need.
|
||||
return;
|
||||
// Brittle Armor - (need add max stack of 24575 Brittle Armor)
|
||||
case 29284:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user