1972 | | void SpellMgr::LoadSpellExtraInfo() |
1973 | | { |
1974 | | SpellExtraInfo info; |
1975 | | info.info[SPELL_EXTRA_INFO_CONE_TYPE] = 0; |
1976 | | info.info[SPELL_EXTRA_INFO_MAX_TARGETS] = 0; |
1977 | | info.info[SPELL_EXTRA_INFO_SHARE_DAMAGE] = 0; |
1978 | | |
1979 | | info.info[SPELL_EXTRA_INFO_CONE_TYPE] = 1; |
1980 | | SpellEntry const* tempSpell; |
1981 | | for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) |
1982 | | { |
1983 | | tempSpell = GetSpellStore()->LookupEntry(i); |
1984 | | if(tempSpell && tempSpell->SpellVisual == 3879) |
1985 | | mSpellExtraInfoMap[tempSpell->Id] = info; |
1986 | | } |
1987 | | info.info[SPELL_EXTRA_INFO_CONE_TYPE] = 2; |
1988 | | mSpellExtraInfoMap[26029] = info; // dark glare |
1989 | | mSpellExtraInfoMap[37433] = info; // spout |
1990 | | mSpellExtraInfoMap[43140] = info; // flame breath |
1991 | | mSpellExtraInfoMap[43215] = info; // flame breath |
1992 | | info.info[SPELL_EXTRA_INFO_CONE_TYPE] = 0; |
1993 | | |
1994 | | info.info[SPELL_EXTRA_INFO_SHARE_DAMAGE] = 1; |
| 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; |
2030 | | info.info[SPELL_EXTRA_INFO_MAX_TARGETS] = 3; |
2031 | | mSpellExtraInfoMap[41376] = info; //Spite |
2032 | | info.info[SPELL_EXTRA_INFO_MAX_TARGETS] = 0; |
| 2032 | tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 3; |
| 2033 | mSpellExtraAttrMap[41376] = tempAttr; //Spite |
| 2034 | tempAttr.attr[SPELL_EXTRA_ATTR_MAX_TARGETS] = 0; |
| 2035 | |
| 2036 | //hack here, only for those strange exceptions! |
| 2037 | // Psychic Scream |
| 2038 | SpellEntry *tempSpell; |
| 2039 | if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(8122)) |
| 2040 | tempSpell->AttributesEx |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; |
| 2041 | if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(8124)) |
| 2042 | tempSpell->AttributesEx |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; |
| 2043 | if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(10888)) |
| 2044 | tempSpell->AttributesEx |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; |
| 2045 | if(tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(10890)) |
| 2046 | tempSpell->AttributesEx |= SPELL_ATTR_BREAKABLE_BY_DAMAGE; |
| 2047 | } |
| 2048 | |
| 2049 | void SpellMgr::LoadSpellLinked() |
| 2050 | { |
| 2051 | mSpellLinkedMap.clear(); // need for reload case |
| 2052 | uint32 count = 0; |
| 2053 | |
| 2054 | // 0 1 |
| 2055 | QueryResult *result = WorldDatabase.Query("SELECT spell0, spell1 FROM spell_linked_spell"); |
| 2056 | if( !result ) |
| 2057 | { |
| 2058 | barGoLink bar( 1 ); |
| 2059 | bar.step(); |
| 2060 | sLog.outString(); |
| 2061 | sLog.outString( ">> Loaded %u spell pet auras", count ); |
| 2062 | return; |
| 2063 | } |
| 2064 | |
| 2065 | barGoLink bar( result->GetRowCount() ); |
| 2066 | |
| 2067 | do |
| 2068 | { |
| 2069 | Field *fields = result->Fetch(); |
| 2070 | |
| 2071 | bar.step(); |
| 2072 | |
| 2073 | uint16 spell = fields[0].GetUInt16(); |
| 2074 | uint16 pet = fields[1].GetUInt16(); |
| 2075 | uint16 aura = fields[2].GetUInt16(); |
| 2076 | |
| 2077 | SpellPetAuraMap::iterator itr = mSpellPetAuraMap.find(spell); |
| 2078 | if(itr != mSpellPetAuraMap.end()) |
| 2079 | { |
| 2080 | itr->second.AddAura(pet, aura); |
| 2081 | } |
| 2082 | else |
| 2083 | { |
| 2084 | SpellEntry const* spellInfo = sSpellStore.LookupEntry(spell); |
| 2085 | if (!spellInfo) |
| 2086 | { |
| 2087 | sLog.outErrorDb("Spell %u listed in `spell_pet_auras` does not exist", spell); |
| 2088 | continue; |
| 2089 | } |
| 2090 | int i = 0; |
| 2091 | for(; i < 3; ++i) |
| 2092 | if((spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA && |
| 2093 | spellInfo->EffectApplyAuraName[i] == SPELL_AURA_DUMMY) || |
| 2094 | spellInfo->Effect[i] == SPELL_EFFECT_DUMMY) |
| 2095 | break; |
| 2096 | |
| 2097 | if(i == 3) |
| 2098 | { |
| 2099 | sLog.outError("Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell); |
| 2100 | continue; |
| 2101 | } |
| 2102 | |
| 2103 | SpellEntry const* spellInfo2 = sSpellStore.LookupEntry(aura); |
| 2104 | if (!spellInfo2) |
| 2105 | { |
| 2106 | sLog.outErrorDb("Aura %u listed in `spell_pet_auras` does not exist", aura); |
| 2107 | continue; |
| 2108 | } |
| 2109 | |
| 2110 | PetAura pa(pet, aura, spellInfo->EffectImplicitTargetA[i] == TARGET_PET, spellInfo->EffectBasePoints[i] + spellInfo->EffectBaseDice[i]); |
| 2111 | mSpellPetAuraMap[spell] = pa; |
| 2112 | } |
| 2113 | |
| 2114 | ++count; |
| 2115 | } while( result->NextRow() ); |
| 2116 | |
| 2117 | delete result; |
| 2118 | |
| 2119 | sLog.outString(); |
| 2120 | sLog.outString( ">> Loaded %u spell pet auras", count ); |