Show
Ignore:
Timestamp:
11/22/08 00:35:41 (17 years ago)
Author:
yumileroy
Message:

Delete possessed AI only on creature delete.

Original author: gvcoman
Date: 2008-11-16 14:38:02-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/SpellMgr.cpp

    r265 r272  
    100100} 
    101101 
    102 /*bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2) 
     102bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2) 
    103103{ 
    104104    SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1); 
     
    114114 
    115115    return true; 
    116 }*/ 
     116} 
    117117 
    118118int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2) 
     
    245245        case SPELL_CURSE: 
    246246        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     { 
    260247        case SPELL_TRACKER: 
    261248        case SPELL_WARLOCK_ARMOR: 
     
    263250        case SPELL_ELEMENTAL_SHIELD: 
    264251        case SPELL_MAGE_POLYMORPH: 
     252        case SPELL_POSITIVE_SHOUT: 
     253        case SPELL_JUDGEMENT: 
     254        case SPELL_WARLOCK_CORRUPTION: 
    265255            return spellSpec1==spellSpec2; 
    266256        case SPELL_BATTLE_ELIXIR: 
     
    10411031} 
    10421032 
    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; 
     1033bool 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; 
    10471037 
    10481038    SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1); 
     
    10521042        return false; 
    10531043 
    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  
    10611044    if(spellInfo_1->SpellFamilyName != spellInfo_2->SpellFamilyName) 
    10621045        return false; 
    10631046 
    1064     // generic spells 
    1065     if(!spellInfo_1->SpellFamilyName) 
     1047    if(!spellInfo_1->SpellFamilyName) // generic spells 
    10661048    { 
    10671049        if(!spellInfo_1->SpellIconID  
     
    10691051            return false; 
    10701052    } 
    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]) 
    10761059            return false; 
    1077     } 
    1078  
    1079     // check for class spells 
    1080     else 
    1081     { 
    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 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     } 
    11131060 
    11141061    return true;