Changeset 250 for trunk/src/game/Pet.cpp

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

*Update aura stacking check. By QAston.
*Update pet autocast check. By qubix.

Original author: megamage
Date: 2008-11-17 17:59:33-06:00

Files:
1 modified

Legend:

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

    r218 r250  
    287287            ++iter; 
    288288            m_charmInfo->GetActionBarEntry(index)->SpellOrAction = atol((*iter).c_str()); 
     289            // patch for old data where some spells have ACT_DECIDE but should have ACT_CAST 
     290            // so overwrite old state  
     291            SpellEntry const *spellInfo = sSpellStore.LookupEntry(m_charmInfo->GetActionBarEntry(index)->SpellOrAction); 
     292            if (spellInfo && spellInfo->AttributesEx & SPELL_ATTR_EX_PET_NOT_AUTOCAST) 
     293                m_charmInfo->GetActionBarEntry(index)->Type = ACT_CAST; 
    289294        } 
    290295 
     
    12871292            Field *fields = result->Fetch(); 
    12881293 
    1289             addSpell(fields[0].GetUInt16(), fields[2].GetUInt16(), PETSPELL_UNCHANGED, fields[1].GetUInt16()); 
     1294            addSpell(fields[0].GetUInt16(), (ActiveStates)fields[2].GetUInt16(), PETSPELL_UNCHANGED, fields[1].GetUInt16()); 
    12901295        } 
    12911296        while( result->NextRow() ); 
     
    14181423} 
    14191424 
    1420 bool Pet::addSpell(uint16 spell_id, uint16 active, PetSpellState state, uint16 slot_id, PetSpellType type) 
     1425bool Pet::addSpell(uint16 spell_id, ActiveStates active, PetSpellState state, uint16 slot_id, PetSpellType type) 
    14211426{ 
    14221427    SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); 
     
    14341439        return false; 
    14351440    } 
     1441    // same spells don't have autocast option 
     1442    if (spellInfo->AttributesEx & SPELL_ATTR_EX_PET_NOT_AUTOCAST) 
     1443        active = ACT_CAST; 
    14361444 
    14371445    PetSpellMap::iterator itr = m_spells.find(spell_id); 
     
    15091517        CastSpell(this, spell_id, true); 
    15101518    else if(state == PETSPELL_NEW) 
    1511         m_charmInfo->AddSpellToAB(oldspell_id, spell_id); 
     1519        m_charmInfo->AddSpellToAB(oldspell_id, spell_id, active); 
    15121520 
    15131521    if(newspell->active == ACT_ENABLED) 
     
    16591667        return; 
    16601668 
    1661     if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid)) 
     1669    /*if(const SpellEntry *tempSpell = GetSpellStore()->LookupEntry(spellid)) 
    16621670        if(tempSpell->EffectImplicitTargetA[0] != TARGET_ALL_AROUND_CASTER 
    16631671            && tempSpell->EffectImplicitTargetA[0] != TARGET_CHAIN_DAMAGE) 
    1664             return;     
     1672            return;    */ 
    16651673 
    16661674    PetSpellMap::const_iterator itr = m_spells.find((uint16)spellid);