Changeset 272 for trunk/src/game/SpellMgr.cpp
- Timestamp:
- 11/22/08 00:35:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/SpellMgr.cpp
r265 r272 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 {260 247 case SPELL_TRACKER: 261 248 case SPELL_WARLOCK_ARMOR: … … 263 250 case SPELL_ELEMENTAL_SHIELD: 264 251 case SPELL_MAGE_POLYMORPH: 252 case SPELL_POSITIVE_SHOUT: 253 case SPELL_JUDGEMENT: 254 case SPELL_WARLOCK_CORRUPTION: 265 255 return spellSpec1==spellSpec2; 266 256 case SPELL_BATTLE_ELIXIR: … … 1041 1031 } 1042 1032 1043 bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2 , bool sameCaster) const1044 { 1045 //if(spellId_1 == spellId_2) // auras due to the same spell1046 //return false;1033 bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) const 1034 { 1035 if(spellId_1 == spellId_2) // auras due to the same spell 1036 return false; 1047 1037 1048 1038 SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1); … … 1052 1042 return false; 1053 1043 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 1061 1044 if(spellInfo_1->SpellFamilyName != spellInfo_2->SpellFamilyName) 1062 1045 return false; 1063 1046 1064 // generic spells 1065 if(!spellInfo_1->SpellFamilyName) 1047 if(!spellInfo_1->SpellFamilyName) // generic spells 1066 1048 { 1067 1049 if(!spellInfo_1->SpellIconID … … 1069 1051 return false; 1070 1052 } 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) 1053 else if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags) 1054 return false; 1055 1056 for(uint32 i = 0; i < 3; ++i) 1057 if(spellInfo_1->Effect[i] != spellInfo_2->Effect[i] 1058 || spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i]) 1076 1059 return false; 1077 }1078 1079 // check for class spells1080 else1081 {1082 if (spellInfo_1->SpellFamilyFlags != spellInfo_2->SpellFamilyFlags)1083 return false;1084 }1085 1086 for(uint32 i = 0; i < 3; ++i)1087 {1088 if(spellInfo_1->Effect[i] != spellInfo_2->Effect[i]1089 || spellInfo_1->EffectApplyAuraName[i] != spellInfo_2->EffectApplyAuraName[i]1090 || spellInfo_1->EffectMiscValue[i] != spellInfo_2->EffectMiscValue[i]) // paladin resist aura1091 return false; // need itemtype check? need an example to add that check1092 1093 if(spellInfo_1->EffectApplyAuraName[i] // both spell has the same auras1094 && !sameCaster1095 && 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_AURA1097 {1098 switch(spellInfo_1->EffectApplyAuraName[i])1099 {1100 // DOT or HOT from different casters will stack1101 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 }1113 1060 1114 1061 return true;