Update spell_effects.cpp (#1877)

updated
This commit is contained in:
KayenEQ 2021-12-12 13:22:43 -05:00 committed by GitHub
parent 8de410ebb7
commit 91c958ae63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1622,16 +1622,23 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Model Size: %d%%", effect_value);
#endif
// Only allow 2 size changes from Base Size
float modifyAmount = (static_cast<float>(effect_value) / 100.0f);
float maxModAmount = GetBaseSize() * modifyAmount * modifyAmount;
if ((GetSize() <= GetBaseSize() && GetSize() > maxModAmount) ||
(GetSize() >= GetBaseSize() && GetSize() < maxModAmount) ||
(GetSize() <= GetBaseSize() && maxModAmount > 1.0f) ||
(GetSize() >= GetBaseSize() && maxModAmount < 1.0f))
{
ChangeSize(GetSize() * modifyAmount);
if (effect_value && effect_value != 100) {
// Only allow 2 size changes from Base Size
float modifyAmount = (static_cast<float>(effect_value) / 100.0f);
float maxModAmount = GetBaseSize() * modifyAmount * modifyAmount;
if ((GetSize() <= GetBaseSize() && GetSize() > maxModAmount) ||
(GetSize() >= GetBaseSize() && GetSize() < maxModAmount) ||
(GetSize() <= GetBaseSize() && maxModAmount > 1.0f) ||
(GetSize() >= GetBaseSize() && maxModAmount < 1.0f))
{
ChangeSize(GetSize() * modifyAmount);
}
}
//Only applies to SPA 89, max value also likely does something, but unknown.
else if (effect == SE_ModelSize && spells[spell_id].limit_value[i]) {
ChangeSize(spells[spell_id].limit_value[i]);
}
break;
}