[BugFix] Fix for bard song instrument mod formula from recent update (#1654)

* Update spell_effects.cpp

* Update spell_effects.cpp

* Update spell_effects.cpp
This commit is contained in:
KayenEQ 2021-10-30 08:50:15 -04:00 committed by GitHub
parent f9855fd097
commit 4389f84ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3329,14 +3329,14 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, uint32 instrument_mod, Mob *caster, int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, uint32 instrument_mod, Mob *caster,
int ticsremaining, uint16 caster_id) int ticsremaining, uint16 caster_id)
{ {
int formula, base, max, effect_value, oval;
if (!IsValidSpell(spell_id) || effect_id < 0 || effect_id >= EFFECT_COUNT) if (!IsValidSpell(spell_id) || effect_id < 0 || effect_id >= EFFECT_COUNT)
return 0; return 0;
formula = spells[spell_id].formula[effect_id]; int formula = spells[spell_id].formula[effect_id];
base = spells[spell_id].base[effect_id]; int base = spells[spell_id].base[effect_id];
max = spells[spell_id].max[effect_id]; int max = spells[spell_id].max[effect_id];
int effect_value = 0;
int oval = 0;
if (IsBlankSpellEffect(spell_id, effect_id)) if (IsBlankSpellEffect(spell_id, effect_id))
return 0; return 0;
@ -3345,11 +3345,10 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level,
// this doesn't actually need to be a song to get mods, just the right skill // this doesn't actually need to be a song to get mods, just the right skill
if (EQ::skills::IsBardInstrumentSkill(spells[spell_id].skill) if (EQ::skills::IsBardInstrumentSkill(spells[spell_id].skill)
&& IsInstrumentModAppliedToSpellEffect(spell_id, spells[spell_id].effectid[effect_id])){ && IsInstrumentModAppliedToSpellEffect(spell_id, spells[spell_id].effectid[effect_id])) {
oval = effect_value; oval = effect_value;
effect_value = effect_value * instrument_mod / 10; effect_value = effect_value * static_cast<int>(instrument_mod) / 10;
LogSpells("Effect value [{}] altered with bard modifier of [{}] to yeild [{}]", LogSpells("Effect value [{}] altered with bard modifier of [{}] to yeild [{}]",
oval, instrument_mod, effect_value); oval, instrument_mod, effect_value);
} }
@ -3370,7 +3369,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level,
if (caster_id && instrument_mod > 10) { if (caster_id && instrument_mod > 10) {
//This is checked from Mob::ApplySpellBonuses, applied to buffs that receive bonuses. See above, must be in 10% intervals to work. //This is checked from Mob::ApplySpellBonuses, applied to buffs that receive bonuses. See above, must be in 10% intervals to work.
oval = effect_value; oval = effect_value;
effect_value = effect_value * instrument_mod / 10; effect_value = effect_value * static_cast<int>(instrument_mod) / 10;
LogSpells("Bonus Effect value [{}] altered with base effects modifier of [{}] to yeild [{}]", LogSpells("Bonus Effect value [{}] altered with base effects modifier of [{}] to yeild [{}]",
oval, instrument_mod, effect_value); oval, instrument_mod, effect_value);