diff options
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 54 | 
1 files changed, 27 insertions, 27 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e7d78a0ec57..a9fa7bfee03 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -429,7 +429,7 @@ void Spell::EffectEnvironmentalDMG(SpellEffIndex /*effIndex*/)          DamageInfo damageInfo(m_caster, unitTarget, damage, m_spellInfo, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, BASE_ATTACK);          m_caster->CalcAbsorbResist(damageInfo); -        SpellNonMeleeDamage log(m_caster, unitTarget, m_spellInfo->Id, m_SpellVisual, m_spellInfo->GetSchoolMask(), m_castId); +        SpellNonMeleeDamage log(m_caster, unitTarget, m_spellInfo, m_SpellVisual, m_spellInfo->GetSchoolMask(), m_castId);          log.damage = damageInfo.GetDamage();          log.originalDamage = damage;          log.absorb = damageInfo.GetAbsorb(); @@ -658,7 +658,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex /*effIndex*/)              case 29284:              {                  // Brittle Armor -                SpellInfo const* spell = sSpellMgr->GetSpellInfo(24575); +                SpellInfo const* spell = sSpellMgr->GetSpellInfo(24575, GetCastDifficulty());                  if (!spell)                      return; @@ -670,7 +670,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex /*effIndex*/)              case 29286:              {                  // Mercurial Shield -                SpellInfo const* spell = sSpellMgr->GetSpellInfo(26464); +                SpellInfo const* spell = sSpellMgr->GetSpellInfo(26464, GetCastDifficulty());                  if (!spell)                      return; @@ -703,7 +703,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex /*effIndex*/)      }      // normal case -    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); +    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id, GetCastDifficulty());      if (!spellInfo)      {          TC_LOG_ERROR("spells.effecttriggerspell", "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); @@ -713,13 +713,13 @@ void Spell::EffectTriggerSpell(SpellEffIndex /*effIndex*/)      SpellCastTargets targets;      if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH_TARGET)      { -        if (!spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, m_caster->GetMap()->GetDifficultyID())) +        if (!spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo))              return;          targets.SetUnitTarget(unitTarget);      }      else //if (effectHandleMode == SPELL_EFFECT_HANDLE_LAUNCH)      { -        if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, m_caster->GetMap()->GetDifficultyID()) && (effectInfo->GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) +        if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) && (effectInfo->GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK))              return;          if (spellInfo->GetExplicitTargetMask() & TARGET_FLAG_DEST_LOCATION) @@ -753,7 +753,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex /*effIndex*/)      uint32 triggered_spell_id = effectInfo->TriggerSpell;      // normal case -    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); +    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id, GetCastDifficulty());      if (!spellInfo)      {          TC_LOG_ERROR("spells.effecttrigermissilespell", "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u.", m_spellInfo->Id, triggered_spell_id); @@ -763,13 +763,13 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex /*effIndex*/)      SpellCastTargets targets;      if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT_TARGET)      { -        if (!spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, m_caster->GetMap()->GetDifficultyID())) +        if (!spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo))              return;          targets.SetUnitTarget(unitTarget);      }      else //if (effectHandleMode == SPELL_EFFECT_HANDLE_HIT)      { -        if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, m_caster->GetMap()->GetDifficultyID()) && (effectInfo->GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK)) +        if (spellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) && (effectInfo->GetProvidedTargetMask() & TARGET_FLAG_UNIT_MASK))              return;          if (spellInfo->GetExplicitTargetMask() & TARGET_FLAG_DEST_LOCATION) @@ -803,7 +803,7 @@ void Spell::EffectForceCast(SpellEffIndex /*effIndex*/)      uint32 triggered_spell_id = effectInfo->TriggerSpell;      // normal case -    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); +    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id, GetCastDifficulty());      if (!spellInfo)      { @@ -855,7 +855,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex /*effIndex*/)          return;      uint32 triggered_spell_id = effectInfo->TriggerSpell; -    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); +    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id, GetCastDifficulty());      if (!spellInfo)      { @@ -1504,7 +1504,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex)              return;          } -        if (Aura* aura = Aura::TryCreate(m_spellInfo, m_castId, MAX_EFFECT_MASK, dynObj, caster, &m_spellValue->EffectBasePoints[0], nullptr, ObjectGuid::Empty, ObjectGuid::Empty, m_castItemEntry, m_castItemLevel)) +        if (Aura* aura = Aura::TryCreate(m_spellInfo, m_castId, MAX_EFFECT_MASK, dynObj, caster, GetCastDifficulty(), &m_spellValue->EffectBasePoints[0], nullptr, ObjectGuid::Empty, ObjectGuid::Empty, m_castItemEntry, m_castItemLevel))          {              m_spellAura = aura;              m_spellAura->_RegisterForTargets(); @@ -2051,8 +2051,8 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)              int32 basePoints = effectInfo->CalcValue();              if (basePoints > MAX_VEHICLE_SEATS)              { -                SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(basePoints); -                if (spellInfo && spellInfo->HasAura(m_originalCaster->GetMap()->GetDifficultyID(), SPELL_AURA_CONTROL_VEHICLE)) +                SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(basePoints, GetCastDifficulty()); +                if (spellInfo && spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE))                      spellId = spellInfo->Id;              } @@ -2711,7 +2711,7 @@ void Spell::EffectLearnPetSpell(SpellEffIndex effIndex)      if (!pet)          return; -    SpellInfo const* learn_spellproto = sSpellMgr->GetSpellInfo(effectInfo->TriggerSpell); +    SpellInfo const* learn_spellproto = sSpellMgr->GetSpellInfo(effectInfo->TriggerSpell, DIFFICULTY_NONE);      if (!learn_spellproto)          return; @@ -2767,7 +2767,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)      // and handle all effects at once      for (uint8 index = effIndex + 1; index < MAX_SPELL_EFFECTS; ++index)      { -        SpellEffectInfo const* effect = GetEffect(index); +        SpellEffectInfo const* effect = m_spellInfo->GetEffect(index);          if (!effect)              continue;          switch (effect->Effect) @@ -2852,7 +2852,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)              // Blood Strike              if (m_spellInfo->SpellFamilyFlags[0] & 0x400000)              { -                if (SpellEffectInfo const* effect = GetEffect(EFFECT_2)) +                if (SpellEffectInfo const* effect = m_spellInfo->GetEffect(EFFECT_2))                  {                      float bonusPct = effect->CalcValue(m_caster) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f;                      // Death Knight T8 Melee 4P Bonus @@ -2868,7 +2868,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)      bool normalized = false;      float weaponDamagePercentMod = 1.0f; -    for (SpellEffectInfo const* effect : GetEffects()) +    for (SpellEffectInfo const* effect : m_spellInfo->GetEffects())      {          if (!effect)              continue; @@ -2914,7 +2914,7 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)      int32 weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, addPctMods);      // Sequence is important -    for (SpellEffectInfo const* effect : GetEffects()) +    for (SpellEffectInfo const* effect : m_spellInfo->GetEffects())      {          if (!effect)              continue; @@ -3344,8 +3344,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)                          return;                      // Effects for 58418 and 58420 are all DIFFICULTY_NONE so always valid -                    uint32 spellID = GetEffect(EFFECT_0)->CalcValue(); -                    uint32 questID = GetEffect(EFFECT_1)->CalcValue(); +                    uint32 spellID = m_spellInfo->GetEffect(EFFECT_0)->CalcValue(); +                    uint32 questID = m_spellInfo->GetEffect(EFFECT_1)->CalcValue();                      if (unitTarget->ToPlayer()->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE)                          unitTarget->CastSpell(unitTarget, spellID, true); @@ -3395,7 +3395,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)                              {                                  /// @todo a hack, range = 11, should after some time cast, otherwise too far                                  m_caster->CastSpell(parent, 62496, true); -                                unitTarget->CastSpell(parent, GetEffect(EFFECT_0)->CalcValue()); // DIFFICULTY_NONE, so effect always valid +                                unitTarget->CastSpell(parent, m_spellInfo->GetEffect(EFFECT_0)->CalcValue()); // DIFFICULTY_NONE, so effect always valid                              }                          }                      } @@ -3678,7 +3678,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)      player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation(), TELE_TO_SPELL);      // Stuck spell trigger Hearthstone cooldown -    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(8690); +    SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(8690, GetCastDifficulty());      if (!spellInfo)          return;      Spell spell(player, spellInfo, TRIGGERED_FULL_MASK); @@ -4528,7 +4528,7 @@ void Spell::EffectDestroyAllTotems(SpellEffIndex /*effIndex*/)          if (totem && totem->IsTotem())          {              uint32 spell_id = totem->m_unitData->CreatedBySpell; -            SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id); +            SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id, GetCastDifficulty());              if (spellInfo)              {                  std::vector<SpellPowerCost> costs = spellInfo->CalcPowerCost(m_caster, spellInfo->GetSchoolMask()); @@ -5363,7 +5363,7 @@ void Spell::EffectCastButtons(SpellEffIndex /*effIndex*/)          if (!spell_id)              continue; -        SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id); +        SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id, GetCastDifficulty());          if (!spellInfo)              continue; @@ -5374,7 +5374,7 @@ void Spell::EffectCastButtons(SpellEffIndex /*effIndex*/)              continue;          TriggerCastFlags triggerFlags = TriggerCastFlags(TRIGGERED_IGNORE_GCD | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_CAST_DIRECTLY | TRIGGERED_DONT_REPORT_CAST_ERROR); -        m_caster->CastSpell(m_caster, spell_id, triggerFlags); +        m_caster->CastSpell(m_caster, spellInfo, triggerFlags);      }  } @@ -5475,7 +5475,7 @@ void Spell::EffectResurrectWithAura(SpellEffIndex effIndex)      uint32 health = target->CountPctFromMaxHealth(damage);      uint32 mana   = CalculatePct(target->GetMaxPower(POWER_MANA), damage);      uint32 resurrectAura = 0; -    if (sSpellMgr->GetSpellInfo(effectInfo->TriggerSpell)) +    if (sSpellMgr->GetSpellInfo(effectInfo->TriggerSpell, DIFFICULTY_NONE))          resurrectAura = effectInfo->TriggerSpell;      if (resurrectAura && target->HasAura(resurrectAura))  | 
