diff --git a/zone/effects.cpp b/zone/effects.cpp index 2741a924b..6b0c2a2ad 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -611,6 +611,10 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { return false; } + // the client does this check before calling CastSpell, should prevent discs being eaten + if (spell.buffdurationformula != 0 && spell.targettype == ST_Self && HasDiscBuff()) + return false; + //Check the disc timer pTimerType DiscTimer = pTimerDisciplineReuseStart + spell.EndurTimerIndex; if(!p_timers.Expired(&database, DiscTimer, false)) { // lets not set the reuse timer in case CastSpell fails (or we would have to turn off the timer, but CastSpell will set it as well) diff --git a/zone/mob.h b/zone/mob.h index 0f0a49031..25e6492fb 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -352,6 +352,7 @@ public: virtual int GetMaxSongSlots() const { return 0; } virtual int GetMaxDiscSlots() const { return 0; } virtual int GetMaxTotalSlots() const { return 0; } + bool HasDiscBuff(); virtual uint32 GetFirstBuffSlot(bool disc, bool song); virtual uint32 GetLastBuffSlot(bool disc, bool song); virtual void InitializeBuffSlots() { buffs = nullptr; current_buff_count = 0; } diff --git a/zone/spells.cpp b/zone/spells.cpp index c5a5a0b48..25b0a7ce9 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3190,6 +3190,12 @@ uint32 Client::GetLastBuffSlot(bool disc, bool song) return GetCurrentBuffSlots(); } +bool Mob::HasDiscBuff() +{ + int slot = GetFirstBuffSlot(true, false); + return buffs[slot].spellid != SPELL_UNKNOWN; +} + // returns the slot the buff was added to, -1 if it wasn't added due to // stacking problems, and -2 if this is not a buff // if caster is null, the buff will be added with the caster level being