From c214c3a95b9ebca3980dc8c35f807af750a97e39 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Tue, 22 Jun 2021 12:08:04 -0400 Subject: [PATCH] [Bug Fix] spell cast time cap issue introduced in e5b9d72b81 (#1435) Me bad coder. --- zone/bot.cpp | 3 ++- zone/mob.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index e3abb5935..757d77b9a 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -6793,6 +6793,7 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) { int32 cast_reducer = GetBotFocusEffect(focusSpellHaste, spell_id); + auto min_cap = casttime / 2; uint8 botlevel = GetLevel(); uint8 botclass = GetClass(); if (botlevel >= 51 && casttime >= 3000 && !spells[spell_id].goodEffect && @@ -6870,7 +6871,7 @@ int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) { } casttime = casttime * (100 - cast_reducer) / 100; - return std::max(casttime, casttime / 2); + return std::max(casttime, min_cap); } int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) { diff --git a/zone/mob.cpp b/zone/mob.cpp index 4b945fd23..ab77f27c1 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -3124,6 +3124,7 @@ uint32 Mob::GetLevelHP(uint8 tlevel) int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) { int32 cast_reducer = GetFocusEffect(focusSpellHaste, spell_id); + auto min_cap = casttime / 2; if (level > 50 && casttime >= 3000 && !spells[spell_id].goodEffect && (GetClass() == RANGER || GetClass() == SHADOWKNIGHT || GetClass() == PALADIN || GetClass() == BEASTLORD)) { @@ -3132,7 +3133,7 @@ int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) } casttime = casttime * (100 - cast_reducer) / 100; - return std::max(casttime, casttime / 2); + return std::max(casttime, min_cap); } void Mob::ExecWeaponProc(const EQ::ItemInstance *inst, uint16 spell_id, Mob *on, int level_override) {