diff options
author | Subv <s.v.h21@hotmail.com> | 2012-08-16 20:09:15 -0500 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-08-16 20:09:15 -0500 |
commit | 9f989dbcdace35e0169e0eade3476f13bc3e1a57 (patch) | |
tree | a7f00ff9415a0a0f0ff25456bfbebb91a8ef23bc | |
parent | 1acb3b4f1d38a4b246c7b41c1d0f3df71033394b (diff) |
Core/Spells: More cleanup of deprecated spells code
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 30 | ||||
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuras.cpp | 308 |
2 files changed, 7 insertions, 331 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5a4cba9d58b..3735801e8cb 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10469,12 +10469,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui if (victim->HealthBelowPct(50)) AddPctN(DoneTotalMod, (*i)->GetAmount()); break; - case 7798: // Glyph of Regrowth - { - if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x40, 0, 0)) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; - } case 8477: // Nourish Heal Boost { int32 stepPercent = (*i)->GetAmount(); @@ -10494,12 +10488,6 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui AddPctN(DoneTotalMod, modPercent); break; } - case 7871: // Glyph of Lesser Healing Wave - { - if (victim->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0, 0x00000400, 0, GetGUID())) - AddPctN(DoneTotalMod, (*i)->GetAmount()); - break; - } default: break; } @@ -10551,23 +10539,9 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui coeff /= 100.0f; } - // Earthliving - 0.45% of normal hot coeff - if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) - factorMod *= 0.45f; - DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); } - // Gift of the Naaru - if (spellProto->SpellFamilyFlags[2] & 0x80000000 && spellProto->SpellIconID == 329) - { - int32 apBonus = int32(std::max(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAttackPowerValue(RANGED_ATTACK))); - if (apBonus > DoneAdvertisedBenefit) - DoneTotal += int32(apBonus * 0.22f); // 22% of AP per tick - else - DoneTotal += int32(DoneAdvertisedBenefit * 0.377f); // 37.7% of BH per tick - } - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { switch (spellProto->Effects[i].ApplyAuraName) @@ -10665,10 +10639,6 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u coeff /= 100.0f; } - // Earthliving - 0.45% of normal hot coeff - if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x80000) - factorMod *= 0.45f; - TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod); } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 3409d135849..e8d1ddb8f03 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1154,20 +1154,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_MAGE: if (!caster) break; - if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001 && GetSpellInfo()->SpellFamilyFlags[2] & 0x00000008) - { - // Glyph of Fireball - if (caster->HasAura(56368)) - SetDuration(0); - } - else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00000020 && GetSpellInfo()->SpellVisual[0] == 13) - { - // Glyph of Frostbolt - if (caster->HasAura(56370)) - SetDuration(0); - } // Todo: This should be moved to similar function in spell::hit - else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x01000000) + if (GetSpellInfo()->SpellFamilyFlags[0] & 0x01000000) { // Polymorph Sound - Sheep && Penguin if (GetSpellInfo()->SpellIconID == 82 && GetSpellInfo()->SpellVisual[0] == 12978) @@ -1199,18 +1187,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b caster->CastSpell(caster, spellId, true); } break; - case 44544: // Fingers of Frost - { - // See if we already have the indicator aura. If not, create one. - if (Aura* aur = target->GetAura(74396)) - { - // Aura already there. Refresh duration and set original charges - aur->SetCharges(2); - aur->RefreshDuration(); - } - else - target->AddAura(74396, target); - } default: break; } @@ -1222,7 +1198,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (GetSpellInfo()->SpellFamilyFlags[0] & 0x02000000 && GetEffect(0)) { // Improved Devouring Plague - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 1)) + if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 0)) { uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT); damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT); @@ -1252,49 +1228,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (target->HasAura(58039)) // Glyph of Blurred Speed target->CastSpell(target, 61922, true); // Sprint (waterwalk) break; - case SPELLFAMILY_DEATHKNIGHT: - if (!caster) - break; - // Frost Fever and Blood Plague - if (GetSpellInfo()->SpellFamilyFlags[2] & 0x2) - { - // Can't proc on self - if (GetCasterGUID() == target->GetGUID()) - break; - - AuraEffect* aurEff = NULL; - // Ebon Plaguebringer / Crypt Fever - Unit::AuraEffectList const& TalentAuras = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for (Unit::AuraEffectList::const_iterator itr = TalentAuras.begin(); itr != TalentAuras.end(); ++itr) - { - if ((*itr)->GetMiscValue() == 7282) - { - aurEff = *itr; - // Ebon Plaguebringer - end search if found - if ((*itr)->GetSpellInfo()->SpellIconID == 1766) - break; - } - } - if (aurEff) - { - uint32 spellId = 0; - switch (aurEff->GetId()) - { - // Ebon Plague - case 51161: spellId = 51735; break; - case 51160: spellId = 51734; break; - case 51099: spellId = 51726; break; - // Crypt Fever - case 49632: spellId = 50510; break; - case 49631: spellId = 50509; break; - case 49032: spellId = 50508; break; - default: - sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura::HandleAuraSpecificMods: Unknown rank of Crypt Fever/Ebon Plague (%d) found", aurEff->GetId()); - } - caster->CastSpell(target, spellId, true, 0, GetEffect(0)); - } - } - break; } } // mods at aura remove @@ -1333,18 +1266,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b target->CastSpell(target, 32612, true, NULL, GetEffect(1)); target->CombatStop(); break; - case 74396: // Fingers of Frost - // Remove the IGNORE_AURASTATE aura - target->RemoveAurasDueToSpell(44544); - break; - case 44401: //Missile Barrage - case 48108: //Hot Streak - case 57761: //Fireball! - if (removeMode != AURA_REMOVE_BY_EXPIRE || aurApp->GetBase()->IsExpired()) - break; - if (target->HasAura(70752)) //Item - Mage T10 2P Bonus - target->CastSpell(target, 70753, true); - break; default: break; } @@ -1354,34 +1275,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[1] & 0x1) { // Shattered Barrier - if (AuraEffect * dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 2945, 0)) + if (AuraEffect * dummy = caster->GetDummyAuraEffect(SPELLFAMILY_MAGE, 3260, 0)) if (roll_chance_i(dummy->GetSpellInfo()->ProcChance)) caster->CastSpell(target, 55080, true, NULL, GetEffect(0)); } break; - case SPELLFAMILY_WARRIOR: - if (!caster) - break; - // Spell Reflection - if (GetSpellInfo()->SpellFamilyFlags[1] & 0x2) - { - if (removeMode != AURA_REMOVE_BY_DEFAULT) - { - // Improved Spell Reflection - if (caster->GetDummyAuraEffect(SPELLFAMILY_WARRIOR, 1935, 1)) - { - // aura remove - remove auras from all party members - std::list<Unit*> PartyMembers; - target->GetPartyMembers(PartyMembers); - for (std::list<Unit*>::iterator itr = PartyMembers.begin(); itr != PartyMembers.end(); ++itr) - { - if ((*itr)!= target) - (*itr)->RemoveAurasWithFamily(SPELLFAMILY_WARRIOR, 0, 0x2, 0, GetCasterGUID()); - } - } - } - } - break; case SPELLFAMILY_WARLOCK: if (!caster) break; @@ -1406,18 +1304,8 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_PRIEST: if (!caster) break; - // Shadow word: Pain // Vampiric Touch - if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && (GetSpellInfo()->SpellFamilyFlags[0] & 0x00008000 || GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)) - { - // Shadow Affinity - if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 178, 1)) - { - int32 basepoints0 = aurEff->GetAmount() * caster->GetCreateMana() / 100; - caster->CastCustomSpell(caster, 64103, &basepoints0, NULL, NULL, true, NULL, GetEffect(0)); - } - } // Power word: shield - else if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001) + if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001) { // Rapture if (Aura const* aura = caster->GetAuraOfRankedSpell(47535)) @@ -1433,68 +1321,12 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b // effect on caster if (AuraEffect const* aurEff = aura->GetEffect(0)) { - float multiplier = (float)aurEff->GetAmount(); - if (aurEff->GetId() == 47535) - multiplier -= 0.5f; - else if (aurEff->GetId() == 47537) - multiplier += 0.5f; - + float multiplier = float(aurEff->GetAmount()); int32 basepoints0 = int32(CalculatePctF(caster->GetMaxPower(POWER_MANA), multiplier)); caster->CastCustomSpell(caster, 47755, &basepoints0, NULL, NULL, true); } - // effect on aura target - if (AuraEffect const* aurEff = aura->GetEffect(1)) - { - if (!roll_chance_i(aurEff->GetAmount())) - break; - - int32 triggeredSpellId = 0; - switch (target->getPowerType()) - { - case POWER_MANA: - { - int32 basepoints0 = int32(CalculatePctN(target->GetMaxPower(POWER_MANA), 2)); - caster->CastCustomSpell(target, 63654, &basepoints0, NULL, NULL, true); - break; - } - case POWER_RAGE: triggeredSpellId = 63653; break; - case POWER_ENERGY: triggeredSpellId = 63655; break; - case POWER_RUNIC_POWER: triggeredSpellId = 63652; break; - default: - break; - } - if (triggeredSpellId) - caster->CastSpell(target, triggeredSpellId, true); - } } } - switch (GetId()) - { - case 47788: // Guardian Spirit - if (removeMode != AURA_REMOVE_BY_EXPIRE) - break; - if (caster->GetTypeId() != TYPEID_PLAYER) - break; - - Player* player = caster->ToPlayer(); - // Glyph of Guardian Spirit - if (AuraEffect* aurEff = player->GetAuraEffect(63231, 0)) - { - if (!player->HasSpellCooldown(47788)) - break; - - player->RemoveSpellCooldown(GetSpellInfo()->Id, true); - player->AddSpellCooldown(GetSpellInfo()->Id, 0, uint32(time(NULL) + aurEff->GetAmount())); - - WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4+4); - data << uint64(player->GetGUID()); - data << uint8(0x0); // flags (0x1, 0x2) - data << uint32(GetSpellInfo()->Id); - data << uint32(aurEff->GetAmount()*IN_MILLISECONDS); - player->SendDirectMessage(&data); - } - break; - } break; case SPELLFAMILY_ROGUE: // Remove Vanish on stealth remove @@ -1561,7 +1393,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b if (GetSpellInfo()->SpellFamilyFlags[0] & 0x00400000) { // Master of subtlety - if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(31221, 0)) + if (AuraEffect const* aurEff = target->GetAuraEffect(31223, 0)) { if (!apply) target->CastSpell(target, 31666, true); @@ -1571,14 +1403,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b target->CastCustomSpell(target, 31665, &basepoints0, NULL, NULL, true); } } - // Overkill - if (target->HasAura(58426)) - { - if (!apply) - target->CastSpell(target, 58428, true); - else - target->CastSpell(target, 58427, true); - } break; } break; @@ -1604,15 +1428,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b case SPELLFAMILY_PALADIN: switch (GetId()) { - case 19746: - // Improved concentration aura - linked aura - if (caster->HasAura(20254) || caster->HasAura(20255) || caster->HasAura(20256)) - { - if (apply) - target->CastSpell(target, 63510, true); - else - target->RemoveAura(63510); - } case 31821: // Aura Mastery Triggered Spell Handler // If apply Concentration Aura -> trigger -> apply Aura Mastery Immunity @@ -1630,7 +1445,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b else target->RemoveAurasDueToSpell(64364, GetCasterGUID()); break; - case 31842: // Divine Illumination + case 31842: // Divine Favor // Item - Paladin T10 Holy 2P Bonus if (target->HasAura(70755)) { @@ -1641,115 +1456,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b } break; } - if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA) - { - // Improved devotion aura - if (caster->HasAura(20140) || caster->HasAura(20138) || caster->HasAura(20139)) - { - if (apply) - caster->CastSpell(target, 63514, true); - else - target->RemoveAura(63514); - } - // 63531 - linked aura for both Sanctified Retribution and Swift Retribution talents - // Not allow for Retribution Aura (prevent stacking) - if ((GetSpellInfo()->SpellIconID != 555) && (caster->HasAura(53648) || caster->HasAura(53484) || caster->HasAura(53379) || caster->HasAura(31869))) - { - if (apply) - caster->CastSpell(target, 63531, true); - else - target->RemoveAura(63531); - } - } - break; - case SPELLFAMILY_DEATHKNIGHT: - if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_PRESENCE) - { - AuraEffect* bloodPresenceAura=0; // healing by damage done - AuraEffect* frostPresenceAura=0; // increased health - AuraEffect* unholyPresenceAura=0; // increased movement speed, faster rune recovery - - // Improved Presences - Unit::AuraEffectList const& vDummyAuras = target->GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (Unit::AuraEffectList::const_iterator itr = vDummyAuras.begin(); itr != vDummyAuras.end(); ++itr) - { - switch ((*itr)->GetId()) - { - // Improved Blood Presence - case 50365: - case 50371: - { - bloodPresenceAura = (*itr); - break; - } - // Improved Frost Presence - case 50384: - case 50385: - { - frostPresenceAura = (*itr); - break; - } - // Improved Unholy Presence - case 50391: - case 50392: - { - unholyPresenceAura = (*itr); - break; - } - } - } - - uint32 presence = GetId(); - if (apply) - { - // Blood Presence bonus - if (presence == 48266) - target->CastSpell(target, 63611, true); - else if (bloodPresenceAura) - { - int32 basePoints1 = bloodPresenceAura->GetAmount(); - target->CastCustomSpell(target, 63611, NULL, &basePoints1, NULL, true, 0, bloodPresenceAura); - } - // Frost Presence bonus - if (presence == 48263) - target->CastSpell(target, 61261, true); - else if (frostPresenceAura) - { - int32 basePoints0 = frostPresenceAura->GetAmount(); - target->CastCustomSpell(target, 61261, &basePoints0, NULL, NULL, true, 0, frostPresenceAura); - } - // Unholy Presence bonus - if (presence == 48265) - { - if (unholyPresenceAura) - { - // Not listed as any effect, only base points set - int32 basePoints0 = unholyPresenceAura->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - target->CastCustomSpell(target, 63622, &basePoints0, &basePoints0, &basePoints0, true, 0, unholyPresenceAura); - } - target->CastSpell(target, 49772, true); - } - else if (unholyPresenceAura) - { - int32 basePoints0 = unholyPresenceAura->GetAmount(); - target->CastCustomSpell(target, 49772, &basePoints0, NULL, NULL, true, 0, unholyPresenceAura); - } - } - else - { - // Remove passive auras - if (presence == 48266 || bloodPresenceAura) - target->RemoveAurasDueToSpell(63611); - if (presence == 48263 || frostPresenceAura) - target->RemoveAurasDueToSpell(61261); - if (presence == 48265 || unholyPresenceAura) - { - if (presence == 48265 && unholyPresenceAura) - target->RemoveAurasDueToSpell(63622); - target->RemoveAurasDueToSpell(49772); - } - } - } break; case SPELLFAMILY_WARLOCK: // Drain Soul - If the target is at or below 25% health, Drain Soul causes four times the normal damage |