diff options
author | megamage <none@none> | 2008-11-28 15:12:23 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-11-28 15:12:23 -0600 |
commit | 6107faa8940e5ff08bc382a2ed02cdb09e822aa6 (patch) | |
tree | c8626bd1306dae2573b4d6b5985679b0d4fa4ed3 | |
parent | ed60b4da96e14404be33497b6fcb550e3391ad01 (diff) |
*Some update of aura stacking check.
--HG--
branch : trunk
-rw-r--r-- | src/game/SharedDefines.h | 2 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 34 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 2 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index af0fada8626..b165d8d1bdc 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -295,7 +295,7 @@ enum ItemQualities #define SPELL_ATTR_EX2_UNK28 0x10000000 // 28 #define SPELL_ATTR_EX2_CANT_CRIT 0x20000000 // 29 Spell can't crit #define SPELL_ATTR_EX2_UNK30 0x40000000 // 30 -#define SPELL_ATTR_EX2_UNK31 0x80000000 // 31 +#define SPELL_ATTR_EX2_FOOD 0x80000000 // 31 food, well-fed, and a few others #define SPELL_ATTR_EX3_UNK0 0x00000001 // 0 #define SPELL_ATTR_EX3_UNK1 0x00000002 // 1 diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 52ffec5e67f..fa0fbaa9e8a 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -137,12 +137,10 @@ SpellSpecific GetSpellSpecific(uint32 spellId) { case SPELLFAMILY_GENERIC: { - // needed to make some strange drinks unstackable (brewfest and normal drink) - if (spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_SITTING - && spellInfo->Attributes & SPELL_ATTR_CANT_USED_IN_COMBAT) - for(int i = 0; i < 3; i++) - if( spellInfo->EffectApplyAuraName[i]==) - return SPELL_DRINK; + // this may be a hack + if((spellInfo->AttributesEx2 & SPELL_ATTR_EX2_FOOD) + && !spellInfo->Category) + return SPELL_WELL_FED; break; } case SPELLFAMILY_MAGE: @@ -257,7 +255,6 @@ bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1,uint32 spellSpec2) case SPELL_POSITIVE_SHOUT: case SPELL_JUDGEMENT: case SPELL_WARLOCK_CORRUPTION: - case SPELL_DRINK: return spellSpec1==spellSpec2; default: return false; @@ -273,6 +270,7 @@ bool IsSingleFromSpellSpecificPerTarget(uint32 spellSpec1,uint32 spellSpec2) case SPELL_MAGE_ARMOR: case SPELL_ELEMENTAL_SHIELD: case SPELL_MAGE_POLYMORPH: + case SPELL_WELL_FED: return spellSpec1==spellSpec2; case SPELL_BATTLE_ELIXIR: return spellSpec2==SPELL_BATTLE_ELIXIR @@ -1168,8 +1166,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool if(!spellInfo_1->SpellFamilyName) { if(!spellInfo_1->SpellIconID - || (spellInfo_1->SpellIconID != spellInfo_2->SpellIconID - && spellInfo_1->SpellVisual != spellInfo_2->SpellVisual)) //needed for 44098 and 19709 to make it unstackable + || spellInfo_1->SpellIconID != spellInfo_2->SpellIconID) return false; } @@ -1187,11 +1184,12 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool return false; } - if( !sameCaster) + if(!sameCaster) + { for(uint32 i = 0; i < 3; ++i) - { - if (spellInfo_1->Effect[i] != SPELL_EFFECT_APPLY_AREA_AURA_PARTY) // not area auras (shaman totem) - // a better check may be effect == SPELL_EFFECT_APPLY_AURA + if (spellInfo_1->Effect[i] == SPELL_EFFECT_APPLY_AURA + || spellInfo_1->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA) + // not area auras (shaman totem) switch(spellInfo_1->EffectApplyAuraName[i]) { // DOT or HOT from different casters will stack @@ -1205,12 +1203,14 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool default: break; } - } + } + //not sure if this is correct. maybe some talent buff have same icons? + //maybe some creature spells have same visual and same icon but should stack? //spells with the same icon (check needed when spell has different effects in other ranks example:Mark of the wild) - if(spellInfo_1->SpellIconID - && spellInfo_1->SpellIconID == spellInfo_2->SpellIconID) - return true; // maybe change this to IsRankSpellDueToSpell? + //if(spellInfo_1->SpellIconID + // && spellInfo_1->SpellIconID == spellInfo_2->SpellIconID) + // return true; // maybe change this to IsRankSpellDueToSpell? //if spells have exactly the same effect they cannot stack for(uint32 i = 0; i < 3; ++i) diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 33cbaa0f358..53c70a6164f 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -264,7 +264,7 @@ enum SpellSpecific SPELL_GUARDIAN_ELIXIR = 15, SPELL_FLASK_ELIXIR = 16, SPELL_WARLOCK_CORRUPTION= 17, - SPELL_DRINK= 18 + SPELL_WELL_FED = 18, }; SpellSpecific GetSpellSpecific(uint32 spellId); |