diff --git a/zone/effects.cpp b/zone/effects.cpp index f2706cae1..dc069fb2a 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -626,10 +626,7 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return(false); } - if(GetEndurance() > spell.EndurCost) { - SetEndurance(GetEndurance() - spell.EndurCost); - TryTriggerOnValueAmount(false, false, true); - } else { + if(GetEndurance() < spell.EndurCost) { Message(11, "You are too fatigued to use this skill right now."); return(false); } diff --git a/zone/mob.h b/zone/mob.h index cb5948241..5032abcf6 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -425,6 +425,8 @@ public: virtual int32 CalcMaxHP(); inline int32 GetMaxMana() const { return max_mana; } inline int32 GetMana() const { return cur_mana; } + virtual int32 GetEndurance() const { return 0; } + virtual void SetEndurance(int32 newEnd) { return; } int32 GetItemHPBonuses(); int32 GetSpellHPBonuses(); virtual const int32& SetMana(int32 amount); diff --git a/zone/spells.cpp b/zone/spells.cpp index 6b4467dfe..86c489185 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -75,6 +75,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #include "../common/skills.h" #include "../common/spdat.h" #include "../common/string_util.h" +#include "../common/data_verification.h" #include "quest_parser_collection.h" #include "string_ids.h" @@ -2248,13 +2249,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 } } + bool mgb = HasMGB() && spells[spell_id].can_mgb; // if this was a spell slot or an ability use up the mana for it if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0) { mana_used = GetActSpellCost(spell_id, mana_used); - if (HasMGB() && spells[spell_id].can_mgb) { + if (mgb) { mana_used *= 2; - SetMGB(false); } // clamp if we some how got focused above our current mana if (GetMana() < mana_used) @@ -2265,6 +2266,16 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 TryTriggerOnValueAmount(false, true); } } + // one may want to check if this is a disc or not, but we actually don't, there are non disc stuff that have end cost + if (spells[spell_id].EndurCost) { + auto end_cost = spells[spell_id].EndurCost; + if (mgb) + end_cost *= 2; + SetEndurance(GetEndurance() - EQEmu::ClampUpper(end_cost, GetEndurance())); + TryTriggerOnValueAmount(false, false, true); + } + if (mgb) + SetMGB(false); //set our reuse timer on long ass reuse_time spells... if(IsClient() && !isproc)