Show
Ignore:
Timestamp:
11/19/08 13:45:21 (17 years ago)
Author:
yumileroy
Message:

[svn] Fix: DOT and HOT only proc effects when hit, but not on every tick (I know there is a proc flag patch, but this is a very quick fix).
Change the structure of customattrmap. Use bit flag instead of uint32 for every attribute.

Original author: megamage
Date: 2008-11-08 11:26:44-06:00

Files:
1 modified

Legend:

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

    r186 r196  
    19701970 
    19711971// set data in core for now 
    1972 void SpellMgr::LoadSpellExtraAttr() 
    1973 { 
    1974     SpellExtraAttribute tempAttr; 
    1975     tempAttr.attr[SPELL_EXTRA_ATTR_CONE_TYPE] = 0; 
    1976     tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 0; 
    1977     tempAttr.attr[SPELL_EXTRA_ATTR_SHARE_DAMAGE] = 0; 
    1978  
    1979     tempAttr.attr[SPELL_EXTRA_ATTR_CONE_TYPE] = 1; 
    1980     { 
    1981         SpellEntry const* tempSpell; 
    1982         for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) 
    1983         { 
    1984             tempSpell = GetSpellStore()->LookupEntry(i); 
    1985             if(tempSpell && tempSpell->SpellVisual == 3879) 
    1986                 mSpellExtraAttrMap[tempSpell->Id] = tempAttr; 
    1987         } 
    1988     } 
    1989     tempAttr.attr[SPELL_EXTRA_ATTR_CONE_TYPE] = 2; 
    1990     mSpellExtraAttrMap[26029] = tempAttr; // dark glare 
    1991     mSpellExtraAttrMap[37433] = tempAttr; // spout 
    1992     mSpellExtraAttrMap[43140] = tempAttr; // flame breath 
    1993     mSpellExtraAttrMap[43215] = tempAttr; // flame breath 
    1994     tempAttr.attr[SPELL_EXTRA_ATTR_CONE_TYPE] = 0; 
    1995  
    1996     tempAttr.attr[SPELL_EXTRA_ATTR_SHARE_DAMAGE] = 1; 
    1997     for(uint32 i = 0; i < 46000; ++i) 
    1998     { 
    1999         switch(i) 
    2000         { 
    2001             case 24340: case 26558: case 28884:     // Meteor 
    2002             case 36837: case 38903: case 41276:     // Meteor 
    2003             case 26789:                             // Shard of the Fallen Star 
    2004             case 31436:                             // Malevolent Cleave 
    2005             case 35181:                             // Dive Bomb 
    2006             case 40810: case 43267: case 43268:     // Saber Lash 
    2007             case 42384:                             // Brutal Swipe 
    2008             case 45150:                             // Meteor Slash 
    2009                 mSpellExtraAttrMap[i] = tempAttr; 
    2010                 break; 
    2011             default: 
    2012                 break; 
    2013         } 
    2014     } 
    2015     tempAttr.attr[SPELL_EXTRA_ATTR_SHARE_DAMAGE] = 0; 
    2016  
    2017     tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 1; 
    2018     for(uint32 i = 0; i < 46000; ++i) 
    2019     { 
    2020         switch(i) 
    2021         { 
    2022             case 44978: case 45001: case 45002:     // Wild Magic 
    2023             case 45004: case 45006: case 45010:     // Wild Magic 
    2024             case 31347: // Doom 
    2025             case 41635: // Prayer of Mending 
    2026                 mSpellExtraAttrMap[i] = tempAttr; 
    2027                 break; 
    2028             default: 
    2029                 break; 
    2030         } 
    2031     } 
    2032     tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 3; 
    2033     mSpellExtraAttrMap[41376] = tempAttr;   //Spite 
    2034     mSpellExtraAttrMap[39992] = tempAttr;   //Needle Spine 
    2035     tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 0; 
    2036  
    2037     //hack here, only for those strange exceptions! 
    2038     // Psychic Scream 
     1972void SpellMgr::LoadSpellCustomAttr() 
     1973{ 
    20391974    SpellEntry *tempSpell; 
    2040     if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(8122)) 
    2041         tempSpell->Attributes |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
    2042     if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(8124)) 
    2043         tempSpell->Attributes |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
    2044     if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(10888)) 
    2045         tempSpell->Attributes |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
    2046     if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(10890)) 
    2047         tempSpell->Attributes |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
     1975    for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) 
     1976    { 
     1977        tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(i); 
     1978        if(!tempSpell) 
     1979            continue; 
     1980 
     1981        mSpellCustomAttrMap[tempSpell->Id] = 0; 
     1982 
     1983        for(uint32 i = 0; i < 3; ++i) 
     1984        { 
     1985            switch(tempSpell->EffectApplyAuraName[i]) 
     1986            { 
     1987                case SPELL_AURA_PERIODIC_DAMAGE: 
     1988                case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: 
     1989                case SPELL_AURA_PERIODIC_LEECH: 
     1990                    mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_EFFECT_DAMAGE; 
     1991                    break; 
     1992                case SPELL_AURA_PERIODIC_HEAL: 
     1993                case SPELL_AURA_OBS_MOD_HEALTH: 
     1994                    mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_EFFECT_HEAL; 
     1995                    break; 
     1996                default: 
     1997                    break; 
     1998            } 
     1999        } 
     2000 
     2001        if(tempSpell->SpellVisual == 3879) 
     2002            mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_CONE_BACK; 
     2003 
     2004        switch(tempSpell->Id) 
     2005        { 
     2006        case 26029: // dark glare 
     2007        case 37433: // spout 
     2008        case 43140: case 43215: // flame breath 
     2009            mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_CONE_LINE; 
     2010            break; 
     2011        case 24340: case 26558: case 28884:     // Meteor 
     2012        case 36837: case 38903: case 41276:     // Meteor 
     2013        case 26789:                             // Shard of the Fallen Star 
     2014        case 31436:                             // Malevolent Cleave 
     2015        case 35181:                             // Dive Bomb 
     2016        case 40810: case 43267: case 43268:     // Saber Lash 
     2017        case 42384:                             // Brutal Swipe 
     2018        case 45150:                             // Meteor Slash 
     2019            mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_SHARE_DAMAGE; 
     2020            break; 
     2021        case 44978: case 45001: case 45002:     // Wild Magic 
     2022        case 45004: case 45006: case 45010:     // Wild Magic 
     2023        case 31347: // Doom 
     2024        case 41635: // Prayer of Mending 
     2025            mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_PLAYERS_ONLY; 
     2026            tempSpell->MaxAffectedTargets = 1; 
     2027            break; 
     2028        case 41376: // Spite 
     2029        case 39992: // Needle Spine 
     2030            mSpellCustomAttrMap[tempSpell->Id] |= SPELL_ATTR_CU_PLAYERS_ONLY; 
     2031            tempSpell->MaxAffectedTargets = 3; 
     2032            break; 
     2033        case 8122: case 8124: case 10888: case 10890: // Psychic Scream 
     2034            tempSpell->Attributes |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; 
     2035            break; 
     2036        default: 
     2037            break; 
     2038        } 
     2039    } 
    20482040} 
    20492041