diff options
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 63 |
1 files changed, 3 insertions, 60 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 656bd37e3a7..f73fa7e6a1a 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -433,7 +433,7 @@ SpellEffectInfo::SpellEffectInfo(SpellInfo const* spellInfo, SpellEffectEntry co TriggerSpell = _effect.EffectTriggerSpell; SpellClassMask = _effect.EffectSpellClassMask; BonusCoefficientFromAP = _effect.BonusCoefficientFromAP; - Scaling.Class = _effect.ScalingClass; + Scaling.Class = 0; Scaling.Coefficient = _effect.Coefficient; Scaling.Variance = _effect.Variance; Scaling.ResourceCoefficient = _effect.ResourceCoefficient; @@ -587,7 +587,7 @@ int32 SpellEffectInfo::CalcBaseValue(WorldObject const* caster, Unit const* targ if (!randPropPoints) randPropPoints = sRandPropPointsStore.AssertEntry(sRandPropPointsStore.GetNumRows() - 1); - value = Scaling.Class == -8 ? randPropPoints->DamageReplaceStatF : randPropPoints->DamageSecondaryF; + value = randPropPoints->DamageReplaceStat; } else value = GetRandomPropertyPoints(effectiveItemLevel, ITEM_QUALITY_RARE, INVTYPE_CHEST, 0); @@ -615,27 +615,6 @@ int32 SpellEffectInfo::CalcBaseValue(WorldObject const* caster, Unit const* targ else { float value = BasePoints; - ExpectedStatType stat = GetScalingExpectedStat(); - if (stat != ExpectedStatType::None) - { - if (_spellInfo->HasAttribute(SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL)) - stat = ExpectedStatType::CreatureAutoAttackDps; - - // TODO - add expansion and content tuning id args? - uint32 contentTuningId = _spellInfo->ContentTuningId; // content tuning should be passed as arg, the one stored in SpellInfo is fallback - int32 expansion = -2; - if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(contentTuningId)) - expansion = contentTuning->ExpansionID; - - int32 level = 1; - if (target && _spellInfo->HasAttribute(SPELL_ATTR8_USE_TARGETS_LEVEL_FOR_SPELL_SCALING)) - level = target->GetLevel(); - else if (caster && caster->IsUnit()) - level = caster->ToUnit()->GetLevel(); - - value = sDB2Manager.EvaluateExpectedStat(stat, level, expansion, 0, CLASS_NONE, 0) * BasePoints / 100.0f; - } - return int32(round(value)); } } @@ -1238,10 +1217,6 @@ SpellInfo::SpellInfo(SpellNameEntry const* spellName, ::Difficulty difficulty, S TargetAuraSpell = _aura->TargetAuraSpell; ExcludeCasterAuraSpell = _aura->ExcludeCasterAuraSpell; ExcludeTargetAuraSpell = _aura->ExcludeTargetAuraSpell; - CasterAuraType = AuraType(_aura->CasterAuraType); - TargetAuraType = AuraType(_aura->TargetAuraType); - ExcludeCasterAuraType = AuraType(_aura->ExcludeCasterAuraType); - ExcludeTargetAuraType = AuraType(_aura->ExcludeTargetAuraType); } // SpellCastingRequirementsEntry @@ -1277,7 +1252,6 @@ SpellInfo::SpellInfo(SpellNameEntry const* spellName, ::Difficulty difficulty, S RecoveryTime = _cooldowns->RecoveryTime; CategoryRecoveryTime = _cooldowns->CategoryRecoveryTime; StartRecoveryTime = _cooldowns->StartRecoveryTime; - CooldownAuraSpellId = _cooldowns->AuraSpellID; } // SpellEquippedItemsEntry @@ -4082,34 +4056,6 @@ Optional<SpellPowerCost> SpellInfo::CalcPowerCost(SpellPowerEntry const* power, { powerCost = int32(power->OptionalCost); - if (power->OptionalCostPct) - { - switch (power->PowerType) - { - // health as power used - case POWER_HEALTH: - powerCost += int32(CalculatePct(unitCaster->GetMaxHealth(), power->OptionalCostPct)); - break; - case POWER_MANA: - powerCost += int32(CalculatePct(unitCaster->GetCreateMana(), power->OptionalCostPct)); - break; - case POWER_ALTERNATE_POWER: - TC_LOG_ERROR("spells", "SpellInfo::CalcPowerCost: Unsupported power type POWER_ALTERNATE_POWER in spell {} for optional cost percent", Id); - return {}; - default: - { - if (PowerTypeEntry const* powerTypeEntry = sDB2Manager.GetPowerTypeEntry(Powers(power->PowerType))) - { - powerCost += int32(CalculatePct(powerTypeEntry->MaxBasePower, power->OptionalCostPct)); - break; - } - - TC_LOG_ERROR("spells", "SpellInfo::CalcPowerCost: Unknown power type '{}' in spell {} for optional cost percent", power->PowerType, Id); - return {}; - } - } - } - powerCost += unitCaster->GetTotalAuraModifier(SPELL_AURA_MOD_ADDITIONAL_POWER_COST, [this, power](AuraEffect const* aurEff) -> bool { return aurEff->GetMiscValue() == power->PowerType @@ -4212,9 +4158,6 @@ Optional<SpellPowerCost> SpellInfo::CalcPowerCost(SpellPowerEntry const* power, } } - if (power->PowerType == POWER_MANA) - powerCost = float(powerCost) * (1.0f + unitCaster->m_unitData->ManaCostMultiplier); - // power cost cannot become negative if initially positive if (initiallyNegative != (powerCost < 0)) powerCost = 0; @@ -4296,7 +4239,7 @@ inline float CalcPPMCritMod(SpellProcsPerMinuteModEntry const* mod, Unit* caster float crit = player->m_activePlayerData->CritPercentage; float rangedCrit = player->m_activePlayerData->RangedCritPercentage; - float spellCrit = player->m_activePlayerData->SpellCritPercentage; + float spellCrit = player->m_activePlayerData->SpellCritPercentage[0]; switch (mod->Param) { |
