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 | | } |
| 2073 | int32 trigger = fields[0].GetInt32(); |
| 2074 | int32 effect = fields[1].GetInt32(); |
| 2075 | int32 type = fields[2].GetInt32(); |
| 2076 | |
| 2077 | SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(trigger)); |
| 2078 | if (!spellInfo) |
| 2079 | { |
| 2080 | sLog.outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(trigger)); |
| 2081 | continue; |
| 2082 | } |
| 2083 | spellInfo = sSpellStore.LookupEntry(abs(effect)); |
| 2084 | if (!spellInfo) |
| 2085 | { |
| 2086 | sLog.outErrorDb("Spell %u listed in `spell_linked_spell` does not exist", abs(effect)); |
| 2087 | continue; |
| 2088 | } |
| 2089 | |
| 2090 | SpellLinkedSpell linkedSpell; |
| 2091 | linkedSpell.spell = effect; |
| 2092 | linkedSpell.type = type; |
| 2093 | mSpellLinkedMap[trigger] = linkedSpell; |