Changeset 279 for trunk/src/game/SpellMgr.cpp
- Timestamp:
- 11/22/08 00:36:22 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/SpellMgr.cpp
r272 r279 100 100 } 101 101 102 bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)102 /*bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2) 103 103 { 104 104 SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1); … … 114 114 115 115 return true; 116 } 116 }*/ 117 117 118 118 int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2) … … 245 245 case SPELL_CURSE: 246 246 case SPELL_ASPECT: 247 case SPELL_POSITIVE_SHOUT: 248 case SPELL_JUDGEMENT: 249 case SPELL_WARLOCK_CORRUPTION: 250 return spellSpec1==spellSpec2; 251 default: 252 return false; 253 } 254 } 255 256 bool IsSingleFromSpellSpecificPerTarget(uint32 spellSpec1,uint32 spellSpec2) 257 { 258 switch(spellSpec1) 259 { 247 260 case SPELL_TRACKER: 248 261 case SPELL_WARLOCK_ARMOR: … … 250 263 case SPELL_ELEMENTAL_SHIELD: 251 264 case SPELL_MAGE_POLYMORPH: 252 case SPELL_POSITIVE_SHOUT:253 case SPELL_JUDGEMENT:254 case SPELL_WARLOCK_CORRUPTION:255 265 return spellSpec1==spellSpec2; 256 266 case SPELL_BATTLE_ELIXIR: … … 1031 1041 } 1032 1042 1033 bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2 ) const1034 { 1035 if(spellId_1 == spellId_2) // auras due to the same spell1036 return false;1043 bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool sameCaster) const 1044 { 1045 //if(spellId_1 == spellId_2) // auras due to the same spell 1046 // return false; 1037 1047 1038 1048 SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1); … … 1042 1052 return false; 1043 1053 1054 SpellSpecific spellId_spec_1 = GetSpellSpecific(spellId_1); 1055 SpellSpecific spellId_spec_2 = GetSpellSpecific(spellId_2); 1056 if (spellId_spec_1 && spellId_spec_2) 1057 if (IsSingleFromSpellSpecificPerTarget(spellId_spec_1, spellId_spec_2) 1058 ||(IsSingleFromSpellSpecificPerCaster(spellId_spec_1, spellId_spec_2) && sameCaster)) 1059 return true; 1060 1044 1061 if(spellInfo_1->SpellFamilyName != spellInfo_2->SpellFamilyName) 1045 1062 return false; 1046 1063 1047 if(!spellInfo_1->SpellFamilyName) // generic spells 1064 // generic spells 1065 if(!spellInfo_1->SpellFamilyName) 1048 1066 { 1049 1067 if(!spellInfo_1->SpellIconID … … 1051 1069 return false; 1052 1070 } 1053 else if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags) 1054 return false; 1071 1072 // if both elixirs are not battle/guardian/potions/flasks then always stack 1073 else if(spellInfo_1->SpellFamilyName == SPELLFAMILY_POTION) 1074 { 1075 if(spellId_spec_1 || spellId_spec_2) 1076 return false; 1077 } 1078 1079 // check for class spells 1080 else 1081 { 1082 if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags) 1083 return false; 1084 } 1055 1085 1056 1086 for(uint32 i = 0; i < 3; ++i) 1087 { 1057 1088 if(spellInfo_1->Effect[i] != spellInfo_2->Effect[i] 1058 || spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i]) 1059 return false; 1089 || spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i] 1090 || spellInfo_1->EffectMiscValue[i] != spellInfo_2->EffectMiscValue[i]) // paladin resist aura 1091 return false; // need itemtype check? need an example to add that check 1092 1093 if(spellInfo_1->EffectApplyAuraName[i] // both spell has the same auras 1094 && !sameCaster 1095 && spellInfo_1->Effect[i] != SPELL_EFFECT_APPLY_AREA_AURA_PARTY) // not area auras (shaman totem) 1096 // a better check may be effect == SPELL_EFFECT_APPLY_AURA 1097 { 1098 switch(spellInfo_1->EffectApplyAuraName[i]) 1099 { 1100 // DOT or HOT from different casters will stack 1101 case SPELL_AURA_PERIODIC_DAMAGE: 1102 case SPELL_AURA_PERIODIC_HEAL: 1103 case SPELL_AURA_PERIODIC_TRIGGER_SPELL: 1104 case SPELL_AURA_PERIODIC_ENERGIZE: 1105 case SPELL_AURA_PERIODIC_MANA_LEECH: 1106 case SPELL_AURA_PERIODIC_LEECH: 1107 return false; 1108 default: 1109 break; 1110 } 1111 } 1112 } 1060 1113 1061 1114 return true;