diff --git a/changelog.txt b/changelog.txt index e8511f6b6..5cd454b9f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 10/08/2013 == +demonstar55: Added IsBuffSpell(spell_id) that will return true if the spell has a duration, so would end up in effects/song/discs etc windows on the client +demonstar55: Replaced instances of using CalcBuffDuration to determine if a spell was a buff with IsBuffSpell +demonstar55: Removed Mob::HasBuffIcon since it was doing what IsBuffSpell does in a more convoluted way with a rather misleading name +demonstar55: Fixed issues that arose from the 10/03/2013 change + == 10/05/2013 == Sorvani: fixed issue with stackable items being created with 0 charges cause by fix to SummonItems diff --git a/common/spdat.cpp b/common/spdat.cpp index 4cf4ab1a6..7f413dfe1 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -987,6 +987,13 @@ bool IsSelfConversionSpell(uint16 spell_id) { return false; } +// returns true for both detrimental and beneficial buffs +bool IsBuffSpell(uint16 spell_id) { + if(IsValidSpell(spell_id) && (spells[spell_id].buffduration || spells[spell_id].buffdurationformula)) + return true; + return false; +} + uint32 GetMorphTrigger(uint32 spell_id) { for(int i = 0; i < EFFECT_COUNT; ++i) diff --git a/common/spdat.h b/common/spdat.h index 5d317f693..df2e9b558 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -792,6 +792,7 @@ bool IsGroupHealOverTimeSpell(uint16 spell_id); bool IsDebuffSpell(uint16 spell_id); bool IsResistDebuffSpell(uint16 spell_id); bool IsSelfConversionSpell(uint16 spell_id); +bool IsBuffSpell(uint16 spell_id); uint32 GetMorphTrigger(uint32 spell_id); uint32 GetPartialMeleeRuneReduction(uint32 spell_id); uint32 GetPartialMagicRuneReduction(uint32 spell_id); diff --git a/zone/bot.cpp b/zone/bot.cpp index 83ccc0979..5512903e0 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9329,7 +9329,7 @@ int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) { || botclass == PALADIN || botclass == BEASTLORD )) cast_reducer += (GetLevel()-50)*3; - if((casttime >= 4000) && BeneficialSpell(spell_id) && ((CalcBuffDuration(this,this,spell_id)-1) > 0)) { + if((casttime >= 4000) && BeneficialSpell(spell_id) && IsBuffSpell(spell_id)) { switch (GetAA(aaSpellCastingDeftness)) { case 1: cast_reducer += 5; diff --git a/zone/mob.cpp b/zone/mob.cpp index 2b978eb03..501271e2a 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -3033,15 +3033,6 @@ void Mob::SetDeltas(float dx, float dy, float dz, float dh) { delta_heading = static_cast(dh); } - -bool Mob::HasBuffIcon(Mob *caster, Mob *target, uint16 spell_id) -{ - if((caster->CalcBuffDuration(caster, target, spell_id)-1) > 0) - return true; - else - return false; -} - void Mob::SetEntityVariable(const char *id, const char *m_var) { std::string n_m_var = m_var; diff --git a/zone/mob.h b/zone/mob.h index 8404c3804..dfcae9d2a 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -241,7 +241,6 @@ public: int16 GetBuffSlotFromType(uint16 type); uint16 GetSpellIDFromSlot(uint8 slot); int CountDispellableBuffs(); - bool HasBuffIcon(Mob* caster, Mob* target, uint16 spell_id); bool CheckHitsRemaining(uint32 buff_slot, bool when_spell_done=false, bool negate=false,uint16 type=0, uint16 spell_id=0, bool use_skill=false,uint16 skill=0); void SpreadVirus(uint16 spell_id, uint16 casterID); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 435795d0c..b43046649 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -82,7 +82,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if(c_override) { int durat = CalcBuffDuration(caster, this, spell_id, caster_level); - if((durat-1) > 0) + if(durat > 0) { buffslot = AddBuff(caster, spell_id, durat, caster_level); if(buffslot == -1) // stacking failure @@ -95,7 +95,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { - if((CalcBuffDuration(caster,this,spell_id)-1) > 0){ + if(IsBuffSpell(spell_id)){ if(IsEffectInSpell(spell_id, SE_BindSight)) { if(caster) diff --git a/zone/spells.cpp b/zone/spells.cpp index f40f96912..5be8a19f0 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2257,7 +2257,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { { if(IsClient()) { - if(HasBuffIcon(caster, this, spell_id) == false) + if(!IsBuffSpell(spell_id)) { CastToClient()->SetKnockBackExemption(true); @@ -3497,7 +3497,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spelltar->IsClient()) { - if(HasBuffIcon(this, spelltar, spell_id) == false) + if(!IsBuffSpell(spell_id)) { spelltar->CastToClient()->SetKnockBackExemption(true);