diff options
Diffstat (limited to 'src/server/scripts')
73 files changed, 296 insertions, 714 deletions
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 2cf97403595..e571f30b74e 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -204,7 +204,7 @@ public: // learn highest rank of talent and learn all non-talent spell ranks (recursive by tree) player->LearnSpellHighestRank(talentInfo->SpellID); - player->AddTalent(talentInfo->SpellID, player->GetActiveTalentGroup()); + player->AddTalent(talentInfo->SpellID, player->GetActiveTalentGroup(), true); } handler->SendSysMessage(LANG_COMMAND_LEARN_CLASS_TALENTS); diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 39644e5c08f..c806b99f2db 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -808,9 +808,11 @@ public: } bool known = target && target->HasSpell(id); - bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL); - SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell); + SpellEffectInfo const* effect = spellInfo->GetEffect(EFFECT_0); + bool learn = effect ? (effect->Effect == SPELL_EFFECT_LEARN_SPELL) : false; + + SpellInfo const* learnSpellInfo = effect ? sSpellMgr->GetSpellInfo(effect->TriggerSpell) : NULL; bool talent = (GetTalentBySpellID(id) != nullptr); bool passive = spellInfo->IsPassive(); @@ -878,9 +880,11 @@ public: } bool known = target && target->HasSpell(id); - bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL); - SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[0].TriggerSpell); + SpellEffectInfo const* effect = spellInfo->GetEffect(EFFECT_0); + bool learn = effect? (effect->Effect == SPELL_EFFECT_LEARN_SPELL) : false; + + SpellInfo const* learnSpellInfo = effect ? sSpellMgr->GetSpellInfo(effect->TriggerSpell) : NULL; bool talent = (GetTalentBySpellID(id) != nullptr); bool passive = spellInfo->IsPassive(); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index f1b6e7f7289..f8c3f43d144 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2248,7 +2248,7 @@ public: SpellSchoolMask schoolmask = SpellSchoolMask(1 << school); - if (Unit::IsDamageReducedByArmor(schoolmask)) + if (handler->GetSession()->GetPlayer()->IsDamageReducedByArmor(schoolmask)) damage = handler->GetSession()->GetPlayer()->CalcArmorReducedDamage(target, damage, NULL, BASE_ATTACK); char* spellStr = strtok((char*)NULL, " "); diff --git a/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp b/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp index 9c203ac2395..5805509cc9b 100644 --- a/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp +++ b/src/server/scripts/EasternKingdoms/BaradinHold/boss_occuthar.cpp @@ -267,7 +267,7 @@ class spell_occuthar_eyes_of_occuthar : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) override { - if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue())) + if (!sSpellMgr->GetSpellInfo(spellInfo->GetEffect(EFFECT_0)->CalcValue())) return false; return true; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 4cb0b61365d..9c4865a8d84 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -485,23 +485,23 @@ public: void SpellHit(Unit* /*pAttacker*/, const SpellInfo* Spell) override { //We only care about interrupt effects and only if they are durring a spell currently being cast - if ((Spell->Effects[0].Effect != SPELL_EFFECT_INTERRUPT_CAST && - Spell->Effects[1].Effect != SPELL_EFFECT_INTERRUPT_CAST && - Spell->Effects[2].Effect != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCast(false)) - return; - - //Interrupt effect - me->InterruptNonMeleeSpells(false); + for (SpellEffectInfo const* effect : Spell->GetEffectsForDifficulty(me->GetMap()->GetDifficulty())) + if (effect && effect->Effect == SPELL_EFFECT_INTERRUPT_CAST && me->IsNonMeleeSpellCast(false)) + { + //Interrupt effect + me->InterruptNonMeleeSpells(false); - //Normally we would set the cooldown equal to the spell duration - //but we do not have access to the DurationStore + //Normally we would set the cooldown equal to the spell duration + //but we do not have access to the DurationStore - switch (CurrentNormalSpell) - { - case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break; - case SPELL_FIREBALL: FireCooldown = 5000; break; - case SPELL_FROSTBOLT: FrostCooldown = 5000; break; - } + switch (CurrentNormalSpell) + { + case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break; + case SPELL_FIREBALL: FireCooldown = 5000; break; + case SPELL_FROSTBOLT: FrostCooldown = 5000; break; + } + return; + } } }; }; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp index 6cd14598a58..6758808c5d9 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -164,8 +164,10 @@ public: { if (Player* player = i->GetSource()) { - if (spell && spell->Effects[0].MiscValue) - player->KilledMonsterCredit(spell->Effects[0].MiscValue); + if (spell) + if (SpellEffectInfo const* effect = spell->GetEffect(EFFECT_0)) + if (effect->MiscValue) + player->KilledMonsterCredit(effect->MiscValue); } } } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index 69c188a61dc..e5a42096a04 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -314,7 +314,7 @@ class spell_shadow_portal_rooms : public SpellScriptLoader int8 phase_to_set = 0; int32 gate_to_close = 0; - switch (GetSpellInfo()->Effects[effIndex].MiscValue) + switch (GetSpellInfo()->GetEffect(effIndex)->MiscValue) { case SPELL_EVENT_HALLOFSECRETS: pos_to_summon = 0; // Not yet spawned diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 99b710afb1e..cf0228f5192 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -412,9 +412,14 @@ public: void SpellHit(Unit* /*caster*/, const SpellInfo* Spell) override { - for (uint8 i = 0; i < 3; ++i) - if (Spell->Effects[i].Effect == 38) + for (SpellEffectInfo const* effect : Spell->GetEffectsForDifficulty(DIFFICULTY_NONE)) + { + if (effect && effect->Effect == 38) + { me->DisappearAndDie(); + return; + } + } } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp index 84a267543c5..15fbef8a08b 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_anraphet.cpp @@ -537,7 +537,7 @@ public: /// TODO: Remove this once we find a general rule for WorldObject::MovePosition (this spell shouldn't take the Z change into consideration) Unit* caster = GetCaster(); float angle = float(rand_norm()) * static_cast<float>(2 * M_PI); - uint32 dist = caster->GetObjectSize() + GetSpellInfo()->Effects[effIndex].CalcRadius(GetCaster()) * (float)rand_norm(); + uint32 dist = caster->GetObjectSize() + GetSpellInfo()->GetEffect(effIndex)->CalcRadius(GetCaster()) * (float)rand_norm(); float x = caster->GetPositionX() + dist * std::cos(angle); float y = caster->GetPositionY() + dist * std::sin(angle); diff --git a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp index 47a40dd56ef..e5f24d37a30 100644 --- a/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp +++ b/src/server/scripts/Kalimdor/HallsOfOrigination/boss_temple_guardian_anhuur.cpp @@ -378,7 +378,7 @@ public: { CustomSpellValues values; values.AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount()); - caster->CastCustomSpell(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, values, GetTarget()); + caster->CastCustomSpell(GetSpellInfo()->GetEffect(caster, EFFECT_0)->TriggerSpell, values, GetTarget()); } } diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index 189cc842d9b..919f8b43ce3 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -106,7 +106,7 @@ public: //THIS GOB IS A TRAP - What shall i do? =( //Cast it spell? Copyed Heigan method floorEruption->SendCustomAnim(floorEruption->GetGoAnimProgress()); - floorEruption->CastSpell(NULL, Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId + floorEruption->CastSpell(NULL, Difficulty(instance->GetSpawnMode()) == DIFFICULTY_10_N ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId //Get all immediatly nearby floors std::list<GameObject*> nearFloorList; diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp index e0b03d54f69..533d78a68f5 100644 --- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -518,7 +518,7 @@ class spell_ooze_zap : public SpellScriptLoader SpellCastResult CheckRequirement() { - if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue())) + if (!GetCaster()->HasAura(GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue())) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct if (!GetExplTargetUnit()) @@ -603,7 +603,7 @@ class spell_energize_aoe : public SpellScriptLoader { for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end();) { - if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE) + if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue()) == QUEST_STATUS_INCOMPLETE) ++itr; else targets.erase(itr++); diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index 592d69c5c76..5b88cfb332b 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -142,7 +142,7 @@ public: // clone player->CastSpell(summon, SPELL_CLONE_PLAYER, true); // phase the summon - summon->SetInPhase(spellInfo->Effects[EFFECT_0].MiscValueB, true, true); + summon->SetInPhase(spellInfo->GetEffect(EFFECT_0)->MiscValueB, true, true); } } ++insanityHandled; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index c826b8fc9ef..f1d029e53e2 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -151,7 +151,7 @@ class boss_baltharus_the_warborn : public CreatureScript void DamageTaken(Unit* /*attacker*/, uint32& damage) override { - if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_10_N) { if (me->HealthBelowPctDamaged(50, damage) && _cloneCount == 1) DoAction(ACTION_CLONE); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index ee77671d83e..16cbcee562e 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -1499,8 +1499,8 @@ class spell_halion_damage_aoe_summon : public SpellScriptLoader { PreventHitDefaultEffect(effIndex); Unit* caster = GetCaster(); - uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue); - SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB)); + uint32 entry = uint32(GetSpellInfo()->GetEffect(effIndex)->MiscValue); + SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->GetEffect(effIndex)->MiscValueB)); uint32 duration = uint32(GetSpellInfo()->GetDuration()); Position pos = caster->GetPosition(); @@ -1607,8 +1607,8 @@ class spell_halion_clear_debuffs : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { - if (GetHitUnit()->HasAura(GetSpellInfo()->Effects[effIndex].CalcValue())) - GetHitUnit()->RemoveAurasDueToSpell(GetSpellInfo()->Effects[effIndex].CalcValue()); + if (GetHitUnit()->HasAura(GetSpellInfo()->GetEffect(effIndex)->CalcValue())) + GetHitUnit()->RemoveAurasDueToSpell(GetSpellInfo()->GetEffect(effIndex)->CalcValue()); } void Register() override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 69dc25892c1..aa80295d83c 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -837,10 +837,9 @@ class spell_impale : public SpellScriptLoader void HandleDamageCalc(SpellEffIndex /*effIndex*/) { Unit* target = GetHitUnit(); - uint32 permafrost = sSpellMgr->GetSpellIdForDifficulty(SPELL_PERMAFROST, target); // make sure Impale doesnt do damage if we are standing on permafrost - if (target && target->HasAura(permafrost)) + if (target && target->HasAura(SPELL_PERMAFROST)) SetHitDamage(0); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 2b541e4b972..b79e093a3e0 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -384,7 +384,7 @@ class boss_toc_champion_controller : public CreatureScript vOtherEntries.push_back(playerTeam == ALLIANCE ? NPC_HORDE_WARRIOR : NPC_ALLIANCE_WARRIOR); uint8 healersSubtracted = 2; - if (_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_NORMAL || _instance->instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_HEROIC) + if (_instance->instance->GetSpawnMode() == DIFFICULTY_25_N || _instance->instance->GetSpawnMode() == DIFFICULTY_25_HC) healersSubtracted = 1; for (uint8 i = 0; i < healersSubtracted; ++i) { @@ -421,7 +421,7 @@ class boss_toc_champion_controller : public CreatureScript vHealersEntries.erase(vHealersEntries.begin() + pos); } - if (_instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_NORMAL || _instance->instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_HEROIC) + if (_instance->instance->GetSpawnMode() == DIFFICULTY_10_N || _instance->instance->GetSpawnMode() == DIFFICULTY_10_HC) for (uint8 i = 0; i < 4; ++i) vOtherEntries.erase(vOtherEntries.begin() + urand(0, vOtherEntries.size() - 1)); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 7e8653c4a55..25dc59acc34 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -494,7 +494,7 @@ class spell_mistress_kiss : public SpellScriptLoader bool Load() override { if (GetCaster()) - if (sSpellMgr->GetSpellIdForDifficulty(SPELL_MISTRESS_KISS_DAMAGE_SILENCE, GetCaster())) + if (sSpellMgr->GetSpellInfo(SPELL_MISTRESS_KISS_DAMAGE_SILENCE)) return true; return false; } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index dec2f44745d..07eec388ca2 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -706,11 +706,11 @@ class spell_powering_up : public SpellScriptLoader bool Load() override { - spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_SURGE_OF_SPEED, GetCaster()); + spellId = SPELL_SURGE_OF_SPEED; if (!sSpellMgr->GetSpellInfo(spellId)) return false; - poweringUp = sSpellMgr->GetSpellIdForDifficulty(SPELL_POWERING_UP, GetCaster()); + poweringUp = SPELL_POWERING_UP; if (!sSpellMgr->GetSpellInfo(poweringUp)) return false; @@ -769,7 +769,7 @@ class spell_valkyr_essences : public SpellScriptLoader bool Load() override { - spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_SURGE_OF_SPEED, GetCaster()); + spellId = SPELL_SURGE_OF_SPEED; if (!sSpellMgr->GetSpellInfo(spellId)) return false; return true; @@ -781,57 +781,54 @@ class spell_valkyr_essences : public SpellScriptLoader { if (dmgInfo.GetSpellInfo()) { - if (uint32 poweringUp = sSpellMgr->GetSpellIdForDifficulty(SPELL_POWERING_UP, owner)) - { - if (urand(0, 99) < 5) - GetTarget()->CastSpell(GetTarget(), spellId, true); + if (urand(0, 99) < 5) + GetTarget()->CastSpell(GetTarget(), spellId, true); - // Twin Vortex part - uint32 lightVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_LIGHT_VORTEX_DAMAGE, owner); - uint32 darkVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_DARK_VORTEX_DAMAGE, owner); - int32 stacksCount = dmgInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue() / 1000 - 1; + // Twin Vortex part + uint32 lightVortex = SPELL_LIGHT_VORTEX_DAMAGE; + uint32 darkVortex = SPELL_DARK_VORTEX_DAMAGE; + int32 stacksCount = dmgInfo.GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue() / 1000 - 1; - if (lightVortex && darkVortex && stacksCount) + if (lightVortex && darkVortex && stacksCount) + { + if (dmgInfo.GetSpellInfo()->Id == darkVortex || dmgInfo.GetSpellInfo()->Id == lightVortex) { - if (dmgInfo.GetSpellInfo()->Id == darkVortex || dmgInfo.GetSpellInfo()->Id == lightVortex) + Aura* pAura = owner->GetAura(SPELL_POWERING_UP); + if (pAura) + { + pAura->ModStackAmount(stacksCount); + owner->CastSpell(owner, SPELL_POWERING_UP, true); + } + else { - Aura* pAura = owner->GetAura(poweringUp); - if (pAura) - { - pAura->ModStackAmount(stacksCount); - owner->CastSpell(owner, poweringUp, true); - } - else - { - owner->CastSpell(owner, poweringUp, true); - if (Aura* pTemp = owner->GetAura(poweringUp)) - pTemp->ModStackAmount(stacksCount); - } + owner->CastSpell(owner, SPELL_POWERING_UP, true); + if (Aura* pTemp = owner->GetAura(SPELL_POWERING_UP)) + pTemp->ModStackAmount(stacksCount); } } + } - // Picking floating balls - uint32 unleashedDark = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNLEASHED_DARK, owner); - uint32 unleashedLight = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNLEASHED_LIGHT, owner); + // Picking floating balls + uint32 unleashedDark = SPELL_UNLEASHED_DARK; + uint32 unleashedLight = SPELL_UNLEASHED_LIGHT; - if (unleashedDark && unleashedLight) + if (unleashedDark && unleashedLight) + { + if (dmgInfo.GetSpellInfo()->Id == unleashedDark || dmgInfo.GetSpellInfo()->Id == unleashedLight) { - if (dmgInfo.GetSpellInfo()->Id == unleashedDark || dmgInfo.GetSpellInfo()->Id == unleashedLight) + // need to do the things in this order, else players might have 100 charges of Powering Up without anything happening + Aura* pAura = owner->GetAura(SPELL_POWERING_UP); + if (pAura) + { + // 2 lines together add the correct amount of buff stacks + pAura->ModStackAmount(stacksCount); + owner->CastSpell(owner, SPELL_POWERING_UP, true); + } + else { - // need to do the things in this order, else players might have 100 charges of Powering Up without anything happening - Aura* pAura = owner->GetAura(poweringUp); - if (pAura) - { - // 2 lines together add the correct amount of buff stacks - pAura->ModStackAmount(stacksCount); - owner->CastSpell(owner, poweringUp, true); - } - else - { - owner->CastSpell(owner, poweringUp, true); - if (Aura* pTemp = owner->GetAura(poweringUp)) - pTemp->ModStackAmount(stacksCount); - } + owner->CastSpell(owner, SPELL_POWERING_UP, true); + if (Aura* pTemp = owner->GetAura(SPELL_POWERING_UP)) + pTemp->ModStackAmount(stacksCount); } } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index cb7e58cfe16..91da9ebd9be 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -274,7 +274,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript { EventStage = 6000; uint32 tributeChest = 0; - if (instance->GetSpawnMode() == RAID_DIFFICULTY_10MAN_HEROIC) + if (instance->GetSpawnMode() == DIFFICULTY_10_HC) { if (TrialCounter >= 50) tributeChest = GO_TRIBUTE_CHEST_10H_99; @@ -291,7 +291,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript } } } - else if (instance->GetSpawnMode() == RAID_DIFFICULTY_25MAN_HEROIC) + else if (instance->GetSpawnMode() == DIFFICULTY_25_HC) { if (TrialCounter >= 50) tributeChest = GO_TRIBUTE_CHEST_25H_99; diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index b91ca893955..f24ca7dd583 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -309,7 +309,7 @@ class spell_trollgore_invader_taunt : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) override { - if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue())) + if (!sSpellMgr->GetSpellInfo(spellInfo->GetEffect(EFFECT_0)->CalcValue())) return false; return true; } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index a014be4369e..ebad98de91a 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -89,7 +89,7 @@ class boss_falric : public CreatureScript || (_hopelessnessCount < 3 && me->HealthBelowPctDamaged(10, damage))) { if (_hopelessnessCount) - me->RemoveOwnedAura(sSpellMgr->GetSpellIdForDifficulty(HopelessnessHelper[_hopelessnessCount - 1], me)); + me->RemoveOwnedAura(HopelessnessHelper[_hopelessnessCount - 1]); DoCast(me, HopelessnessHelper[_hopelessnessCount]); ++_hopelessnessCount; } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index eeb05f44a71..c99ebddae37 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -2390,7 +2390,7 @@ class spell_hor_evasion : public SpellScriptLoader return; float angle = pos.GetAngle(&home); - float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); + float dist = GetSpellInfo()->GetEffect(EFFECT_0)->CalcRadius(GetCaster()); target->MovePosition(pos, dist, angle); dest.Relocate(pos); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 6053ff295a9..d289d494d62 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -553,8 +553,7 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader if (GetCaster()->GetTypeId() != TYPEID_PLAYER) return; - uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(SPELL_FRENZIED_BLOODTHIRST, GetCaster()); - GetCaster()->RemoveAura(spellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_ENEMY_SPELL); + GetCaster()->RemoveAura(SPELL_FRENZIED_BLOODTHIRST, ObjectGuid::Empty, 0, AURA_REMOVE_BY_ENEMY_SPELL); GetCaster()->CastSpell(GetCaster(), SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR, TRIGGERED_FULL_MASK); // Shadowmourne questline @@ -807,7 +806,7 @@ class spell_blood_queen_pact_of_the_darkfallen_dmg : public SpellScriptLoader void PeriodicTick(AuraEffect const* aurEff) { SpellInfo const* damageSpell = sSpellMgr->EnsureSpellInfo(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE); - int32 damage = damageSpell->Effects[EFFECT_0].CalcValue(); + int32 damage = damageSpell->GetEffect(EFFECT_0)->CalcValue(); float multiplier = 0.3375f + 0.1f * uint32(aurEff->GetTickNumber()/10); // do not convert to 0.01f - we need tick number/10 as INT (damage increases every 10 ticks) damage = int32(damage * multiplier); GetTarget()->CastCustomSpell(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget(), true); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index b1f6a4a5e83..008a89030a7 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -377,11 +377,7 @@ class spell_festergut_pungent_blight : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { - // Get Inhaled Blight id for our difficulty - uint32 blightId = sSpellMgr->GetSpellIdForDifficulty(uint32(GetEffectValue()), GetCaster()); - - // ...and remove it - GetCaster()->RemoveAurasDueToSpell(blightId); + GetCaster()->RemoveAurasDueToSpell(uint32(GetEffectValue())); GetCaster()->ToCreature()->AI()->Talk(EMOTE_PUNGENT_BLIGHT); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 416c27b7353..080880608d6 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -1847,7 +1847,7 @@ class spell_igb_rocket_pack : public SpellScriptLoader void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { SpellInfo const* damageInfo = sSpellMgr->EnsureSpellInfo(SPELL_ROCKET_PACK_DAMAGE); - GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetPeriod()), NULL, TRIGGERED_FULL_MASK); + GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->GetEffect(EFFECT_0)->CalcValue() + aurEff->GetTickNumber() * aurEff->GetPeriod()), NULL, TRIGGERED_FULL_MASK); GetTarget()->CastSpell(NULL, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK); } @@ -1977,7 +1977,7 @@ class spell_igb_periodic_trigger_with_power_cost : public SpellScriptLoader void HandlePeriodicTick(AuraEffect const* /*aurEff*/) { PreventDefaultAction(); - GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)); + GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->GetEffect(EFFECT_0)->TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 3e78865c924..834b0aeb5e1 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -288,7 +288,7 @@ class boss_lady_deathwhisper : public CreatureScript events.ScheduleEvent(EVENT_P1_SUMMON_WAVE, 5000, 0, PHASE_ONE); events.ScheduleEvent(EVENT_P1_SHADOW_BOLT, urand(5500, 6000), 0, PHASE_ONE); events.ScheduleEvent(EVENT_P1_EMPOWER_CULTIST, urand(20000, 30000), 0, PHASE_ONE); - if (GetDifficulty() != RAID_DIFFICULTY_10MAN_NORMAL) + if (GetDifficulty() != DIFFICULTY_10_N) events.ScheduleEvent(EVENT_DOMINATE_MIND_H, 27000); Talk(SAY_AGGRO); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 2e360e19b75..3a66d3e1363 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -576,7 +576,7 @@ class spell_marrowgar_coldflame_damage : public SpellScriptLoader if (target->HasAura(SPELL_IMPALED)) return false; - if (target->GetExactDist2d(GetOwner()) > GetSpellInfo()->Effects[EFFECT_0].CalcRadius()) + if (target->GetExactDist2d(GetOwner()) > GetSpellInfo()->GetEffect(target, EFFECT_0)->CalcRadius()) return false; if (Aura* aur = target->GetAura(GetId())) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 8f5ca0b4322..d0bf573ba19 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -395,14 +395,14 @@ class boss_professor_putricide : public CreatureScript { SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_CREATE_CONCOCTION); DoCast(me, SPELL_CREATE_CONCOCTION); - events.ScheduleEvent(EVENT_PHASE_TRANSITION, sSpellMgr->GetSpellForDifficultyFromSpell(spell, me)->CalcCastTime() + 100); + events.ScheduleEvent(EVENT_PHASE_TRANSITION, spell->CalcCastTime() + 100); break; } case PHASE_COMBAT_3: { SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_GUZZLE_POTIONS); DoCast(me, SPELL_GUZZLE_POTIONS); - events.ScheduleEvent(EVENT_PHASE_TRANSITION, sSpellMgr->GetSpellForDifficultyFromSpell(spell, me)->CalcCastTime() + 100); + events.ScheduleEvent(EVENT_PHASE_TRANSITION, spell->CalcCastTime() + 100); break; } default: @@ -725,7 +725,7 @@ class npc_putricide_oozeAI : public ScriptedAI void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override { - if (!_newTargetSelectTimer && spell->Id == sSpellMgr->GetSpellIdForDifficulty(_hitTargetSpellId, me)) + if (!_newTargetSelectTimer && spell->Id == _hitTargetSpellId) _newTargetSelectTimer = 1000; } @@ -1031,7 +1031,7 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader break; } - GetCaster()->CastSpell(target, uint32(GetSpellInfo()->Effects[stage].CalcValue()), true, NULL, NULL, GetCaster()->GetGUID()); + GetCaster()->CastSpell(target, uint32(GetSpellInfo()->GetEffect(stage)->CalcValue()), true, NULL, NULL, GetCaster()->GetGUID()); } void Register() override @@ -1057,11 +1057,10 @@ class spell_putricide_ooze_eruption_searcher : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - uint32 adhesiveId = sSpellMgr->GetSpellIdForDifficulty(SPELL_VOLATILE_OOZE_ADHESIVE, GetCaster()); - if (GetHitUnit()->HasAura(adhesiveId)) + if (GetHitUnit()->HasAura(SPELL_VOLATILE_OOZE_ADHESIVE)) { GetCaster()->CastSpell(GetHitUnit(), SPELL_OOZE_ERUPTION, true); - GetHitUnit()->RemoveAurasDueToSpell(adhesiveId, GetCaster()->GetGUID(), 0, AURA_REMOVE_BY_ENEMY_SPELL); + GetHitUnit()->RemoveAurasDueToSpell(SPELL_VOLATILE_OOZE_ADHESIVE, GetCaster()->GetGUID(), 0, AURA_REMOVE_BY_ENEMY_SPELL); } } @@ -1089,12 +1088,12 @@ class spell_putricide_choking_gas_bomb : public SpellScriptLoader void HandleScript(SpellEffIndex /*effIndex*/) { uint32 skipIndex = urand(0, 2); - for (uint32 i = 0; i < 3; ++i) + for (SpellEffectInfo const* effect : GetSpellInfo()->GetEffectsForDifficulty(GetCaster()->GetMap()->GetDifficulty())) { - if (i == skipIndex) + if (!effect || effect->EffectIndex == skipIndex) continue; - uint32 spellId = uint32(GetSpellInfo()->Effects[i].CalcValue()); + uint32 spellId = uint32(effect->CalcValue()); GetCaster()->CastSpell(GetCaster(), spellId, true, NULL, NULL, GetCaster()->GetGUID()); } } @@ -1141,7 +1140,7 @@ class spell_putricide_unbound_plague : public SpellScriptLoader } - targets.remove_if(Trinity::UnitAuraCheck(true, sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster()))); + targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_UNBOUND_PLAGUE)); Trinity::Containers::RandomResizeList(targets, 1); } @@ -1154,15 +1153,13 @@ class spell_putricide_unbound_plague : public SpellScriptLoader if (!instance) return; - uint32 plagueId = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster()); - - if (!GetHitUnit()->HasAura(plagueId)) + if (!GetHitUnit()->HasAura(SPELL_UNBOUND_PLAGUE)) { if (Creature* professor = ObjectAccessor::GetCreature(*GetCaster(), instance->GetGuidData(DATA_PROFESSOR_PUTRICIDE))) { - if (Aura* oldPlague = GetCaster()->GetAura(plagueId, professor->GetGUID())) + if (Aura* oldPlague = GetCaster()->GetAura(SPELL_UNBOUND_PLAGUE, professor->GetGUID())) { - if (Aura* newPlague = professor->AddAura(plagueId, GetHitUnit())) + if (Aura* newPlague = professor->AddAura(SPELL_UNBOUND_PLAGUE, GetHitUnit())) { newPlague->SetMaxDuration(oldPlague->GetMaxDuration()); newPlague->SetDuration(oldPlague->GetDuration()); @@ -1258,11 +1255,10 @@ class spell_putricide_mutated_plague : public SpellScriptLoader if (!caster) return; - uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; + uint32 triggerSpell = GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->TriggerSpell; SpellInfo const* spell = sSpellMgr->GetSpellInfo(triggerSpell); - spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, caster); - int32 damage = spell->Effects[EFFECT_0].CalcValue(caster); + int32 damage = spell->GetEffect(EFFECT_0)->CalcValue(caster); float multiplier = 2.0f; if (GetTarget()->GetMap()->GetSpawnMode() & 1) multiplier = 3.0f; @@ -1275,13 +1271,13 @@ class spell_putricide_mutated_plague : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - uint32 healSpell = uint32(GetSpellInfo()->Effects[EFFECT_0].CalcValue()); + uint32 healSpell = uint32(GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue()); SpellInfo const* healSpellInfo = sSpellMgr->GetSpellInfo(healSpell); if (!healSpellInfo) return; - int32 heal = healSpellInfo->Effects[0].CalcValue() * GetStackAmount(); + int32 heal = healSpellInfo->GetEffect(EFFECT_0)->CalcValue() * GetStackAmount(); GetTarget()->CastCustomSpell(healSpell, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, NULL, NULL, GetCasterGUID()); } @@ -1445,8 +1441,8 @@ class spell_putricide_mutated_transformation : public SpellScriptLoader return; } - uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue); - SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->Effects[effIndex].MiscValueB)); + uint32 entry = uint32(GetSpellInfo()->GetEffect(effIndex)->MiscValue); + SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->GetEffect(effIndex)->MiscValueB)); uint32 duration = uint32(GetSpellInfo()->GetDuration()); Position pos = caster->GetPosition(); @@ -1543,8 +1539,7 @@ class spell_putricide_clear_aura_effect_value : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - uint32 auraId = sSpellMgr->GetSpellIdForDifficulty(uint32(GetEffectValue()), GetCaster()); - GetHitUnit()->RemoveAurasDueToSpell(auraId); + GetHitUnit()->RemoveAurasDueToSpell(GetEffectValue()); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index d5c07fb6942..ee948789bc4 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -745,7 +745,7 @@ class spell_rotface_unstable_ooze_explosion : public SpellScriptLoader if (!GetExplTargetDest()) return; - uint32 triggered_spell_id = GetSpellInfo()->Effects[effIndex].TriggerSpell; + uint32 triggered_spell_id = GetSpellInfo()->GetEffect(effIndex)->TriggerSpell; float x, y, z; GetExplTargetDest()->GetPosition(x, y, z); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 8e659a746ed..ab19ffe7fed 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -409,10 +409,9 @@ class boss_sindragosa : public CreatureScript void SpellHitTarget(Unit* target, SpellInfo const* spell) override { - if (uint32 spellId = sSpellMgr->GetSpellIdForDifficulty(70127, me)) - if (spellId == spell->Id) - if (Aura const* mysticBuffet = target->GetAura(spell->Id)) - _mysticBuffetStack = std::max<uint8>(_mysticBuffetStack, mysticBuffet->GetStackAmount()); + if (spell->Id == 70127) + if (Aura const* mysticBuffet = target->GetAura(spell->Id)) + _mysticBuffetStack = std::max<uint8>(_mysticBuffetStack, mysticBuffet->GetStackAmount()); } @@ -1546,7 +1545,7 @@ class spell_frostwarden_handler_focus_fire : public SpellScriptLoader PreventDefaultAction(); if (Unit* caster = GetCaster()) { - caster->AddThreat(GetTarget(), -float(GetSpellInfo()->Effects[EFFECT_1].CalcValue())); + caster->AddThreat(GetTarget(), -float(GetSpellInfo()->GetEffect(caster, EFFECT_1)->CalcValue())); caster->GetAI()->SetData(DATA_WHELP_MARKER, 0); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 03c26ba2e09..caba9ff5262 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -2437,7 +2437,7 @@ class spell_the_lich_king_summon_into_air : public SpellScriptLoader dest->RelocateOffset(offset); GetHitDest()->RelocateOffset(offset); // spirit bombs get higher - if (GetSpellInfo()->Effects[effIndex].MiscValue == NPC_SPIRIT_BOMB) + if (GetSpellInfo()->GetEffect(effIndex)->MiscValue == NPC_SPIRIT_BOMB) { dest->RelocateOffset(offset); GetHitDest()->RelocateOffset(offset); @@ -2641,7 +2641,7 @@ class spell_the_lich_king_vile_spirits : public SpellScriptLoader void OnPeriodic(AuraEffect const* aurEff) { if (_is25Man || ((aurEff->GetTickNumber() - 1) % 5)) - GetTarget()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, NULL, aurEff, GetCasterGUID()); + GetTarget()->CastSpell((Unit*)NULL, aurEff->GetSpellEffectInfo()->TriggerSpell, true, NULL, aurEff, GetCasterGUID()); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 49e24f54b02..eebf5a2c2ea 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1227,7 +1227,7 @@ class spell_dreamwalker_summoner : public SpellScriptLoader if (!GetHitUnit()) return; - GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true, NULL, NULL, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)); + GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true, NULL, NULL, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)); } void Register() override @@ -1306,7 +1306,7 @@ class spell_dreamwalker_summon_suppresser_effect : public SpellScriptLoader if (!GetHitUnit()) return; - GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true, NULL, NULL, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)); + GetHitUnit()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true, NULL, NULL, GetCaster()->GetInstanceScript()->GetGuidData(DATA_VALITHRIA_LICH_KING)); } void Register() override @@ -1442,7 +1442,7 @@ class spell_dreamwalker_twisted_nightmares : public SpellScriptLoader // return; if (InstanceScript* instance = GetHitUnit()->GetInstanceScript()) - GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, true, NULL, NULL, instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER)); + GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true, NULL, NULL, instance->GetGuidData(DATA_VALITHRIA_DREAMWALKER)); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index abe178a874d..ab7606f5e6f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -1799,7 +1799,7 @@ class spell_icc_sprit_alarm : public SpellScriptLoader { PreventHitDefaultEffect(effIndex); uint32 trapId = 0; - switch (GetSpellInfo()->Effects[effIndex].MiscValue) + switch (GetSpellInfo()->GetEffect(effIndex)->MiscValue) { case EVENT_AWAKEN_WARD_1: trapId = GO_SPIRIT_ALARM_1; @@ -1838,7 +1838,7 @@ class spell_icc_sprit_alarm : public SpellScriptLoader void Register() override { - OnEffectHit += SpellEffectFn(spell_icc_sprit_alarm_SpellScript::HandleEvent, EFFECT_2, SPELL_EFFECT_SEND_EVENT); + OnEffectHit += SpellEffectFn(spell_icc_sprit_alarm_SpellScript::HandleEvent, EFFECT_1, SPELL_EFFECT_SEND_EVENT); } }; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 35402771494..90b252a47ce 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -80,7 +80,7 @@ public: Initialize(); - if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_25_N) { Position pos; @@ -121,7 +121,7 @@ public: events.ScheduleEvent(EVENT_LOCUST, 90000); events.ScheduleEvent(EVENT_BERSERK, 600000); - if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_10_N) events.ScheduleEvent(EVENT_SPAWN_GUARDIAN_NORMAL, urand(15000, 20000)); } @@ -160,7 +160,7 @@ public: case EVENT_IMPALE: //Cast Impale on a random target //Do NOT cast it when we are afflicted by locust swarm - if (!me->HasAura(sSpellMgr->GetSpellIdForDifficulty(SPELL_LOCUST_SWARM, me))) + if (!me->HasAura(SPELL_LOCUST_SWARM)) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_IMPALE); events.ScheduleEvent(EVENT_IMPALE, urand(10000, 20000)); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp index dcb004cc3a0..568df379f15 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp @@ -192,7 +192,7 @@ class npc_faerlina_add : public CreatureScript void Reset() override { - if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) { + if (GetDifficulty() == DIFFICULTY_10_N) { me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_BIND, true); me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_CHARM, true); } @@ -200,7 +200,7 @@ class npc_faerlina_add : public CreatureScript void JustDied(Unit* /*killer*/) override { - if (_instance && GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (_instance && GetDifficulty() == DIFFICULTY_10_N) if (Creature* faerlina = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_FAERLINA))) DoCast(faerlina, SPELL_WIDOWS_EMBRACE); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 39381f38d67..a70d354b966 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -259,7 +259,7 @@ class boss_gothik : public CreatureScript void DoGothikSummon(uint32 entry) { - if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_25_N) { switch (entry) { @@ -421,9 +421,9 @@ class boss_gothik : public CreatureScript case EVENT_SUMMON: if (waves[waveCount].entry) { - if ((waves[waveCount].mode == 2) && (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)) + if ((waves[waveCount].mode == 2) && (GetDifficulty() == DIFFICULTY_25_N)) DoGothikSummon(waves[waveCount].entry); - else if ((waves[waveCount].mode == 0) && (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)) + else if ((waves[waveCount].mode == 0) && (GetDifficulty() == DIFFICULTY_10_N)) DoGothikSummon(waves[waveCount].entry); else if (waves[waveCount].mode == 1) DoGothikSummon(waves[waveCount].entry); @@ -443,9 +443,9 @@ class boss_gothik : public CreatureScript if (waves[waveCount].mode == 1) events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time); - else if ((waves[waveCount].mode == 2) && (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)) + else if ((waves[waveCount].mode == 2) && (GetDifficulty() == DIFFICULTY_25_N)) events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time); - else if ((waves[waveCount].mode == 0) && (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)) + else if ((waves[waveCount].mode == 0) && (GetDifficulty() == DIFFICULTY_10_N)) events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time); else events.ScheduleEvent(EVENT_SUMMON, 0); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index 929c52a986c..ba54b5150e4 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -194,7 +194,7 @@ class spell_grobbulus_poison_cloud : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) override { - if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell)) + if (!sSpellMgr->GetSpellInfo(spellInfo->GetEffect(EFFECT_0)->TriggerSpell)) return false; return true; } @@ -203,7 +203,7 @@ class spell_grobbulus_poison_cloud : public SpellScriptLoader { PreventDefaultAction(); - uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; + uint32 triggerSpell = GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->TriggerSpell; int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3); GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 87466b6bf41..102d1f0fb5b 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -415,7 +415,7 @@ public: events.ScheduleEvent(EVENT_DETONATE, urand(30000, 40000)); events.ScheduleEvent(EVENT_FISSURE, urand(10000, 30000)); events.ScheduleEvent(EVENT_BLAST, urand(60000, 120000)); - if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_25_N) events.ScheduleEvent(EVENT_CHAIN, urand(30000, 60000)); Phase = 2; break; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp index fc376a5439f..cc7e38173c8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp @@ -112,7 +112,7 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP)) { - target->RemoveAura(sSpellMgr->GetSpellIdForDifficulty(SPELL_WEB_SPRAY, me)); + target->RemoveAura(SPELL_WEB_SPRAY); uint8 pos = rand32() % MAX_POS_WRAP; target->GetMotionMaster()->MoveJump(PosWrap[pos].GetPositionX(), PosWrap[pos].GetPositionY(), PosWrap[pos].GetPositionZ(), 20, 20); if (Creature* wrap = DoSummon(NPC_WEB_WRAP, PosWrap[pos], 0, TEMPSUMMON_CORPSE_DESPAWN)) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index 0e07ff027f6..be4c8583377 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -106,7 +106,7 @@ public: events.ScheduleEvent(EVENT_BALCONY, 110000); events.ScheduleEvent(EVENT_CURSE, 10000 + rand32() % 15000); events.ScheduleEvent(EVENT_WARRIOR, 30000); - if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_25_N) events.ScheduleEvent(EVENT_BLINK, urand(20000, 40000)); } } diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index b66bc07f2c8..bada44b20a0 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -387,11 +387,11 @@ class instance_naxxramas : public InstanceMapScript switch (criteria_id) { case 7600: // Criteria for achievement 2176: And They Would All Go Down Together 15sec of each other 10-man - if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL && (maxHorsemenDiedTime - minHorsemenDiedTime) < 15) + if (Difficulty(instance->GetSpawnMode()) == DIFFICULTY_10_N && (maxHorsemenDiedTime - minHorsemenDiedTime) < 15) return true; return false; case 7601: // Criteria for achievement 2177: And They Would All Go Down Together 15sec of each other 25-man - if (Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_25MAN_NORMAL && (maxHorsemenDiedTime - minHorsemenDiedTime) < 15) + if (Difficulty(instance->GetSpawnMode()) == DIFFICULTY_25_N && (maxHorsemenDiedTime - minHorsemenDiedTime) < 15) return true; return false; // Difficulty checks are done on DB. diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 813e51ad23c..b4f27710e03 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -406,7 +406,7 @@ public: { _summonDeaths = value; - if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_10_N) { if (_summonDeaths == MAX_SUMMONS_PHASE_TWO_10MAN) { @@ -414,7 +414,7 @@ public: DoAction(ACTION_HANDLE_P_THREE_INTRO); } } - else if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + else if (GetDifficulty() == DIFFICULTY_25_N) { if (_summonDeaths == MAX_SUMMONS_PHASE_TWO_25MAN) { @@ -862,7 +862,7 @@ public: if (_arcaneReinforcements) { - for (uint8 rangeDisks = 0; rangeDisks < (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL ? 4 : 5); rangeDisks++) + for (uint8 rangeDisks = 0; rangeDisks < (GetDifficulty() == DIFFICULTY_10_N ? 4 : 5); rangeDisks++) { Creature* casterDiskSummon = me->SummonCreature(NPC_HOVER_DISK_CASTER, RangeHoverDisksSpawnPositions[rangeDisks]); @@ -878,7 +878,7 @@ public: _arcaneReinforcements = false; - if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_25_N) events.ScheduleEvent(EVENT_DELAYED_REINFORCEMENTS, 1*IN_MILLISECONDS, 0, PHASE_TWO); } break; @@ -958,7 +958,7 @@ public: SetPhase(PHASE_THREE, true); break; case EVENT_SURGE_OF_POWER_P_THREE: - if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_10_N) { if (Unit* tempSurgeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, false, SPELL_RIDE_RED_DRAGON_BUDDY)) { @@ -975,7 +975,7 @@ public: } } } - else if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + else if (GetDifficulty() == DIFFICULTY_25_N) { memset(_surgeTargetGUID, 0, sizeof(_surgeTargetGUID)); DoCastAOE(SPELL_SURGE_OF_POWER_WARNING_SELECTOR_25, true); @@ -1007,10 +1007,10 @@ public: Talk(SAY_DEATH); if (Creature* alexstraszaGiftBoxBunny = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_GIFT_BOX_BUNNY_GUID))) { - if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (GetDifficulty() == DIFFICULTY_10_N) alexstraszaGiftBoxBunny->SummonGameObject(GO_HEART_OF_MAGIC_10, HeartOfMagicSpawnPos.GetPositionX(), HeartOfMagicSpawnPos.GetPositionY(), HeartOfMagicSpawnPos.GetPositionZ(), HeartOfMagicSpawnPos.GetOrientation(), 0.0f, 0.0f, 0.0f, 1.0f, 0); - else if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + else if (GetDifficulty() == DIFFICULTY_25_N) alexstraszaGiftBoxBunny->SummonGameObject(GO_HEART_OF_MAGIC_25, HeartOfMagicSpawnPos.GetPositionX(), HeartOfMagicSpawnPos.GetPositionY(), HeartOfMagicSpawnPos.GetPositionZ(), HeartOfMagicSpawnPos.GetOrientation(), 0.0f, 0.0f, 0.0f, 1.0f, 0); } @@ -1786,10 +1786,10 @@ class spell_malygos_arcane_storm : public SpellScriptLoader { // Resize list only to objects that are vehicles. IsCreatureVehicleCheck check(true); - Trinity::Containers::RandomResizeList(targets, check, (malygos->GetMap()->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL ? 4 : 10)); + Trinity::Containers::RandomResizeList(targets, check, (malygos->GetMap()->GetDifficulty() == DIFFICULTY_10_N ? 4 : 10)); } else - Trinity::Containers::RandomResizeList(targets, (malygos->GetMap()->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL ? 4 : 10)); + Trinity::Containers::RandomResizeList(targets, (malygos->GetMap()->GetDifficulty() == DIFFICULTY_10_N ? 4 : 10)); } void HandleVisual(SpellEffIndex /*effIndex*/) @@ -1948,7 +1948,7 @@ class spell_arcane_overload : public SpellScriptLoader { Creature* arcaneOverload = GetCaster()->ToCreature(); targets.remove_if(ExactDistanceCheck(arcaneOverload, - GetSpellInfo()->Effects[EFFECT_0].CalcRadius(arcaneOverload) * arcaneOverload->GetObjectScale())); + GetSpellInfo()->GetEffect(EFFECT_0)->CalcRadius(arcaneOverload) * arcaneOverload->GetObjectScale())); } void Register() override @@ -2475,9 +2475,9 @@ class spell_alexstrasza_gift_beam_visual : public SpellScriptLoader { if (Creature* target = GetTarget()->ToCreature()) { - if (target->GetMap()->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (target->GetMap()->GetDifficulty() == DIFFICULTY_10_N) _alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_10, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0); - else if (target->GetMap()->GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + else if (target->GetMap()->GetDifficulty() == DIFFICULTY_25_N) _alexstraszaGift = target->SummonGameObject(GO_ALEXSTRASZA_S_GIFT_25, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 0); } } diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp index 90decfbf46e..b689df3c977 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp @@ -92,14 +92,14 @@ public: platformGUID = go->GetGUID(); break; case GO_FOCUSING_IRIS_10: - if (instance->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (instance->GetDifficulty() == DIFFICULTY_10_N) { irisGUID = go->GetGUID(); focusingIrisPosition = go->GetPosition(); } break; case GO_FOCUSING_IRIS_25: - if (instance->GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (instance->GetDifficulty() == DIFFICULTY_25_N) { irisGUID = go->GetGUID(); focusingIrisPosition = go->GetPosition(); @@ -110,11 +110,11 @@ public: exitPortalPosition = go->GetPosition(); break; case GO_HEART_OF_MAGIC_10: - if (instance->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (instance->GetDifficulty() == DIFFICULTY_10_N) heartOfMagicGUID = go->GetGUID(); break; case GO_HEART_OF_MAGIC_25: - if (instance->GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (instance->GetDifficulty() == DIFFICULTY_25_N) heartOfMagicGUID = go->GetGUID(); break; } @@ -240,7 +240,7 @@ public: PowerSparksHandling(); break; case DATA_RESPAWN_IRIS: - SpawnGameObject(instance->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL ? GO_FOCUSING_IRIS_10 : GO_FOCUSING_IRIS_25, focusingIrisPosition); + SpawnGameObject(instance->GetDifficulty() == DIFFICULTY_10_N ? GO_FOCUSING_IRIS_10 : GO_FOCUSING_IRIS_25, focusingIrisPosition); break; } } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 3f882e0b99e..b0c4be44ee8 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -418,7 +418,7 @@ class spell_oculus_ride_ruby_emerald_amber_drake_que : public SpellScriptLoader // caster of the triggered spell is wrong for an unknown reason, handle it here correctly PreventDefaultAction(); if (Unit* caster = GetCaster()) - GetTarget()->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); + GetTarget()->CastSpell(caster, aurEff->GetSpellEffectInfo()->TriggerSpell, true); } void Register() override diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index fc29369c28f..c0760afec23 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -161,7 +161,7 @@ public: Talk(EMOTE_NOVA); DoCast(me, SPELL_LIGHTNING_NOVA); - me->RemoveAurasDueToSpell(sSpellMgr->GetSpellIdForDifficulty(SPELL_PULSING_SHOCKWAVE, me)); + me->RemoveAurasDueToSpell(SPELL_PULSING_SHOCKWAVE); m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); // Pause Pulsing Shockwave aura m_uiLightningNova_Timer = urand(20000, 21000); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index d63d5e87923..3a707e7fa70 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -428,7 +428,7 @@ public: void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) override { // This is the dummy effect of the spells - if (pSpell->Id == sSpellMgr->GetSpellIdForDifficulty(SPELL_SHATTER, me)) + if (pSpell->Id == SPELL_SHATTER) if (me->GetEntry() == NPC_BRITTLE_GOLEM) me->DespawnOrUnsummon(); } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index 07cdfa3353c..d911bf07439 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -182,7 +182,7 @@ class spell_krystallus_shatter_effect : public SpellScriptLoader if (!GetHitUnit()) return; - float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); + float radius = GetSpellInfo()->GetEffect(EFFECT_0)->CalcRadius(GetCaster()); if (!radius) return; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index bb7a8592e04..41da9ec09ea 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -615,7 +615,7 @@ class boss_stormcaller_brundir : public CreatureScript break; case EVENT_GROUND: //me->SetLevitate(false); - me->RemoveAurasDueToSpell(sSpellMgr->GetSpellIdForDifficulty(SPELL_LIGHTNING_TENDRILS, me)); + me->RemoveAurasDueToSpell(SPELL_LIGHTNING_TENDRILS); me->RemoveAurasDueToSpell(SPELL_LIGHTNING_TENDRILS_VISUAL); DoStartMovement(me->GetVictim()); events.CancelEvent(EVENT_GROUND); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 40c189a8da2..b6ac62257d0 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1793,7 +1793,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader } } } - if (target && target->IsWithinDist2d(targets.GetDstPos(), GetSpellInfo()->Effects[effIndex].CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct + if (target && target->IsWithinDist2d(targets.GetDstPos(), GetSpellInfo()->GetEffect(effIndex)->CalcRadius() * 2)) // now we use *2 because the location of the seat is not correct passenger->EnterVehicle(target, 0); else { diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 93fee8d1964..5952c9f8501 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -1583,7 +1583,7 @@ class spell_freya_iron_roots : public SpellScriptLoader void HandleSummon(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue); + uint32 entry = uint32(GetSpellInfo()->GetEffect(effIndex)->MiscValue); Position pos = GetCaster()->GetPosition(); // Not good at all, but this prevents having roots in a different position then player diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index 419052baddc..5ac0024c032 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -454,11 +454,11 @@ class spell_ulduar_cancel_stone_grip : public SpellScriptLoader switch (target->GetMap()->GetDifficulty()) { - case RAID_DIFFICULTY_10MAN_NORMAL: - target->RemoveAura(GetSpellInfo()->Effects[EFFECT_0].CalcValue()); + case DIFFICULTY_10_N: + target->RemoveAura(GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue()); break; - case RAID_DIFFICULTY_25MAN_NORMAL: - target->RemoveAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue()); + case DIFFICULTY_25_N: + target->RemoveAura(GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue()); break; default: break; @@ -534,7 +534,7 @@ class spell_ulduar_stone_grip_absorb : public SpellScriptLoader if (!GetOwner()->ToCreature()) return; - uint32 rubbleStalkerEntry = (GetOwner()->GetMap()->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? 33809 : 33942); + uint32 rubbleStalkerEntry = (GetOwner()->GetMap()->GetDifficulty() == DIFFICULTY_NORMAL ? 33809 : 33942); Creature* rubbleStalker = GetOwner()->FindNearestCreature(rubbleStalkerEntry, 200.0f, true); if (rubbleStalker) rubbleStalker->CastSpell(rubbleStalker, SPELL_STONE_GRIP_CANCEL, true); @@ -643,7 +643,7 @@ class spell_kologarn_summon_focused_eyebeam : public SpellScriptLoader void HandleForceCast(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - GetCaster()->CastSpell(GetCaster(), GetSpellInfo()->Effects[effIndex].TriggerSpell, true); + GetCaster()->CastSpell(GetCaster(), GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, true); } void Register() override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index cad6b045120..947b1ce9b86 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -237,7 +237,7 @@ class boss_razorscale_controller : public CreatureScript { case ACTION_HARPOON_BUILD: events.ScheduleEvent(EVENT_BUILD_HARPOON_1, 50000); - if (me->GetMap()->GetSpawnMode() == RAID_DIFFICULTY_25MAN_NORMAL) + if (me->GetMap()->GetSpawnMode() == DIFFICULTY_25_N) events.ScheduleEvent(EVENT_BUILD_HARPOON_3, 90000); break; case ACTION_PLACE_BROKEN_HARPOON: @@ -1075,7 +1075,7 @@ class spell_razorscale_devouring_flame : public SpellScriptLoader { PreventHitDefaultEffect(effIndex); Unit* caster = GetCaster(); - uint32 entry = uint32(GetSpellInfo()->Effects[effIndex].MiscValue); + uint32 entry = uint32(GetSpellInfo()->GetEffect(effIndex)->MiscValue); WorldLocation const* summonLocation = GetExplTargetDest(); if (!caster || !summonLocation) return; diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index d49a23c85dd..1e55eb37007 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -572,8 +572,8 @@ public: void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override { if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)) - for (uint8 i = 0; i < 3; ++i) - if (spell->Effects[i].Effect == SPELL_EFFECT_INTERRUPT_CAST) + for (SpellEffectInfo const* effect : spell->GetEffectsForDifficulty(me->GetMap()->GetDifficulty())) + if (effect->Effect == SPELL_EFFECT_INTERRUPT_CAST) if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK || me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN) me->InterruptSpell(CURRENT_GENERIC_SPELL, false); diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 2cee741cbf3..a3404e048ce 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -317,7 +317,7 @@ class spell_gruul_shatter_effect : public SpellScriptLoader if (!GetHitUnit()) return; - float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); + float radius = GetSpellInfo()->GetEffect(EFFECT_0)->CalcRadius(GetCaster()); if (!radius) return; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index a0673d4aced..c0a7f85cb63 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -154,7 +154,7 @@ class spell_broggok_poison_cloud : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) override { - if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell)) + if (!sSpellMgr->GetSpellInfo(spellInfo->GetEffect(EFFECT_0)->TriggerSpell)) return false; return true; } @@ -163,7 +163,7 @@ class spell_broggok_poison_cloud : public SpellScriptLoader { PreventDefaultAction(); - uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; + uint32 triggerSpell = GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->TriggerSpell; int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3); GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff); } diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index cd433000e8e..7e30ae1a931 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -542,7 +542,7 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader return; Unit* target = GetUnitOwner(); - target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(), false); + target->CastSpell(target, GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue(), false); } void Register() override diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 0ff7d116a88..f899bb02cc0 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -89,7 +89,7 @@ class spell_dk_anti_magic_shell_raid : public SpellScriptLoader bool Load() override { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + absorbPct = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(GetCaster()); return true; } @@ -138,8 +138,8 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader uint32 absorbPct, hpPct; bool Load() override { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); - hpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()); + absorbPct = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(GetCaster()); + hpPct = GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue(GetCaster()); return true; } @@ -203,7 +203,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader bool Load() override { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + absorbPct = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(GetCaster()); return true; } @@ -217,7 +217,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { SpellInfo const* talentSpell = sSpellMgr->EnsureSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT); - amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster()); + amount = talentSpell->GetEffect(EFFECT_0)->CalcValue(GetCaster()); if (Player* player = GetCaster()->ToPlayer()) amount += int32(2 * player->GetTotalAttackPowerValue(BASE_ATTACK)); } @@ -628,7 +628,7 @@ class spell_dk_death_strike : public SpellScriptLoader if (AuraEffect* enabler = GetCaster()->GetAuraEffect(SPELL_DK_DEATH_STRIKE_ENABLER, EFFECT_0, GetCaster()->GetGUID())) { // Call CalculateAmount() to constantly fire the AuraEffect's HandleCalcAmount method - int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->Effects[EFFECT_0].ChainAmplitude); + int32 heal = CalculatePct(enabler->CalculateAmount(GetCaster()), GetSpellInfo()->GetEffect(EFFECT_0)->ChainAmplitude); if (AuraEffect const* aurEff = GetCaster()->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_DEATH_STRIKE, EFFECT_2)) heal = AddPct(heal, aurEff->GetAmount()); @@ -1231,12 +1231,13 @@ class spell_dk_raise_dead : public SpellScriptLoader private: bool Validate(SpellInfo const* spellInfo) override { - if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_1].CalcValue()) - || !sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_2].CalcValue()) + // 6.x effects changed + /*if (!sSpellMgr->GetSpellInfo(spellInfo->GetEffect(EFFECT_1)->CalcValue()) + || !sSpellMgr->GetSpellInfo(spellInfo->GetEffect(EFFECT_2)->CalcValue()) || !sSpellMgr->GetSpellInfo(SPELL_DK_RAISE_DEAD_USE_REAGENT) || !sSpellMgr->GetSpellInfo(SPELL_DK_MASTER_OF_GHOULS)) - return false; - return true; + return false;*/ + return false; } bool Load() override @@ -1314,10 +1315,10 @@ class spell_dk_raise_dead : public SpellScriptLoader // Do we have talent Master of Ghouls? if (GetCaster()->HasAura(SPELL_DK_MASTER_OF_GHOULS)) // summon as pet - return GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + return GetSpellInfo()->GetEffect(EFFECT_2)->CalcValue(); // or guardian - return GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + return GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue(); } void HandleRaiseDead(SpellEffIndex /*effIndex*/) diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 184e12cdccb..ac977c3cdcd 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -175,7 +175,7 @@ class spell_dru_eclipse_energize : public SpellScriptLoader { case SPELL_DRUID_WRATH: { - energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -13 + energizeAmount = -GetSpellInfo()->GetEffect(effIndex)->BasePoints; // -13 // If we are set to fill the lunar side or we've just logged in with 0 power.. if ((!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) || caster->GetPower(POWER_ECLIPSE) == 0) @@ -192,7 +192,7 @@ class spell_dru_eclipse_energize : public SpellScriptLoader } case SPELL_DRUID_STARFIRE: { - energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 20 + energizeAmount = GetSpellInfo()->GetEffect(effIndex)->BasePoints; // 20 // If we are set to fill the solar side or we've just logged in with 0 power.. if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) || caster->GetPower(POWER_ECLIPSE) == 0) @@ -213,7 +213,7 @@ class spell_dru_eclipse_energize : public SpellScriptLoader if ((!caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER)) || caster->GetPower(POWER_ECLIPSE) == 0) { - energizeAmount = GetSpellInfo()->Effects[effIndex].BasePoints; // 15 + energizeAmount = GetSpellInfo()->GetEffect(effIndex)->BasePoints; // 15 caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true); // If the energize was due to 0 power, cast the eclipse marker aura @@ -222,7 +222,7 @@ class spell_dru_eclipse_energize : public SpellScriptLoader } else if (!caster->HasAura(SPELL_DRUID_SOLAR_ECLIPSE_MARKER) && caster->HasAura(SPELL_DRUID_LUNAR_ECLIPSE_MARKER)) { - energizeAmount = -GetSpellInfo()->Effects[effIndex].BasePoints; // -15 + energizeAmount = -GetSpellInfo()->GetEffect(effIndex)->BasePoints; // -15 caster->CastCustomSpell(caster, SPELL_DRUID_STARSURGE_ENERGIZE, &energizeAmount, 0, 0, true); } // The energizing effect brought us out of the lunar eclipse, remove the aura @@ -430,7 +430,7 @@ class spell_dru_idol_lifebloom : public SpellScriptLoader spellMod->op = SPELLMOD_DOT; spellMod->type = SPELLMOD_FLAT; spellMod->spellId = GetId(); - spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; + spellMod->mask = GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->SpellClassMask; } spellMod->value = aurEff->GetAmount() / 7; } @@ -757,7 +757,7 @@ class spell_dru_savage_defense : public SpellScriptLoader bool Load() override { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); + absorbPct = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(GetCaster()); return true; } @@ -1191,7 +1191,7 @@ class spell_dru_wild_growth : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) override { - if (spellInfo->Effects[EFFECT_2].IsEffect() || spellInfo->Effects[EFFECT_2].CalcValue() <= 0) + if (spellInfo->GetEffect(EFFECT_2)->IsEffect() || spellInfo->GetEffect(EFFECT_2)->CalcValue() <= 0) return false; return true; } @@ -1200,7 +1200,7 @@ class spell_dru_wild_growth : public SpellScriptLoader { targets.remove_if(RaidCheck(GetCaster())); - uint32 const maxTargets = uint32(GetSpellInfo()->Effects[EFFECT_2].CalcValue(GetCaster())); + uint32 const maxTargets = uint32(GetSpellInfo()->GetEffect(EFFECT_2)->CalcValue(GetCaster())); if (targets.size() > maxTargets) { diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index badb19c12c3..87619460ee7 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -59,7 +59,7 @@ class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader bool Load() override { // Max absorb stored in 1 dummy effect - limit = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + limit = GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue(); return true; } @@ -207,9 +207,9 @@ class spell_gen_alchemist_stone : public SpellScriptLoader uint32 spellId = 0; int32 bp = int32(eventInfo.GetDamageInfo()->GetDamage() * 0.4f); - if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_HEAL)) + if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(DIFFICULTY_NONE, SPELL_EFFECT_HEAL)) spellId = ALECHEMIST_STONE_HEAL; - else if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(SPELL_EFFECT_ENERGIZE)) + else if (eventInfo.GetDamageInfo()->GetSpellInfo()->HasEffect(DIFFICULTY_NONE, SPELL_EFFECT_ENERGIZE)) spellId = ALECHEMIST_STONE_MANA; if (!spellId) @@ -1180,13 +1180,14 @@ class spell_gen_defend : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) override { - if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3)) - return false; - return true; + // 6.x effects changed + //if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1)) + // return false; + //if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2)) + // return false; + //if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3)) + // return false; + return false; } void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) @@ -1222,23 +1223,24 @@ class spell_gen_defend : public SpellScriptLoader { SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(m_scriptSpellId); + // 6.x effects removed + // Defend spells cast by NPCs (add visuals) - if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) + /*if (spell->GetEffect(EFFECT_0)->ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) { AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveVisualShields, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); - } - + }*/ // Remove Defend spell from player when he dismounts - if (spell->Effects[EFFECT_2].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) - OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); + //if (spell->GetEffect(EFFECT_2)->ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) + // OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveDummyFromDriver, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL); // Defend spells cast by players (add/remove visuals) - if (spell->Effects[EFFECT_1].ApplyAuraName == SPELL_AURA_DUMMY) + /*if (spell->GetEffect(EFFECT_1)->ApplyAuraName == SPELL_AURA_DUMMY) { AfterEffectApply += AuraEffectApplyFn(spell_gen_defend_AuraScript::RefreshVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); OnEffectRemove += AuraEffectRemoveFn(spell_gen_defend_AuraScript::RemoveVisualShields, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK); - } + }*/ } }; @@ -1264,7 +1266,7 @@ class spell_gen_despawn_self : public SpellScriptLoader void HandleDummy(SpellEffIndex effIndex) { - if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_SCRIPT_EFFECT) + if (GetSpellInfo()->GetEffect(effIndex)->Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->GetEffect(effIndex)->Effect == SPELL_EFFECT_SCRIPT_EFFECT) GetCaster()->ToCreature()->DespawnOrUnsummon(); } @@ -1945,10 +1947,10 @@ class spell_gen_mounted_charge: public SpellScriptLoader { SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(m_scriptSpellId); - if (spell->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT)) + if (spell->HasEffect(DIFFICULTY_NONE, SPELL_EFFECT_SCRIPT_EFFECT)) OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT); - if (spell->Effects[EFFECT_0].Effect == SPELL_EFFECT_CHARGE) + if (spell->GetEffect(EFFECT_0)->Effect == SPELL_EFFECT_CHARGE) OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleChargeEffect, EFFECT_0, SPELL_EFFECT_CHARGE); } }; @@ -2426,8 +2428,8 @@ class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader void HandleDummy(SpellEffIndex effIndex) { Player* player = GetCaster()->ToPlayer(); - uint32 factionId = GetSpellInfo()->Effects[effIndex].CalcValue(); - int32 repChange = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + uint32 factionId = GetSpellInfo()->GetEffect(effIndex)->CalcValue(); + int32 repChange = GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); if (!factionEntry) @@ -3845,7 +3847,7 @@ public: void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) { - if (GetCaster()->HasAura(SPELL_MIXOLOGY) && GetCaster()->HasSpell(GetSpellInfo()->Effects[EFFECT_0].TriggerSpell)) + if (GetCaster()->HasAura(SPELL_MIXOLOGY) && GetCaster()->HasSpell(GetSpellInfo()->GetEffect(EFFECT_0)->TriggerSpell)) { switch (GetId()) { diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 5c84f3045f8..a5eec35d95b 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -691,7 +691,7 @@ class spell_brewfest_relay_race_intro_force_player_to_throw : public SpellScript PreventHitDefaultEffect(effIndex); // All this spells trigger a spell that requires reagents; if the // triggered spell is cast as "triggered", reagents are not consumed - GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)); + GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST)); } void Register() override diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index f8ef7862c35..9f7f0dc4a5b 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -231,42 +231,6 @@ class spell_hun_disengage : public SpellScriptLoader } }; -// 82926 - Fire! -class spell_hun_fire : public SpellScriptLoader -{ - public: - spell_hun_fire() : SpellScriptLoader("spell_hun_fire") { } - - class spell_hun_fire_AuraScript : public AuraScript - { - PrepareAuraScript(spell_hun_fire_AuraScript); - - void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) - { - if (!spellMod) - { - spellMod = new SpellModifier(GetAura()); - spellMod->op = SPELLMOD_CASTING_TIME; - spellMod->type = SPELLMOD_PCT; - spellMod->spellId = GetId(); - spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; - } - - spellMod->value = -aurEff->GetAmount(); - } - - void Register() override - { - DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_hun_fire_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_hun_fire_AuraScript(); - } -}; - // -19572 - Improved Mend Pet class spell_hun_improved_mend_pet : public SpellScriptLoader { @@ -308,42 +272,6 @@ class spell_hun_improved_mend_pet : public SpellScriptLoader } }; -// -19464 Improved Serpent Sting -class spell_hun_improved_serpent_sting : public SpellScriptLoader -{ - public: - spell_hun_improved_serpent_sting() : SpellScriptLoader("spell_hun_improved_serpent_sting") { } - - class spell_hun_improved_serpent_sting_AuraScript : public AuraScript - { - PrepareAuraScript(spell_hun_improved_serpent_sting_AuraScript); - - void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) - { - if (!spellMod) - { - spellMod = new SpellModifier(GetAura()); - spellMod->op = SpellModOp(aurEff->GetMiscValue()); - spellMod->type = SPELLMOD_PCT; - spellMod->spellId = GetId(); - spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; - } - - spellMod->value = aurEff->GetAmount(); - } - - void Register() override - { - DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_hun_improved_serpent_sting_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_hun_improved_serpent_sting_AuraScript(); - } -}; - // 53412 - Invigoration class spell_hun_invigoration : public SpellScriptLoader { @@ -430,7 +358,7 @@ class spell_hun_masters_call : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) override { if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_MASTERS_CALL_TRIGGERED) || - !sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue())) + !sSpellMgr->GetSpellInfo(spellInfo->GetEffect(EFFECT_0)->CalcValue())) return false; return true; } @@ -1087,9 +1015,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_chimera_shot(); new spell_hun_cobra_shot(); new spell_hun_disengage(); - new spell_hun_fire(); new spell_hun_improved_mend_pet(); - new spell_hun_improved_serpent_sting(); new spell_hun_invigoration(); new spell_hun_last_stand_pet(); new spell_hun_masters_call(); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 17c72ba5561..23f0c7772e9 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -497,7 +497,7 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount) { - Unit* target = GetTarget(); + /*Unit* target = GetTarget(); if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) { int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); // SPELL_EFFECT_DUMMY with NO_TARGET @@ -510,7 +510,7 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader absorbAmount = 0; PreventDefaultAction(); } - } + }*/ } void Register() override @@ -738,7 +738,7 @@ class spell_mage_living_bomb : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) { - if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->Effects[EFFECT_1].CalcValue()))) + if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->GetEffect(EFFECT_1)->CalcValue()))) return false; return true; } @@ -836,7 +836,7 @@ class spell_mage_ignite : public SpellScriptLoader SpellInfo const* igniteDot = sSpellMgr->EnsureSpellInfo(SPELL_MAGE_IGNITE); int32 pct = 8 * GetSpellInfo()->GetRank(); - int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks()); + int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks(DIFFICULTY_NONE)); amount += eventInfo.GetProcTarget()->GetRemainingPeriodicAmount(eventInfo.GetActor()->GetGUID(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE); GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, NULL, aurEff); } @@ -1254,7 +1254,7 @@ class spell_mage_ring_of_frost : public SpellScriptLoader void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { std::list<Creature*> MinionList; - GetTarget()->GetAllMinionsByEntry(MinionList, GetSpellInfo()->Effects[EFFECT_0].MiscValue); + GetTarget()->GetAllMinionsByEntry(MinionList, GetSpellInfo()->GetEffect(EFFECT_0)->MiscValue); // Get the last summoned RoF, save it and despawn older ones for (std::list<Creature*>::iterator itr = MinionList.begin(); itr != MinionList.end(); itr++) @@ -1313,7 +1313,7 @@ class spell_mage_ring_of_frost_freeze : public SpellScriptLoader void FilterTargets(std::list<WorldObject*>& targets) { - float outRadius = sSpellMgr->GetSpellInfo(SPELL_MAGE_RING_OF_FROST_SUMMON)->Effects[EFFECT_0].CalcRadius(); + float outRadius = sSpellMgr->GetSpellInfo(SPELL_MAGE_RING_OF_FROST_SUMMON)->GetEffect(EFFECT_0)->CalcRadius(); float inRadius = 4.7f; for (std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); ++itr) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 1dab620a9c7..f4afee89d6f 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -401,62 +401,6 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader } }; -// 64205 - Divine Sacrifice -class spell_pal_divine_sacrifice : public SpellScriptLoader -{ - public: - spell_pal_divine_sacrifice() : SpellScriptLoader("spell_pal_divine_sacrifice") { } - - class spell_pal_divine_sacrifice_AuraScript : public AuraScript - { - PrepareAuraScript(spell_pal_divine_sacrifice_AuraScript); - - uint32 groupSize, minHpPct; - int32 remainingAmount; - - bool Load() override - { - - if (Unit* caster = GetCaster()) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - if (caster->ToPlayer()->GetGroup()) - groupSize = caster->ToPlayer()->GetGroup()->GetMembersCount(); - else - groupSize = 1; - } - else - return false; - - remainingAmount = (caster->CountPctFromMaxHealth(GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)) * groupSize); - minHpPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster); - return true; - } - return false; - } - - void Split(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & splitAmount) - { - remainingAmount -= splitAmount; - // break when absorbed everything it could, or if the casters hp drops below 20% - if (Unit* caster = GetCaster()) - if (remainingAmount <= 0 || (caster->GetHealthPct() < minHpPct)) - caster->RemoveAura(SPELL_PALADIN_DIVINE_SACRIFICE); - } - - void Register() override - { - OnEffectSplit += AuraEffectSplitFn(spell_pal_divine_sacrifice_AuraScript::Split, EFFECT_0); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_pal_divine_sacrifice_AuraScript(); - } -}; - // 53385 - Divine Storm class spell_pal_divine_storm : public SpellScriptLoader { @@ -485,7 +429,7 @@ class spell_pal_divine_storm : public SpellScriptLoader bool Load() override { - healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()); + healPct = GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue(GetCaster()); return true; } @@ -1279,7 +1223,6 @@ void AddSC_paladin_spell_scripts() new spell_pal_avenging_wrath(); new spell_pal_beacon_of_light(); new spell_pal_blessing_of_faith(); - new spell_pal_divine_sacrifice(); new spell_pal_divine_storm(); new spell_pal_divine_storm_dummy(); new spell_pal_exorcism_and_holy_wrath_damage(); diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index 9fd55ae057e..042f1c321ee 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -915,7 +915,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - AddPct(mod, spellInfo->Effects[EFFECT_0].CalcValue()); + AddPct(mod, spellInfo->GetEffect(EFFECT_0)->CalcValue()); } ownerBonus = owner->GetStat(STAT_STAMINA)*mod; @@ -958,7 +958,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue()); + mod += CalculatePct(1.0f, spellInfo->GetEffect(EFFECT_1)->CalcValue()); } bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod; @@ -988,7 +988,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue()); + mod += CalculatePct(1.0f, spellInfo->GetEffect(EFFECT_1)->CalcValue()); } bonusDamage = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod; @@ -1450,7 +1450,7 @@ public: amount = -90; // Night of the dead else if (Aura* aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD)) - amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + amount = aur->GetSpellInfo()->GetEffect(EFFECT_2)->CalcValue(); } } } @@ -1502,7 +1502,7 @@ public: // Ravenous Dead. Check just if owner has Ravenous Dead since it's effect is not an aura if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0)) - mod += aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()/100; // Ravenous Dead edits the original scale + mod += aurEff->GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue()/100; // Ravenous Dead edits the original scale // Glyph of the Ghoul if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL, 0)) @@ -1547,7 +1547,7 @@ public: aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0); if (aurEff) { - mod += CalculatePct(mod, aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale + mod += CalculatePct(mod, aurEff->GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue()); // Ravenous Dead edits the original scale } // Glyph of the Ghoul aurEff = owner->GetAuraEffect(58686, 0); diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 8ec5450072f..c5a6fcaa4e7 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -369,7 +369,7 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader PreventDefaultAction(); SpellInfo const* triggeredSpellInfo = sSpellMgr->EnsureSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL); - int32 heal = int32(CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks()); + int32 heal = int32(CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks(DIFFICULTY_NONE)); GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, NULL, aurEff); } @@ -402,7 +402,7 @@ class spell_pri_improved_power_word_shield : public SpellScriptLoader spellMod->op = SpellModOp(aurEff->GetMiscValue()); spellMod->type = SPELLMOD_PCT; spellMod->spellId = GetId(); - spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; + spellMod->mask = GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->SpellClassMask; } spellMod->value = aurEff->GetAmount(); @@ -483,7 +483,7 @@ class spell_pri_guardian_spirit : public SpellScriptLoader bool Load() override { - healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + healPct = GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue(); return true; } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 580549a3d99..e9cf81f2e64 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -635,12 +635,12 @@ class spell_q12683_take_sputum_sample : public SpellScriptLoader void HandleDummy(SpellEffIndex /*effIndex*/) { - uint32 reqAuraId = GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + uint32 reqAuraId = GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue(); Unit* caster = GetCaster(); if (caster->HasAuraEffect(reqAuraId, 0)) { - uint32 spellId = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); + uint32 spellId = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(); caster->CastSpell(caster, spellId, true, NULL); } } @@ -1850,7 +1850,7 @@ class spell_q13086_cannons_target : public SpellScriptLoader bool Validate(SpellInfo const* spellInfo) override { - if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].CalcValue())) + if (!sSpellMgr->GetSpellInfo(spellInfo->GetEffect(EFFECT_0)->CalcValue())) return false; return true; } @@ -2011,7 +2011,7 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa void ModDest(SpellDestination& dest) { - float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); + float dist = GetSpellInfo()->GetEffect(EFFECT_0)->CalcRadius(GetCaster()); float angle = frand(0.75f, 1.25f) * float(M_PI); Position pos = GetCaster()->GetNearPosition(dist, angle); @@ -2151,7 +2151,7 @@ class spell_q12619_emblazon_runeblade : public SpellScriptLoader { PreventDefaultAction(); if (Unit* caster = GetCaster()) - caster->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, NULL, aurEff); + caster->CastSpell(caster, GetSpellInfo()->GetEffect(aurEff->GetEffIndex())->TriggerSpell, true, NULL, aurEff); } void Register() override diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 9b3b38875af..78ebe0734b5 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -145,7 +145,8 @@ class spell_rog_cheat_death : public SpellScriptLoader bool Load() override { - absorbChance = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); + // 6.x has basepoint = 0 ! + absorbChance = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(); return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER; } @@ -491,57 +492,6 @@ class spell_rog_master_of_subtlety : public SpellScriptLoader } }; -// 31130 - Nerves of Steel -class spell_rog_nerves_of_steel : public SpellScriptLoader -{ - public: - spell_rog_nerves_of_steel() : SpellScriptLoader("spell_rog_nerves_of_steel") { } - - class spell_rog_nerves_of_steel_AuraScript : public AuraScript - { - PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript); - - public: - spell_rog_nerves_of_steel_AuraScript() - { - absorbPct = 0; - } - - private: - uint32 absorbPct; - - bool Load() override - { - absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); - return true; - } - - void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) - { - // Set absorbtion amount to unlimited - amount = -1; - } - - void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) - { - // reduces all damage taken while stun or fear - if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))) - absorbAmount = CalculatePct(dmgInfo.GetDamage(), absorbPct); - } - - void Register() override - { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_nerves_of_steel_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); - OnEffectAbsorb += AuraEffectAbsorbFn(spell_rog_nerves_of_steel_AuraScript::Absorb, EFFECT_0); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_rog_nerves_of_steel_AuraScript(); - } -}; - // 58428 - Overkill class spell_rog_overkill : public SpellScriptLoader { @@ -642,51 +592,6 @@ class spell_rog_preparation : public SpellScriptLoader } }; -// 51685 - Prey on the Weak -class spell_rog_prey_on_the_weak : public SpellScriptLoader -{ - public: - spell_rog_prey_on_the_weak() : SpellScriptLoader("spell_rog_prey_on_the_weak") { } - - class spell_rog_prey_on_the_weak_AuraScript : public AuraScript - { - PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_PREY_ON_THE_WEAK)) - return false; - return true; - } - - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - Unit* target = GetTarget(); - Unit* victim = target->GetVictim(); - if (victim && (target->GetHealthPct() > victim->GetHealthPct())) - { - if (!target->HasAura(SPELL_ROGUE_PREY_ON_THE_WEAK)) - { - int32 bp = GetSpellInfo()->Effects[EFFECT_0].CalcValue(); - target->CastCustomSpell(target, SPELL_ROGUE_PREY_ON_THE_WEAK, &bp, nullptr, nullptr, true); - } - } - else - target->RemoveAurasDueToSpell(SPELL_ROGUE_PREY_ON_THE_WEAK); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_rog_prey_on_the_weak_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_rog_prey_on_the_weak_AuraScript(); - } -}; - // 73651 - Recuperate class spell_rog_recuperate : public SpellScriptLoader { @@ -714,7 +619,7 @@ class spell_rog_recuperate : public SpellScriptLoader canBeRecalculated = false; if (Unit* caster = GetCaster()) { - int32 baseAmount = GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster) * 1000; + int32 baseAmount = GetSpellInfo()->GetEffect(EFFECT_0)->CalcValue(caster) * 1000; // Improved Recuperate if (AuraEffect const* auraEffect = caster->GetDummyAuraEffect(SPELLFAMILY_ROGUE, ICON_ROGUE_IMPROVED_RECUPERATE, EFFECT_0)) baseAmount += auraEffect->GetAmount(); @@ -1028,10 +933,8 @@ void AddSC_rogue_spell_scripts() new spell_rog_deadly_poison(); new spell_rog_killing_spree(); new spell_rog_master_of_subtlety(); - new spell_rog_nerves_of_steel(); new spell_rog_overkill(); new spell_rog_preparation(); - new spell_rog_prey_on_the_weak(); new spell_rog_recuperate(); new spell_rog_rupture(); new spell_rog_shiv(); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 5e8e3a1070f..3aace7213c0 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -236,7 +236,7 @@ class spell_sha_chain_heal : public SpellScriptLoader if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID())) { riptide = true; - amount = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + amount = aurEff->GetSpellInfo()->GetEffect(DIFFICULTY_NONE, EFFECT_2)->CalcValue(); // Consume it GetHitUnit()->RemoveAura(aurEff->GetBase()); } @@ -561,44 +561,6 @@ class spell_sha_flame_shock : public SpellScriptLoader } }; -// 77794 - Focused Insight -class spell_sha_focused_insight : public SpellScriptLoader -{ - public: - spell_sha_focused_insight() : SpellScriptLoader("spell_sha_focused_insight") { } - - class spell_sha_focused_insight_AuraScript : public AuraScript - { - PrepareAuraScript(spell_sha_focused_insight_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_FOCUSED_INSIGHT)) - return false; - return true; - } - - void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) - { - PreventDefaultAction(); - int32 basePoints0 = aurEff->GetAmount(); - int32 basePoints1 = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); - - GetTarget()->CastCustomSpell(GetTarget(), SPELL_SHAMAN_FOCUSED_INSIGHT, &basePoints0, &basePoints1, &basePoints1, true, NULL, aurEff); - } - - void Register() override - { - OnEffectProc += AuraEffectProcFn(spell_sha_focused_insight_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_sha_focused_insight_AuraScript(); - } -}; - // 55440 - Glyph of Healing Wave class spell_sha_glyph_of_healing_wave : public SpellScriptLoader { @@ -1072,7 +1034,7 @@ class spell_sha_nature_guardian : public SpellScriptLoader eventInfo.GetProcTarget()->getThreatManager().modifyThreatPercent(GetTarget(), -10); if (Player* player = GetTarget()->ToPlayer()) - player->AddSpellCooldown(GetSpellInfo()->Id, 0, time(NULL) + aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); + player->AddSpellCooldown(GetSpellInfo()->Id, 0, time(NULL) + aurEff->GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue()); } void Register() override @@ -1242,7 +1204,6 @@ void AddSC_shaman_spell_scripts() new spell_sha_feedback(); new spell_sha_fire_nova(); new spell_sha_flame_shock(); - new spell_sha_focused_insight(); new spell_sha_glyph_of_healing_wave(); new spell_sha_healing_stream_totem(); new spell_sha_heroism(); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 128cddef1c1..924a6113063 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -201,15 +201,16 @@ class spell_warl_conflagrate : public SpellScriptLoader return true; } - void HandleHit(SpellEffIndex /*effIndex*/) - { - if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffect(SPELL_WARLOCK_IMMOLATE, EFFECT_2, GetCaster()->GetGUID())) - SetHitDamage(CalculatePct(aurEff->GetAmount(), GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()))); - } + // 6.x dmg formula in tooltip + // void HandleHit(SpellEffIndex /*effIndex*/) + // { + // if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffect(SPELL_WARLOCK_IMMOLATE, EFFECT_2, GetCaster()->GetGUID())) + // SetHitDamage(CalculatePct(aurEff->GetAmount(), GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()))); + // } void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_warl_conflagrate_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + //OnEffectHitTarget += SpellEffectFn(spell_warl_conflagrate_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); } }; @@ -563,43 +564,6 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; -// 77799 - Fel Flame - Updated to 4.3.4 -class spell_warl_fel_flame : public SpellScriptLoader -{ - public: - spell_warl_fel_flame() : SpellScriptLoader("spell_warl_fel_flame") { } - - class spell_warl_fel_flame_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warl_fel_flame_SpellScript); - - void OnHitTarget(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - Unit* target = GetHitUnit(); - Aura* aura = target->GetAura(SPELL_WARLOCK_UNSTABLE_AFFLICTION, caster->GetGUID()); - if (!aura) - aura = target->GetAura(SPELL_WARLOCK_IMMOLATE, caster->GetGUID()); - - if (!aura) - return; - - int32 newDuration = aura->GetDuration() + GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 1000; - aura->SetDuration(std::min(newDuration, aura->GetMaxDuration())); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_warl_fel_flame_SpellScript::OnHitTarget, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_warl_fel_flame_SpellScript; - } -}; - // -47230 - Fel Synergy class spell_warl_fel_synergy : public SpellScriptLoader { @@ -868,7 +832,8 @@ class spell_warl_improved_soul_fire : public SpellScriptLoader // 1454 - Life Tap /// Updated 4.3.4 -class spell_warl_life_tap : public SpellScriptLoader +// 6.x fully changed this +/*class spell_warl_life_tap : public SpellScriptLoader { public: spell_warl_life_tap() : SpellScriptLoader("spell_warl_life_tap") { } @@ -882,7 +847,7 @@ class spell_warl_life_tap : public SpellScriptLoader return GetCaster()->GetTypeId() == TYPEID_PLAYER; } - bool Validate(SpellInfo const* /*spellInfo*/) override + bool Validate(SpellInfo const* spellInfo) override { if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2)) @@ -890,7 +855,7 @@ class spell_warl_life_tap : public SpellScriptLoader return true; } - void HandleDummy(SpellEffIndex /*effIndex*/) + void HandleDummy(SpellEffIndex effIndex) { Player* caster = GetCaster()->ToPlayer(); if (Unit* target = GetHitUnit()) @@ -935,7 +900,7 @@ class spell_warl_life_tap : public SpellScriptLoader { return new spell_warl_life_tap_SpellScript(); } -}; +};*/ // 687 - Demon Armor // 28176 - Fel Armor @@ -1249,7 +1214,9 @@ class spell_warl_soul_swap_dot_marker : public SpellScriptLoader if (!warlock || !swapVictim) return; - flag128 classMask = GetSpellInfo()->Effects[effIndex].SpellClassMask; + // effect existance checked in dbc, should not be removed by core at any time, so no need to check for null + SpellEffectInfo const* effect = GetSpellInfo()->GetEffect(DIFFICULTY_NONE, EFFECT_0); + flag128 classMask = effect->SpellClassMask; Unit::AuraApplicationMap const& appliedAuras = swapVictim->GetAppliedAuras(); SoulSwapOverrideAuraScript* swapSpellScript = NULL; @@ -1452,14 +1419,14 @@ void AddSC_warlock_spell_scripts() new spell_warl_demonic_empowerment(); new spell_warl_demon_soul(); new spell_warl_everlasting_affliction(); - new spell_warl_fel_flame(); + //new spell_warl_fel_flame(); new spell_warl_fel_synergy(); new spell_warl_glyph_of_shadowflame(); new spell_warl_haunt(); new spell_warl_health_funnel(); new spell_warl_healthstone_heal(); new spell_warl_improved_soul_fire(); - new spell_warl_life_tap(); + //new spell_warl_life_tap(); new spell_warl_nether_ward_overrride(); new spell_warl_seduction(); new spell_warl_seed_of_corruption(); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 3b6b68d3fce..c4699f6b60c 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -120,34 +120,6 @@ class spell_warr_bloodthirst : public SpellScriptLoader }; /// Updated 4.3.4 -class spell_warr_bloodthirst_heal : public SpellScriptLoader -{ - public: - spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { } - - class spell_warr_bloodthirst_heal_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript); - - void HandleHeal(SpellEffIndex /*effIndex*/) - { - if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_BLOODTHIRST_DAMAGE)) - SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())) / 100); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_warr_bloodthirst_heal_SpellScript(); - } -}; - -/// Updated 4.3.4 class spell_warr_charge : public SpellScriptLoader { public: @@ -216,59 +188,6 @@ class spell_warr_concussion_blow : public SpellScriptLoader } }; -// -12162 - Deep Wounds -class spell_warr_deep_wounds : public SpellScriptLoader -{ - public: - spell_warr_deep_wounds() : SpellScriptLoader("spell_warr_deep_wounds") { } - - class spell_warr_deep_wounds_SpellScript : public SpellScript - { - PrepareSpellScript(spell_warr_deep_wounds_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_1) || - !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_2) || - !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_3) || - !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - int32 damage = GetEffectValue(); - Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) - { - ApplyPct(damage, 16 * GetSpellInfo()->GetRank()); - - SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC); - uint32 ticks = uint32(spellInfo->GetDuration()) / spellInfo->Effects[EFFECT_0].ApplyAuraPeriod; - - // Add remaining ticks to damage done - if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, EFFECT_0, caster->GetGUID())) - damage += aurEff->GetDamage() * int32(ticks - aurEff->GetTickNumber()); - - damage /= int32(ticks); - - caster->CastCustomSpell(target, SPELL_WARRIOR_DEEP_WOUNDS_PERIODIC, &damage, NULL, NULL, true); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_warr_deep_wounds_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_warr_deep_wounds_SpellScript(); - } -}; - /// Updated 4.3.4 class spell_warr_execute : public SpellScriptLoader { @@ -281,7 +200,7 @@ class spell_warr_execute : public SpellScriptLoader void HandleEffect(SpellEffIndex /*effIndex*/) { - Unit* caster = GetCaster(); + /*Unit* caster = GetCaster(); if (GetHitUnit()) { SpellInfo const* spellInfo = GetSpellInfo(); @@ -302,7 +221,7 @@ class spell_warr_execute : public SpellScriptLoader /// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage" int32 moreDamage = int32(rageUsed * (caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f * GetEffectValue() / 100.0f - 1) / 200); SetHitDamage(baseDamage + moreDamage); - } + }*/ } void Register() override @@ -317,42 +236,6 @@ class spell_warr_execute : public SpellScriptLoader } }; -// 58387 - Glyph of Sunder Armor -class spell_warr_glyph_of_sunder_armor : public SpellScriptLoader -{ - public: - spell_warr_glyph_of_sunder_armor() : SpellScriptLoader("spell_warr_glyph_of_sunder_armor") { } - - class spell_warr_glyph_of_sunder_armor_AuraScript : public AuraScript - { - PrepareAuraScript(spell_warr_glyph_of_sunder_armor_AuraScript); - - void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) - { - if (!spellMod) - { - spellMod = new SpellModifier(aurEff->GetBase()); - spellMod->op = SpellModOp(aurEff->GetMiscValue()); - spellMod->type = SPELLMOD_FLAT; - spellMod->spellId = GetId(); - spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; - } - - spellMod->value = aurEff->GetAmount(); - } - - void Register() override - { - DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_warr_glyph_of_sunder_armor_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_warr_glyph_of_sunder_armor_AuraScript(); - } -}; - // 59725 - Improved Spell Reflection class spell_warr_improved_spell_reflection : public SpellScriptLoader { @@ -991,11 +874,11 @@ class spell_warr_vigilance : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { - PreventDefaultAction(); + /*PreventDefaultAction(); int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue())); GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_VIGILANCE_PROC, true, NULL, aurEff); - _procTarget->CastCustomSpell(_procTarget, SPELL_WARRIOR_VENGEANCE, &damage, &damage, &damage, true, NULL, aurEff); + _procTarget->CastCustomSpell(_procTarget, SPELL_WARRIOR_VENGEANCE, &damage, &damage, &damage, true, NULL, aurEff);*/ } void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) @@ -1058,12 +941,9 @@ class spell_warr_vigilance_trigger : public SpellScriptLoader void AddSC_warrior_spell_scripts() { new spell_warr_bloodthirst(); - new spell_warr_bloodthirst_heal(); new spell_warr_charge(); new spell_warr_concussion_blow(); - new spell_warr_deep_wounds(); new spell_warr_execute(); - new spell_warr_glyph_of_sunder_armor(); new spell_warr_improved_spell_reflection(); new spell_warr_intimidating_shout(); new spell_warr_lambs_to_the_slaughter(); diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 17c37c7eba0..3e89041a9e9 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -234,9 +234,12 @@ bool EquippedOk(Player* player, uint32 spellId) if (!spell) return false; - for (uint8 i = 0; i < 3; ++i) + for (SpellEffectInfo const* effect : spell->GetEffectsForDifficulty(DIFFICULTY_NONE)) { - uint32 reqSpell = spell->Effects[i].TriggerSpell; + if (!effect) + continue; + + uint32 reqSpell = effect->TriggerSpell; if (!reqSpell) continue; diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 57c0ddf066e..34699c19648 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2159,8 +2159,8 @@ public: const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId); - if (spellInfo && spellInfo->Effects[0].Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD) - return spellInfo->Effects[0].MiscValue; + if (spellInfo && spellInfo->GetEffect(EFFECT_0)->Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD) + return spellInfo->GetEffect(EFFECT_0)->MiscValue; return 0; } |