diff options
| author | Shauren <shauren.trinity@gmail.com> | 2014-12-19 23:52:29 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2014-12-19 23:52:29 +0100 |
| commit | 9f0051c4e5d8de7e216bf3e55b759583e52ff681 (patch) | |
| tree | 84637e4c21c37c1713bae5cf8a471313ecfa5ec1 /src/server/game/Spells/SpellEffects.cpp | |
| parent | ff0c11e25d31f6f881cbc00432620ec4d6891320 (diff) | |
Core/Spells: Implemented using dbc spellpower/ap coeffiecients for spells
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 349 |
1 files changed, 173 insertions, 176 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 21930500d9a..e3d2b9d3d1f 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -346,7 +346,7 @@ void Spell::EffectResurrectNew(SpellEffIndex effIndex) return; uint32 health = damage; - uint32 mana = GetEffect(effIndex)->MiscValue; + uint32 mana = effectInfo->MiscValue; ExecuteLogEffectResurrect(effIndex, target); target->SetResurrectRequestData(m_caster, health, mana, 0); SendResurrectRequest(target); @@ -563,9 +563,9 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex) if (m_originalCaster && apply_direct_bonus) { - uint32 bonus = m_originalCaster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + uint32 bonus = m_originalCaster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE, effectInfo); damage = bonus + uint32(bonus * variance); - damage = unitTarget->SpellDamageBonusTaken(m_originalCaster, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_originalCaster, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE, effectInfo); } m_damage += damage; @@ -641,16 +641,16 @@ void Spell::EffectDummy(SpellEffIndex effIndex) sScriptMgr->OnDummyEffect(m_caster, m_spellInfo->Id, effIndex, itemTarget); } -void Spell::EffectTriggerSpell(SpellEffIndex effIndex) +void Spell::EffectTriggerSpell(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET && effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH) return; - uint32 triggered_spell_id = GetEffect(effIndex)->TriggerSpell; + uint32 triggered_spell_id = effectInfo->TriggerSpell; /// @todo move those to spell scripts - if (GetEffect(effIndex)->Effect == SPELL_EFFECT_TRIGGER_SPELL + if (effectInfo->Effect == SPELL_EFFECT_TRIGGER_SPELL && effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET) { // special cases @@ -753,7 +753,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) } else //if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH) { - if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, m_caster->GetMap()->GetDifficulty()) && (GetEffect(effIndex)->GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) + if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, m_caster->GetMap()->GetDifficulty()) && (effectInfo->GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) return; if (spellInfo->GetExplicitTargetMask() & TARGET_FLAG_DEST_LOCATION) @@ -767,7 +767,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) CustomSpellValues values; // set basepoints for trigger with value effect - if (GetEffect(effIndex)->Effect == SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE) + if (effectInfo->Effect == SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE) { values.AddSpellMod(SPELLVALUE_BASE_POINT0, damage); values.AddSpellMod(SPELLVALUE_BASE_POINT1, damage); @@ -783,13 +783,13 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, NULL, NULL, m_originalCasterGUID); } -void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) +void Spell::EffectTriggerMissileSpell(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET && effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - uint32 triggered_spell_id = GetEffect(effIndex)->TriggerSpell; + uint32 triggered_spell_id = effectInfo->TriggerSpell; // normal case SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); @@ -808,7 +808,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) } else //if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT) { - if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, m_caster->GetMap()->GetDifficulty()) && (GetEffect(effIndex)->GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) + if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, m_caster->GetMap()->GetDifficulty()) && (effectInfo->GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) return; if (spellInfo->GetExplicitTargetMask() & TARGET_FLAG_DEST_LOCATION) @@ -819,7 +819,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) CustomSpellValues values; // set basepoints for trigger with value effect - if (GetEffect(effIndex)->Effect == SPELL_EFFECT_TRIGGER_MISSILE_SPELL_WITH_VALUE) + if (effectInfo->Effect == SPELL_EFFECT_TRIGGER_MISSILE_SPELL_WITH_VALUE) { // maybe need to set value only when basepoints == 0? values.AddSpellMod(SPELLVALUE_BASE_POINT0, damage); @@ -836,7 +836,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) m_caster->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK, NULL, NULL, m_originalCasterGUID); } -void Spell::EffectForceCast(SpellEffIndex effIndex) +void Spell::EffectForceCast(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -844,7 +844,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) if (!unitTarget) return; - uint32 triggered_spell_id = GetEffect(effIndex)->TriggerSpell; + uint32 triggered_spell_id = effectInfo->TriggerSpell; // normal case SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); @@ -855,7 +855,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) return; } - if (GetEffect(effIndex)->Effect == SPELL_EFFECT_FORCE_CAST && damage) + if (effectInfo->Effect == SPELL_EFFECT_FORCE_CAST && damage) { switch (m_spellInfo->Id) { @@ -879,7 +879,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) CustomSpellValues values; // set basepoints for trigger with value effect - if (GetEffect(effIndex)->Effect == SPELL_EFFECT_FORCE_CAST_WITH_VALUE) + if (effectInfo->Effect == SPELL_EFFECT_FORCE_CAST_WITH_VALUE) { // maybe need to set value only when basepoints == 0? values.AddSpellMod(SPELLVALUE_BASE_POINT0, damage); @@ -893,12 +893,12 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) unitTarget->CastSpell(targets, spellInfo, &values, TRIGGERED_FULL_MASK); } -void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex) +void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - uint32 triggered_spell_id = GetEffect(effIndex)->TriggerSpell; + uint32 triggered_spell_id = effectInfo->TriggerSpell; SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) @@ -953,8 +953,7 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex) void Spell::CalculateJumpSpeeds(uint8 i, float dist, float & speedXY, float & speedZ) { - SpellEffectInfo const* effect = GetEffect(i); - if (effect) + if (SpellEffectInfo const* effect = GetEffect(i)) { if (effect->MiscValue) speedZ = float(effect->MiscValue) / 10; @@ -1120,7 +1119,7 @@ void Spell::EffectApplyAreaAura(SpellEffIndex effIndex) m_spellAura->_ApplyEffectForTargets(effIndex); } -void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex) +void Spell::EffectUnlearnSpecialization(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -1129,7 +1128,7 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex) return; Player* player = unitTarget->ToPlayer(); - uint32 spellToUnlearn = GetEffect(effIndex)->TriggerSpell; + uint32 spellToUnlearn = effectInfo->TriggerSpell; player->RemoveSpell(spellToUnlearn); @@ -1141,18 +1140,18 @@ void Spell::EffectPowerDrain(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (GetEffect(effIndex)->MiscValue < 0 || GetEffect(effIndex)->MiscValue >= int8(MAX_POWERS)) + if (effectInfo->MiscValue < 0 || effectInfo->MiscValue >= int8(MAX_POWERS)) return; - Powers powerType = Powers(GetEffect(effIndex)->MiscValue); + Powers powerType = Powers(effectInfo->MiscValue); if (!unitTarget || !unitTarget->IsAlive() || unitTarget->getPowerType() != powerType || damage < 0) return; // add spell damage bonus - uint32 bonus = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + uint32 bonus = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE, effectInfo); damage = bonus + uint32(bonus * variance); - damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE, effectInfo); int32 newDamage = -(unitTarget->ModifyPower(powerType, -damage)); @@ -1161,7 +1160,7 @@ void Spell::EffectPowerDrain(SpellEffIndex effIndex) // Don't restore from self drain if (m_caster != unitTarget) { - gainMultiplier = GetEffect(effIndex)->CalcValueMultiplier(m_originalCaster, this); + gainMultiplier = effectInfo->CalcValueMultiplier(m_originalCaster, this); int32 gain = int32(newDamage* gainMultiplier); @@ -1170,7 +1169,7 @@ void Spell::EffectPowerDrain(SpellEffIndex effIndex) ExecuteLogEffectTakeTargetPower(effIndex, unitTarget, powerType, newDamage, gainMultiplier); } -void Spell::EffectSendEvent(SpellEffIndex effIndex) +void Spell::EffectSendEvent(SpellEffIndex /*effIndex*/) { // we do not handle a flag dropping or clicking on flag in battleground by sendevent system if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET @@ -1193,7 +1192,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex) // this check was requested by scripters, but it has some downsides: // now it's impossible to script (using sEventScripts) a cast which misses all targets // or to have an ability to script the moment spell hits dest (in a case when there are object targets present) - if (GetEffect(effIndex)->GetProvidedTargetMask() & (TARGET_FLAG_UNIT_MASK | TARGET_FLAG_GAMEOBJECT_MASK)) + if (effectInfo->GetProvidedTargetMask() & (TARGET_FLAG_UNIT_MASK | TARGET_FLAG_GAMEOBJECT_MASK)) return; // some spells have no target entries in dbc and they use focus target if (focusObject) @@ -1201,14 +1200,14 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex) /// @todo there should be a possibility to pass dest target to event script } - TC_LOG_DEBUG("spells", "Spell ScriptStart %u for spellid %u in EffectSendEvent ", GetEffect(effIndex)->MiscValue, m_spellInfo->Id); + TC_LOG_DEBUG("spells", "Spell ScriptStart %u for spellid %u in EffectSendEvent ", effectInfo->MiscValue, m_spellInfo->Id); if (ZoneScript* zoneScript = m_caster->GetZoneScript()) - zoneScript->ProcessEvent(target, GetEffect(effIndex)->MiscValue); + zoneScript->ProcessEvent(target, effectInfo->MiscValue); else if (InstanceScript* instanceScript = m_caster->GetInstanceScript()) // needed in case Player is the caster - instanceScript->ProcessEvent(target, GetEffect(effIndex)->MiscValue); + instanceScript->ProcessEvent(target, effectInfo->MiscValue); - m_caster->GetMap()->ScriptsStart(sEventScripts, GetEffect(effIndex)->MiscValue, m_caster, target); + m_caster->GetMap()->ScriptsStart(sEventScripts, effectInfo->MiscValue, m_caster, target); } void Spell::EffectPowerBurn(SpellEffIndex effIndex) @@ -1216,10 +1215,10 @@ void Spell::EffectPowerBurn(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - if (GetEffect(effIndex)->MiscValue < 0 || GetEffect(effIndex)->MiscValue >= int8(MAX_POWERS)) + if (effectInfo->MiscValue < 0 || effectInfo->MiscValue >= int8(MAX_POWERS)) return; - Powers powerType = Powers(GetEffect(effIndex)->MiscValue); + Powers powerType = Powers(effectInfo->MiscValue); if (!unitTarget || !unitTarget->IsAlive() || unitTarget->getPowerType() != powerType || damage < 0) return; @@ -1235,7 +1234,7 @@ void Spell::EffectPowerBurn(SpellEffIndex effIndex) int32 newDamage = -(unitTarget->ModifyPower(powerType, -damage)); // NO - Not a typo - EffectPowerBurn uses effect value multiplier - not effect damage multiplier - float dmgMultiplier = GetEffect(effIndex)->CalcValueMultiplier(m_originalCaster, this); + float dmgMultiplier = effectInfo->CalcValueMultiplier(m_originalCaster, this); // add log data before multiplication (need power amount, not damage) ExecuteLogEffectTakeTargetPower(effIndex, unitTarget, powerType, newDamage, 0.0f); @@ -1305,7 +1304,7 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) int32 tickheal = targetAura->GetAmount(); if (Unit* auraCaster = targetAura->GetCaster()) - tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT); + tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT, effectInfo); //int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1; //It is said that talent bonus should not be included @@ -1328,15 +1327,15 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/) } // Death Pact - return pct of max health to caster else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00080000) - addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL); + addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, int32(caster->CountPctFromMaxHealth(damage)), HEAL, effectInfo); else { - addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); - uint32 bonus = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL); + addhealth = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL, effectInfo); + uint32 bonus = caster->SpellHealingBonusDone(unitTarget, m_spellInfo, addhealth, HEAL, effectInfo); damage = bonus + uint32(bonus * variance); } - addhealth = unitTarget->SpellHealingBonusTaken(caster, m_spellInfo, addhealth, HEAL); + addhealth = unitTarget->SpellHealingBonusTaken(caster, m_spellInfo, addhealth, HEAL, effectInfo); // Remove Grievious bite if fully healed if (unitTarget->HasAura(48920) && (unitTarget->GetHealth() + addhealth >= unitTarget->GetMaxHealth())) @@ -1358,8 +1357,8 @@ void Spell::EffectHealPct(SpellEffIndex /*effIndex*/) if (!m_originalCaster) return; - uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, unitTarget->CountPctFromMaxHealth(damage), HEAL); - heal = unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); + uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, unitTarget->CountPctFromMaxHealth(damage), HEAL, effectInfo); + heal = unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL, effectInfo); m_healing += heal; } @@ -1376,13 +1375,13 @@ void Spell::EffectHealMechanical(SpellEffIndex /*effIndex*/) if (!m_originalCaster) return; - uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, uint32(damage), HEAL); + uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, uint32(damage), HEAL, effectInfo); heal += uint32(heal * variance); - m_healing += unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); + m_healing += unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL, effectInfo); } -void Spell::EffectHealthLeech(SpellEffIndex effIndex) +void Spell::EffectHealthLeech(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -1390,13 +1389,13 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (!unitTarget || !unitTarget->IsAlive() || damage < 0) return; - uint32 bonus = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE); + uint32 bonus = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, (uint32)damage, SPELL_DIRECT_DAMAGE, effectInfo); damage = bonus + uint32(bonus * variance); - damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); + damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE, effectInfo); TC_LOG_DEBUG("spells", "HealthLeech :%i", damage); - float healMultiplier = GetEffect(effIndex)->CalcValueMultiplier(m_originalCaster, this); + float healMultiplier = effectInfo->CalcValueMultiplier(m_originalCaster, this); m_damage += damage; // get max possible damage, don't count overkill for heal @@ -1404,8 +1403,8 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (m_caster->IsAlive()) { - healthGain = m_caster->SpellHealingBonusDone(m_caster, m_spellInfo, healthGain, HEAL); - healthGain = m_caster->SpellHealingBonusTaken(m_caster, m_spellInfo, healthGain, HEAL); + healthGain = m_caster->SpellHealingBonusDone(m_caster, m_spellInfo, healthGain, HEAL, effectInfo); + healthGain = m_caster->SpellHealingBonusTaken(m_caster, m_spellInfo, healthGain, HEAL, effectInfo); m_caster->HealBySpell(m_caster, m_spellInfo, uint32(healthGain)); } @@ -1531,8 +1530,8 @@ void Spell::EffectCreateItem(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - DoCreateItem(effIndex, GetEffect(effIndex)->ItemType); - ExecuteLogEffectCreateItem(effIndex, GetEffect(effIndex)->ItemType); + DoCreateItem(effIndex, effectInfo->ItemType); + ExecuteLogEffectCreateItem(effIndex, effectInfo->ItemType); } void Spell::EffectCreateItem2(SpellEffIndex effIndex) @@ -1545,7 +1544,7 @@ void Spell::EffectCreateItem2(SpellEffIndex effIndex) Player* player = unitTarget->ToPlayer(); - uint32 item_id = GetEffect(effIndex)->ItemType; + uint32 item_id = effectInfo->ItemType; if (item_id) DoCreateItem(effIndex, item_id); @@ -1593,7 +1592,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex) if (!m_spellAura) { Unit* caster = m_caster->GetEntry() == WORLD_TRIGGER ? m_originalCaster : m_caster; - float radius = GetEffect(effIndex)->CalcRadius(caster); + float radius = effectInfo->CalcRadius(caster); // Caster not in world, might be spell triggered from aura removal if (!caster->IsInWorld()) @@ -1618,7 +1617,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex) m_spellAura->_ApplyEffectForTargets(effIndex); } -void Spell::EffectEnergize(SpellEffIndex effIndex) +void Spell::EffectEnergize(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -1628,10 +1627,10 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) if (!unitTarget->IsAlive()) return; - if (GetEffect(effIndex)->MiscValue < 0 || GetEffect(effIndex)->MiscValue >= int8(MAX_POWERS)) + if (effectInfo->MiscValue < 0 || effectInfo->MiscValue >= int8(MAX_POWERS)) return; - Powers power = Powers(GetEffect(effIndex)->MiscValue); + Powers power = Powers(effectInfo->MiscValue); if (unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->getPowerType() != power && !(m_spellInfo->AttributesEx7 & SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER)) return; @@ -1727,7 +1726,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) } } -void Spell::EffectEnergizePct(SpellEffIndex effIndex) +void Spell::EffectEnergizePct(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -1737,10 +1736,10 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex) if (!unitTarget->IsAlive()) return; - if (GetEffect(effIndex)->MiscValue < 0 || GetEffect(effIndex)->MiscValue >= int8(MAX_POWERS)) + if (effectInfo->MiscValue < 0 || effectInfo->MiscValue >= int8(MAX_POWERS)) return; - Powers power = Powers(GetEffect(effIndex)->MiscValue); + Powers power = Powers(effectInfo->MiscValue); if (unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->getPowerType() != power && !(m_spellInfo->AttributesEx7 & SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER)) return; @@ -1927,7 +1926,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) ExecuteLogEffectOpenLock(effIndex, gameObjTarget ? (Object*)gameObjTarget : (Object*)itemTarget); } -void Spell::EffectSummonChangeItem(SpellEffIndex effIndex) +void Spell::EffectSummonChangeItem(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; @@ -1945,7 +1944,7 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex) if (m_CastItem->GetOwnerGUID() != player->GetGUID()) return; - uint32 newitemid = GetEffect(effIndex)->ItemType; + uint32 newitemid = effectInfo->ItemType; if (!newitemid) return; @@ -2062,14 +2061,14 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - uint32 entry = GetEffect(effIndex)->MiscValue; + uint32 entry = effectInfo->MiscValue; if (!entry) return; - SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(GetEffect(effIndex)->MiscValueB); + SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(effectInfo->MiscValueB); if (!properties) { - TC_LOG_ERROR("spells", "EffectSummonType: Unhandled summon type %u", GetEffect(effIndex)->MiscValueB); + TC_LOG_ERROR("spells", "EffectSummonType: Unhandled summon type %u", effectInfo->MiscValueB); return; } @@ -2170,7 +2169,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) } default: { - float radius = GetEffect(effIndex)->CalcRadius(); + float radius = effectInfo->CalcRadius(); TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN; @@ -2215,7 +2214,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) // The spell that this effect will trigger. It has SPELL_AURA_CONTROL_VEHICLE uint32 spellId = VEHICLE_SPELL_RIDE_HARDCODED; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(GetEffect(effIndex)->CalcValue()); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(effectInfo->CalcValue()); if (spellInfo && spellInfo->HasAura(m_originalCaster->GetMap()->GetDifficulty(), SPELL_AURA_CONTROL_VEHICLE)) spellId = spellInfo->Id; @@ -2254,13 +2253,13 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex) Player* player = unitTarget->ToPlayer(); - uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : GetEffect(effIndex)->TriggerSpell; + uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : effectInfo->TriggerSpell; player->LearnSpell(spellToLearn, false); TC_LOG_DEBUG("spells", "Spell: %s has learned spell %u from %s", player->GetGUID().ToString().c_str(), spellToLearn, m_caster->GetGUID().ToString().c_str()); } -void Spell::EffectDispel(SpellEffIndex effIndex) +void Spell::EffectDispel(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -2269,7 +2268,7 @@ void Spell::EffectDispel(SpellEffIndex effIndex) return; // Create dispel mask by dispel type - uint32 dispel_type = GetEffect(effIndex)->MiscValue; + uint32 dispel_type = effectInfo->MiscValue; uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(dispel_type)); DispelChargesList dispel_list; @@ -2419,7 +2418,7 @@ void Spell::EffectPickPocket(SpellEffIndex /*effIndex*/) m_caster->ToPlayer()->SendLoot(unitTarget->GetGUID(), LOOT_PICKPOCKETING); } -void Spell::EffectAddFarsight(SpellEffIndex effIndex) +void Spell::EffectAddFarsight(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; @@ -2427,7 +2426,7 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex) if (m_caster->GetTypeId() != TYPEID_PLAYER) return; - float radius = GetEffect(effIndex)->CalcRadius(); + float radius = effectInfo->CalcRadius(); int32 duration = m_spellInfo->GetDuration(); // Caster not in world, might be spell triggered from aura removal if (!m_caster->IsInWorld()) @@ -2455,7 +2454,7 @@ void Spell::EffectUntrainTalents(SpellEffIndex /*effIndex*/) unitTarget->ToPlayer()->SendTalentWipeConfirm(m_caster->GetGUID()); } -void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex effIndex) +void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -2466,7 +2465,7 @@ void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex effIndex) if (unitTarget->IsInFlight()) return; - float dis = GetEffect(effIndex)->CalcRadius(m_caster); + float dis = effectInfo->CalcRadius(m_caster); float fx, fy, fz; m_caster->GetClosePoint(fx, fy, fz, unitTarget->GetObjectSize(), dis); @@ -2474,7 +2473,7 @@ void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex effIndex) unitTarget->NearTeleportTo(fx, fy, fz, -m_caster->GetOrientation(), unitTarget == m_caster); } -void Spell::EffectLearnSkill(SpellEffIndex effIndex) +void Spell::EffectLearnSkill(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -2485,7 +2484,7 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) if (damage < 0) return; - uint32 skillid = GetEffect(effIndex)->MiscValue; + uint32 skillid = effectInfo->MiscValue; SkillRaceClassInfoEntry const* rcEntry = GetSkillRaceClassInfo(skillid, unitTarget->getRace(), unitTarget->getClass()); if (!rcEntry) return; @@ -2495,24 +2494,22 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) return; uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid); - unitTarget->ToPlayer()->SetSkill(skillid, GetEffect(effIndex)->CalcValue(), std::max<uint16>(skillval, 1), tier->Value[damage - 1]); + unitTarget->ToPlayer()->SetSkill(skillid, effectInfo->CalcValue(), std::max<uint16>(skillval, 1), tier->Value[damage - 1]); } -void Spell::EffectPlayMovie(SpellEffIndex effIndex) +void Spell::EffectPlayMovie(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; if (unitTarget->GetTypeId() != TYPEID_PLAYER) return; - if (SpellEffectInfo const* effect = GetEffect(effIndex)) - { - uint32 movieId = effect->MiscValue; - if (!sMovieStore.LookupEntry(movieId)) - return; - unitTarget->ToPlayer()->SendMovieStart(movieId); - } + uint32 movieId = effectInfo->MiscValue; + if (!sMovieStore.LookupEntry(movieId)) + return; + + unitTarget->ToPlayer()->SendMovieStart(movieId); } void Spell::EffectTradeSkill(SpellEffIndex /*effIndex*/) @@ -2547,7 +2544,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) player->DestroyItemCount(itemTarget, count, true); unitTarget = player; // and add a scroll - DoCreateItem(effIndex, GetEffect(effIndex)->ItemType); + DoCreateItem(effIndex, effectInfo->ItemType); itemTarget = NULL; m_targets.SetItemTarget(NULL); } @@ -2557,7 +2554,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) if (!(m_CastItem && m_CastItem->GetTemplate()->Flags[0] & ITEM_PROTO_FLAG_TRIGGERED_CAST)) player->UpdateCraftSkill(m_spellInfo->Id); - uint32 enchant_id = GetEffect(effIndex)->MiscValue; + uint32 enchant_id = effectInfo->MiscValue; if (!enchant_id) return; @@ -2591,7 +2588,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) } } -void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) +void Spell::EffectEnchantItemPrismatic(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -2603,7 +2600,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) if (!player) return; - uint32 enchantId = GetEffect(effIndex)->MiscValue; + uint32 enchantId = effectInfo->MiscValue; if (!enchantId) return; @@ -2667,7 +2664,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) if (!itemTarget) return; - uint32 enchant_id = GetEffect(effIndex)->MiscValue; + uint32 enchant_id = effectInfo->MiscValue; if (!enchant_id) { @@ -2802,7 +2799,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) owner = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself(); } - uint32 petentry = GetEffect(effIndex)->MiscValue; + uint32 petentry = effectInfo->MiscValue; if (!owner) { @@ -2888,7 +2885,7 @@ void Spell::EffectLearnPetSpell(SpellEffIndex effIndex) if (!pet) return; - SpellInfo const* learn_spellproto = sSpellMgr->GetSpellInfo(GetEffect(effIndex)->TriggerSpell); + SpellInfo const* learn_spellproto = sSpellMgr->GetSpellInfo(effectInfo->TriggerSpell); if (!learn_spellproto) return; @@ -2932,7 +2929,7 @@ void Spell::EffectTaunt(SpellEffIndex /*effIndex*/) unitTarget->ToCreature()->AI()->AttackStart(m_caster); } -void Spell::EffectWeaponDmg(SpellEffIndex effIndex) +void Spell::EffectWeaponDmg(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET) return; @@ -3206,7 +3203,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - uint32 gameobject_id = GetEffect(effIndex)->MiscValue; + uint32 gameobject_id = effectInfo->MiscValue; GameObject* pGameObj = new GameObject; @@ -3338,7 +3335,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) case 55693: // Remove Collapsing Cave Aura if (!unitTarget) return; - unitTarget->RemoveAurasDueToSpell(GetEffect(effIndex)->CalcValue()); + unitTarget->RemoveAurasDueToSpell(effectInfo->CalcValue()); break; // Bending Shinbone case 8856: @@ -3472,7 +3469,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) case 45151: { //Workaround for Range ... should be global for every ScriptEffect - float radius = GetEffect(effIndex)->CalcRadius(); + float radius = effectInfo->CalcRadius(); if (unitTarget && unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->GetDistance(m_caster) >= radius && !unitTarget->HasAura(46394) && unitTarget != m_caster) unitTarget->CastSpell(unitTarget, 46394, true); @@ -3584,7 +3581,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) return; float x, y, z; - float radius = GetEffect(effIndex)->CalcRadius(); + float radius = effectInfo->CalcRadius(); for (uint8 i = 0; i < 15; ++i) { m_caster->GetRandomPoint(*destTarget, radius, x, y, z); @@ -3874,7 +3871,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex) //CREATE DUEL FLAG OBJECT GameObject* pGameObj = new GameObject; - uint32 gameobject_id = GetEffect(effIndex)->MiscValue; + uint32 gameobject_id = effectInfo->MiscValue; Map* map = m_caster->GetMap(); if (!pGameObj->Create(sObjectMgr->GetGenerator<HighGuid::GameObject>()->Generate(), gameobject_id, @@ -3999,12 +3996,12 @@ void Spell::EffectActivateObject(SpellEffIndex /*effIndex*/) ScriptInfo activateCommand; activateCommand.command = SCRIPT_COMMAND_ACTIVATE_OBJECT; - // int32 unk = GetEffect(effIndex)->MiscValue; // This is set for EffectActivateObject spells; needs research + // int32 unk = effectInfo->MiscValue; // This is set for EffectActivateObject spells; needs research gameObjTarget->GetMap()->ScriptCommandStart(activateCommand, 0, m_caster, gameObjTarget); } -void Spell::EffectApplyGlyph(SpellEffIndex effIndex) +void Spell::EffectApplyGlyph(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; @@ -4038,7 +4035,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) } // apply new one - if (uint32 newGlyph = GetEffect(effIndex)->MiscValue) + if (uint32 newGlyph = effectInfo->MiscValue) { if (GlyphPropertiesEntry const* newGlyphProperties = sGlyphPropertiesStore.LookupEntry(newGlyph)) { @@ -4077,7 +4074,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) } } -void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex) +void Spell::EffectEnchantHeldItem(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4096,9 +4093,9 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex) if (!item->IsEquipped()) return; - if (GetEffect(effIndex)->MiscValue) + if (effectInfo->MiscValue) { - uint32 enchant_id = GetEffect(effIndex)->MiscValue; + uint32 enchant_id = effectInfo->MiscValue; int32 duration = m_spellInfo->GetDuration(); //Try duration index first .. if (!duration) duration = damage;//+1; //Base points after .. @@ -4192,7 +4189,7 @@ void Spell::EffectFeedPet(SpellEffIndex effIndex) player->DestroyItemCount(foodItem, count, true); /// @todo fix crash when a spell has two effects, both pointed at the same item target - m_caster->CastCustomSpell(pet, GetEffect(effIndex)->TriggerSpell, &benefit, NULL, NULL, true); + m_caster->CastCustomSpell(pet, effectInfo->TriggerSpell, &benefit, NULL, NULL, true); } void Spell::EffectDismissPet(SpellEffIndex effIndex) @@ -4214,8 +4211,8 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - uint32 go_id = GetEffect(effIndex)->MiscValue; - uint8 slot = GetEffect(effIndex)->Effect - SPELL_EFFECT_SUMMON_OBJECT_SLOT1; + uint32 go_id = effectInfo->MiscValue; + uint8 slot = effectInfo->Effect - SPELL_EFFECT_SUMMON_OBJECT_SLOT1; ObjectGuid guid = m_caster->m_ObjectSlot[slot]; if (!guid.IsEmpty()) { @@ -4338,7 +4335,7 @@ void Spell::EffectLeap(SpellEffIndex /*effIndex*/) unitTarget->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), unitTarget == m_caster); } -void Spell::EffectReputation(SpellEffIndex effIndex) +void Spell::EffectReputation(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4350,7 +4347,7 @@ void Spell::EffectReputation(SpellEffIndex effIndex) int32 repChange = damage; - uint32 factionId = GetEffect(effIndex)->MiscValue; + uint32 factionId = effectInfo->MiscValue; FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId); if (!factionEntry) @@ -4361,7 +4358,7 @@ void Spell::EffectReputation(SpellEffIndex effIndex) player->GetReputationMgr().ModifyReputation(factionEntry, repChange); } -void Spell::EffectQuestComplete(SpellEffIndex effIndex) +void Spell::EffectQuestComplete(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4370,7 +4367,7 @@ void Spell::EffectQuestComplete(SpellEffIndex effIndex) return; Player* player = unitTarget->ToPlayer(); - uint32 questId = GetEffect(effIndex)->MiscValue; + uint32 questId = effectInfo->MiscValue; if (questId) { Quest const* quest = sObjectMgr->GetQuestTemplate(questId); @@ -4395,7 +4392,7 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/) m_caster->SendMessageToSet(&data, true); } -void Spell::EffectSelfResurrect(SpellEffIndex effIndex) +void Spell::EffectSelfResurrect(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; @@ -4414,7 +4411,7 @@ void Spell::EffectSelfResurrect(SpellEffIndex effIndex) if (damage < 0) { health = uint32(-damage); - mana = GetEffect(effIndex)->MiscValue; + mana = effectInfo->MiscValue; } // percent case else @@ -4506,7 +4503,7 @@ void Spell::EffectChargeDest(SpellEffIndex /*effIndex*/) } } -void Spell::EffectKnockBack(SpellEffIndex effIndex) +void Spell::EffectKnockBack(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4527,13 +4524,13 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex) unitTarget->InterruptNonMeleeSpells(true); float ratio = 0.1f; - float speedxy = float(GetEffect(effIndex)->MiscValue) * ratio; + float speedxy = float(effectInfo->MiscValue) * ratio; float speedz = float(damage) * ratio; if (speedxy < 0.1f && speedz < 0.1f) return; float x, y; - if (GetEffect(effIndex)->Effect == SPELL_EFFECT_KNOCK_BACK_DEST) + if (effectInfo->Effect == SPELL_EFFECT_KNOCK_BACK_DEST) { if (m_targets.HasDst()) destTarget->GetPosition(x, y); @@ -4548,7 +4545,7 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex) unitTarget->KnockbackFrom(x, y, speedxy, speedz); } -void Spell::EffectLeapBack(SpellEffIndex effIndex) +void Spell::EffectLeapBack(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_LAUNCH_TARGET) return; @@ -4556,13 +4553,13 @@ void Spell::EffectLeapBack(SpellEffIndex effIndex) if (!unitTarget) return; - float speedxy = float(GetEffect(effIndex)->MiscValue)/10; - float speedz = float(damage/10); + float speedxy = float(effectInfo->MiscValue) / 10; + float speedz = float(damage / 10); //1891: Disengage m_caster->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891); } -void Spell::EffectQuestClear(SpellEffIndex effIndex) +void Spell::EffectQuestClear(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4571,7 +4568,7 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex) return; Player* player = unitTarget->ToPlayer(); - uint32 quest_id = GetEffect(effIndex)->MiscValue; + uint32 quest_id = effectInfo->MiscValue; Quest const* quest = sObjectMgr->GetQuestTemplate(quest_id); @@ -4605,7 +4602,7 @@ void Spell::EffectQuestClear(SpellEffIndex effIndex) player->RemoveRewardedQuest(quest_id); } -void Spell::EffectSendTaxi(SpellEffIndex effIndex) +void Spell::EffectSendTaxi(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4613,10 +4610,10 @@ void Spell::EffectSendTaxi(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - unitTarget->ToPlayer()->ActivateTaxiPathTo(GetEffect(effIndex)->MiscValue, m_spellInfo->Id); + unitTarget->ToPlayer()->ActivateTaxiPathTo(effectInfo->MiscValue, m_spellInfo->Id); } -void Spell::EffectPullTowards(SpellEffIndex effIndex) +void Spell::EffectPullTowards(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4625,7 +4622,7 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex) return; Position pos; - if (GetEffect(effIndex)->Effect == SPELL_EFFECT_PULL_TOWARDS_DEST) + if (effectInfo->Effect == SPELL_EFFECT_PULL_TOWARDS_DEST) { if (m_targets.HasDst()) pos.Relocate(*destTarget); @@ -4637,13 +4634,13 @@ void Spell::EffectPullTowards(SpellEffIndex effIndex) pos.Relocate(m_caster); } - float speedXY = float(GetEffect(effIndex)->MiscValue) * 0.1f; + float speedXY = float(effectInfo->MiscValue) * 0.1f; float speedZ = unitTarget->GetDistance(pos) / speedXY * 0.5f * Movement::gravity; unitTarget->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ); } -void Spell::EffectDispelMechanic(SpellEffIndex effIndex) +void Spell::EffectDispelMechanic(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4651,7 +4648,7 @@ void Spell::EffectDispelMechanic(SpellEffIndex effIndex) if (!unitTarget) return; - uint32 mechanic = GetEffect(effIndex)->MiscValue; + uint32 mechanic = effectInfo->MiscValue; DispelList dispel_list; Unit::AuraMap const& auras = unitTarget->GetOwnedAuras(); for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) @@ -4770,7 +4767,7 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - int32 slot = GetEffect(effIndex)->MiscValue; + int32 slot = effectInfo->MiscValue; // -1 means all player equipped items and -2 all items if (slot < 0) @@ -4791,7 +4788,7 @@ void Spell::EffectDurabilityDamage(SpellEffIndex effIndex) } } -void Spell::EffectDurabilityDamagePCT(SpellEffIndex effIndex) +void Spell::EffectDurabilityDamagePCT(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4799,7 +4796,7 @@ void Spell::EffectDurabilityDamagePCT(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - int32 slot = GetEffect(effIndex)->MiscValue; + int32 slot = effectInfo->MiscValue; // FIXME: some spells effects have value -1/-2 // Possibly its mean -1 all player equipped items and -2 all items @@ -4836,7 +4833,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - uint32 name_id = GetEffect(effIndex)->MiscValue; + uint32 name_id = effectInfo->MiscValue; GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id); @@ -4851,9 +4848,9 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) if (m_targets.HasDst()) destTarget->GetPosition(fx, fy, fz); //FIXME: this can be better check for most objects but still hack - else if (GetEffect(effIndex)->HasRadius() && m_spellInfo->Speed == 0) + else if (effectInfo->HasRadius() && m_spellInfo->Speed == 0) { - float dis = GetEffect(effIndex)->CalcRadius(m_originalCaster); + float dis = effectInfo->CalcRadius(m_originalCaster); m_caster->GetClosePoint(fx, fy, fz, DEFAULT_WORLD_OBJECT_SIZE, dis); } else @@ -5062,7 +5059,7 @@ void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/) target->RemovedInsignia(player); } -void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) +void Spell::EffectStealBeneficialBuff(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5075,7 +5072,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) DispelChargesList steal_list; // Create dispel mask by dispel type - uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(GetEffect(effIndex)->MiscValue)); + uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(effectInfo->MiscValue)); Unit::AuraMap const& auras = unitTarget->GetOwnedAuras(); for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) { @@ -5167,7 +5164,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) m_caster->SendMessageToSet(&dataSuccess, true); } -void Spell::EffectKillCreditPersonal(SpellEffIndex effIndex) +void Spell::EffectKillCreditPersonal(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5175,10 +5172,10 @@ void Spell::EffectKillCreditPersonal(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - unitTarget->ToPlayer()->KilledMonsterCredit(GetEffect(effIndex)->MiscValue); + unitTarget->ToPlayer()->KilledMonsterCredit(effectInfo->MiscValue); } -void Spell::EffectKillCredit(SpellEffIndex effIndex) +void Spell::EffectKillCredit(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5186,7 +5183,7 @@ void Spell::EffectKillCredit(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - int32 creatureEntry = GetEffect(effIndex)->MiscValue; + int32 creatureEntry = effectInfo->MiscValue; if (!creatureEntry) { if (m_spellInfo->Id == 42793) // Burn Body @@ -5197,7 +5194,7 @@ void Spell::EffectKillCredit(SpellEffIndex effIndex) unitTarget->ToPlayer()->RewardPlayerAndGroupAtEvent(creatureEntry, unitTarget); } -void Spell::EffectQuestFail(SpellEffIndex effIndex) +void Spell::EffectQuestFail(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5205,10 +5202,10 @@ void Spell::EffectQuestFail(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - unitTarget->ToPlayer()->FailQuest(GetEffect(effIndex)->MiscValue); + unitTarget->ToPlayer()->FailQuest(effectInfo->MiscValue); } -void Spell::EffectQuestStart(SpellEffIndex effIndex) +void Spell::EffectQuestStart(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5220,7 +5217,7 @@ void Spell::EffectQuestStart(SpellEffIndex effIndex) if (!player) return; - if (Quest const* quest = sObjectMgr->GetQuestTemplate(GetEffect(effIndex)->MiscValue)) + if (Quest const* quest = sObjectMgr->GetQuestTemplate(effectInfo->MiscValue)) { if (!player->CanTakeQuest(quest, false)) return; @@ -5252,10 +5249,10 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) if (count == 0) count = 1; for (uint32 j = 0; j < MAX_RUNES && count > 0; ++j) { - if (player->GetRuneCooldown(j) && player->GetCurrentRune(j) == RuneType(GetEffect(effIndex)->MiscValue)) + if (player->GetRuneCooldown(j) && player->GetCurrentRune(j) == RuneType(effectInfo->MiscValue)) { if (m_spellInfo->Id == 45529) - if (player->GetBaseRune(j) != RuneType(GetEffect(effIndex)->MiscValueB)) + if (player->GetBaseRune(j) != RuneType(effectInfo->MiscValueB)) continue; player->SetRuneCooldown(j, 0); --count; @@ -5268,7 +5265,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) for (uint32 l = 0; l + 1 < MAX_RUNES && count > 0; ++l) { // Check if both runes are on cd as that is the only time when this needs to come into effect - if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RuneType(GetEffect(effIndex)->MiscValueB)) && (player->GetRuneCooldown(l+1) && player->GetCurrentRune(l+1) == RuneType(GetEffect(effIndex)->MiscValueB))) + if ((player->GetRuneCooldown(l) && player->GetCurrentRune(l) == RuneType(effectInfo->MiscValueB)) && (player->GetRuneCooldown(l + 1) && player->GetCurrentRune(l + 1) == RuneType(effectInfo->MiscValueB))) { // Should always update the rune with the lowest cd if (l + 1 < MAX_RUNES && player->GetRuneCooldown(l) >= player->GetRuneCooldown(l+1)) @@ -5298,7 +5295,7 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex) } } -void Spell::EffectCreateTamedPet(SpellEffIndex effIndex) +void Spell::EffectCreateTamedPet(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5306,7 +5303,7 @@ void Spell::EffectCreateTamedPet(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || !unitTarget->GetPetGUID().IsEmpty() || unitTarget->getClass() != CLASS_HUNTER) return; - uint32 creatureEntry = GetEffect(effIndex)->MiscValue; + uint32 creatureEntry = effectInfo->MiscValue; Pet* pet = unitTarget->CreateTamedPetFrom(creatureEntry, m_spellInfo->Id); if (!pet) return; @@ -5331,14 +5328,14 @@ void Spell::EffectCreateTamedPet(SpellEffIndex effIndex) } } -void Spell::EffectDiscoverTaxi(SpellEffIndex effIndex) +void Spell::EffectDiscoverTaxi(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - uint32 nodeid = GetEffect(effIndex)->MiscValue; + uint32 nodeid = effectInfo->MiscValue; if (sTaxiNodesStore.LookupEntry(nodeid)) unitTarget->ToPlayer()->GetSession()->SendDiscoverNewTaxiNode(nodeid); } @@ -5391,7 +5388,7 @@ void Spell::EffectGameObjectRepair(SpellEffIndex /*effIndex*/) gameObjTarget->ModifyHealth(damage, m_caster); } -void Spell::EffectGameObjectSetDestructionState(SpellEffIndex effIndex) +void Spell::EffectGameObjectSetDestructionState(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5400,7 +5397,7 @@ void Spell::EffectGameObjectSetDestructionState(SpellEffIndex effIndex) return; Player* player = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself(); - gameObjTarget->SetDestructibleState(GameObjectDestructibleState(GetEffect(effIndex)->MiscValue), player, true); + gameObjTarget->SetDestructibleState(GameObjectDestructibleState(effectInfo->MiscValue), player, true); } void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* properties, uint32 numGuardians) @@ -5482,7 +5479,7 @@ void Spell::EffectRenamePet(SpellEffIndex /*effIndex*/) unitTarget->SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED); } -void Spell::EffectPlayMusic(SpellEffIndex effIndex) +void Spell::EffectPlayMusic(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5490,7 +5487,7 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - uint32 soundid = GetEffect(effIndex)->MiscValue; + uint32 soundid = effectInfo->MiscValue; if (!sSoundEntriesStore.LookupEntry(soundid)) { @@ -5526,7 +5523,7 @@ void Spell::EffectActivateSpec(SpellEffIndex /*effIndex*/) unitTarget->ToPlayer()->ActivateTalentGroup(damage-1); // damage is 1 or 2, spec is 0 or 1 } -void Spell::EffectPlaySound(SpellEffIndex effIndex) +void Spell::EffectPlaySound(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5547,7 +5544,7 @@ void Spell::EffectPlaySound(SpellEffIndex effIndex) break; } - uint32 soundId = GetEffect(effIndex)->MiscValue; + uint32 soundId = effectInfo->MiscValue; if (!sSoundEntriesStore.LookupEntry(soundId)) { @@ -5558,7 +5555,7 @@ void Spell::EffectPlaySound(SpellEffIndex effIndex) player->PlayDirectSound(soundId, player); } -void Spell::EffectRemoveAura(SpellEffIndex effIndex) +void Spell::EffectRemoveAura(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5566,7 +5563,7 @@ void Spell::EffectRemoveAura(SpellEffIndex effIndex) if (!unitTarget) return; // there may be need of specifying casterguid of removed auras - unitTarget->RemoveAurasDueToSpell(GetEffect(effIndex)->TriggerSpell); + unitTarget->RemoveAurasDueToSpell(effectInfo->TriggerSpell); } void Spell::EffectDamageFromMaxHealthPCT(SpellEffIndex /*effIndex*/) @@ -5580,7 +5577,7 @@ void Spell::EffectDamageFromMaxHealthPCT(SpellEffIndex /*effIndex*/) m_damage += unitTarget->CountPctFromMaxHealth(damage); } -void Spell::EffectGiveCurrency(SpellEffIndex effIndex) +void Spell::EffectGiveCurrency(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5588,10 +5585,10 @@ void Spell::EffectGiveCurrency(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - unitTarget->ToPlayer()->ModifyCurrency(GetEffect(effIndex)->MiscValue, damage); + unitTarget->ToPlayer()->ModifyCurrency(effectInfo->MiscValue, damage); } -void Spell::EffectCastButtons(SpellEffIndex effIndex) +void Spell::EffectCastButtons(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; @@ -5600,8 +5597,8 @@ void Spell::EffectCastButtons(SpellEffIndex effIndex) return; Player* p_caster = m_caster->ToPlayer(); - uint32 button_id = GetEffect(effIndex)->MiscValue + 132; - uint32 n_buttons = GetEffect(effIndex)->MiscValueB; + uint32 button_id = effectInfo->MiscValue + 132; + uint32 n_buttons = effectInfo->MiscValueB; for (; n_buttons; --n_buttons, ++button_id) { @@ -5666,7 +5663,7 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/) } } -void Spell::EffectBind(SpellEffIndex effIndex) +void Spell::EffectBind(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5679,8 +5676,8 @@ void Spell::EffectBind(SpellEffIndex effIndex) WorldLocation homeLoc; uint32 areaId = player->GetAreaId(); - if (GetEffect(effIndex)->MiscValue) - areaId = GetEffect(effIndex)->MiscValue; + if (effectInfo->MiscValue) + areaId = effectInfo->MiscValue; if (m_targets.HasDst()) homeLoc.WorldRelocate(*destTarget); @@ -5700,7 +5697,7 @@ void Spell::EffectBind(SpellEffIndex effIndex) player->SendDirectMessage(&data); } -void Spell::EffectSummonRaFFriend(SpellEffIndex effIndex) +void Spell::EffectSummonRaFFriend(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -5708,10 +5705,10 @@ void Spell::EffectSummonRaFFriend(SpellEffIndex effIndex) if (m_caster->GetTypeId() != TYPEID_PLAYER || !unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - m_caster->CastSpell(unitTarget, GetEffect(effIndex)->TriggerSpell, true); + m_caster->CastSpell(unitTarget, effectInfo->TriggerSpell, true); } -void Spell::EffectUnlockGuildVaultTab(SpellEffIndex effIndex) +void Spell::EffectUnlockGuildVaultTab(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; @@ -5719,7 +5716,7 @@ void Spell::EffectUnlockGuildVaultTab(SpellEffIndex effIndex) // Safety checks done in Spell::CheckCast Player* caster = m_caster->ToPlayer(); if (Guild* guild = caster->GetGuild()) - guild->HandleBuyBankTab(caster->GetSession(), GetEffect(effIndex)->BasePoints - 1); // Bank tabs start at zero internally + guild->HandleBuyBankTab(caster->GetSession(), effectInfo->BasePoints - 1); // Bank tabs start at zero internally } void Spell::EffectResurrectWithAura(SpellEffIndex effIndex) @@ -5743,8 +5740,8 @@ void Spell::EffectResurrectWithAura(SpellEffIndex effIndex) uint32 health = target->CountPctFromMaxHealth(damage); uint32 mana = CalculatePct(target->GetMaxPower(POWER_MANA), damage); uint32 resurrectAura = 0; - if (sSpellMgr->GetSpellInfo(GetEffect(effIndex)->TriggerSpell)) - resurrectAura = GetEffect(effIndex)->TriggerSpell; + if (sSpellMgr->GetSpellInfo(effectInfo->TriggerSpell)) + resurrectAura = effectInfo->TriggerSpell; if (resurrectAura && target->HasAura(resurrectAura)) return; @@ -5754,7 +5751,7 @@ void Spell::EffectResurrectWithAura(SpellEffIndex effIndex) SendResurrectRequest(target); } -void Spell::EffectCreateAreaTrigger(SpellEffIndex effIndex) +void Spell::EffectCreateAreaTrigger(SpellEffIndex /*effIndex*/) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; @@ -5766,7 +5763,7 @@ void Spell::EffectCreateAreaTrigger(SpellEffIndex effIndex) pos = destTarget->GetPosition(); // trigger entry/miscvalue relation is currently unknown, for now use MiscValue as trigger entry - uint32 triggerEntry = GetEffect(effIndex)->MiscValue; + uint32 triggerEntry = effectInfo->MiscValue; AreaTrigger * areaTrigger = new AreaTrigger; if (!areaTrigger->CreateAreaTrigger(sObjectMgr->GetGenerator<HighGuid::AreaTrigger>()->Generate(), triggerEntry, GetCaster(), GetSpellInfo(), pos)) |
