50 for (SkillLineAbilityMap::const_iterator itr = skillBounds.first; itr != skillBounds.second; ++itr)
51 if (itr->second->SkillLine == skillId)
77 bool needCheckReagents =
false;
82 switch (spellEffectInfo.Effect)
88 if (spellEffectInfo.ItemType == 0)
98 TC_LOG_ERROR(
"sql.sql",
"The craft spell {} does not have a create item entry.", spellInfo->
Id);
105 else if (!
sObjectMgr->GetItemTemplate(spellEffectInfo.ItemType))
112 TC_LOG_ERROR(
"sql.sql",
"Craft spell {} has created a non-existing item in DB (Entry: {}) and then...", spellInfo->
Id, spellEffectInfo.ItemType);
117 needCheckReagents =
true;
130 TC_LOG_ERROR(
"sql.sql",
"Spell {} learn to invalid spell {}, and then...", spellInfo->
Id, spellEffectInfo.TriggerSpell);
141 if (needCheckReagents)
152 TC_LOG_ERROR(
"sql.sql",
"Craft spell {} refers to a non-existing reagent in DB, item (Entry: {}) and then...", spellInfo->
Id, spellInfo->
Reagent[j]);
171 TC_LOG_ERROR(
"spells",
"SpellMgr::SetSpellDifficultyId: The spell {} already has spellDifficultyId {}. Will override with spellDifficultyId {}.", spellId, i,
id);
186 TC_LOG_ERROR(
"spells",
"SpellMgr::GetSpellIdForDifficulty: Incorrect difficulty for spell {}.", spellId);
195 if (!difficultyEntry)
197 TC_LOG_ERROR(
"spells",
"SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry was not found for spell {}. This should never happen.", spellId);
203 TC_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellIdForDifficulty: spell {} mode {} spell is NULL, using mode {}", spellId, mode, mode - 2);
209 TC_LOG_ERROR(
"sql.sql",
"SpellMgr::GetSpellIdForDifficulty: spell {} mode {} spell is 0. Check spelldifficulty_dbc!", spellId, mode);
213 TC_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellIdForDifficulty: spellid for spell {} in mode {} is {}", spellId, mode, difficultyEntry->
DifficultySpellID[mode]);
226 TC_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellForDifficultyFromSpell: spell {} not found. Check spelldifficulty_dbc!", newSpellId);
230 TC_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellForDifficultyFromSpell: Spell id for instance mode is {} (original {})", newSpell->
Id, spell->
Id);
236 SpellChainMap::const_iterator itr =
mSpellChains.find(spell_id);
254 return node->last->Id;
263 return node->next->Id;
272 return node->prev->Id;
289 if (rank != node->rank)
290 return GetSpellWithRank(node->rank < rank ? node->next->Id : node->prev->Id, rank, strict);
292 else if (strict && rank > 1)
310 for (SpellsRequiringSpellMap::const_iterator itr = spellsRequiringSpell.first; itr != spellsRequiringSpell.second; ++itr)
312 if (itr->second == spellid)
340 for (SpellLearnSpellMap::const_iterator i = bounds.first; i != bounds.second; ++i)
341 if (i->second.Spell == spell_id2)
348 SpellTargetPositionMap::const_iterator itr =
mSpellTargetPositions.find(std::make_pair(spell_id, effIndex));
363 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr)
365 if (itr->second == groupid)
378 std::set<SpellGroup> usedGroups;
384 if (usedGroups.find(group_id) != usedGroups.end())
386 usedGroups.insert(group_id);
389 for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second; ++itr)
398 foundSpells.insert(itr->second);
408 for (
auto itr = spellGroupBounds.first; itr != spellGroupBounds.second; ++itr)
415 if (!found->second.count(auraType))
419 auto groupItr = groups.find(group);
420 if (groupItr == groups.end())
421 groups.emplace(group, amount);
424 int32 curr_amount = groups[group];
426 if (std::abs(curr_amount) < std::abs(amount))
427 groupItr->second = amount;
447 std::set<SpellGroup> groups;
448 for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second; ++itr)
454 for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second; ++itr2)
456 if (itr2->second < 0)
467 groups.insert(itr->second);
473 for (std::set<SpellGroup>::iterator itr = groups.begin(); itr!= groups.end(); ++itr)
477 rule = found->second;
495 SpellProcMap::const_iterator itr =
mSpellProcMap.find(spellId);
516 if (!eventSpellInfo->ManaCost && !eventSpellInfo->ManaCostPercentage)
578 return &itr2->second;
605 SpellPetAuraMap::const_iterator itr =
mSpellPetAuraMap.find((spell_id<<8) + eff);
701 return bg->IsSpellAllowed(
spellId, player);
756 return battlefieldWG->IsEnabled() && (player->
GetTeamId() == battlefieldWG->GetDefenderTeam()) && !battlefieldWG->IsWarTime();
765 return bf->IsWarTime();
809 TC_LOG_ERROR(
"spells",
"SpellMgr::LoadSpellTalentRanks: First Rank Spell {} for TalentEntry {} does not exist.", talentInfo->
SpellRank[0], i);
823 TC_LOG_ERROR(
"spells",
"SpellMgr::LoadSpellTalentRanks: Spell {} (Rank: {}) for TalentEntry {} does not exist.", spellId, rank + 1, i);
828 node.
first = firstSpell;
829 node.
last = lastSpell;
830 node.
rank = rank + 1;
832 node.
prev = prevSpell;
838 prevSpell = currentSpell;
851 QueryResult result =
WorldDatabase.Query(
"SELECT first_spell_id, spell_id, `rank` from spell_ranks ORDER BY first_spell_id, `rank`");
855 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
860 bool finished =
false;
865 std::list < std::pair < int32, int32 > > rankChain;
866 int32 currentSpell = -1;
867 int32 lastSpell = -1;
870 while (currentSpell == lastSpell && !finished)
872 Field* fields = result->Fetch();
876 lastSpell = currentSpell;
881 if (currentSpell == lastSpell)
883 rankChain.push_back(std::make_pair(spell_id, rank));
884 if (!result->NextRow())
894 TC_LOG_ERROR(
"sql.sql",
"The spell rank identifier(first_spell_id) {} listed in `spell_ranks` does not exist!", lastSpell);
898 if (rankChain.size() < 2)
900 TC_LOG_ERROR(
"sql.sql",
"There is only 1 spell rank for identifier(first_spell_id) {} in `spell_ranks`, entry is not needed!", lastSpell);
906 for (std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin(); itr!= rankChain.end(); ++itr)
911 TC_LOG_ERROR(
"sql.sql",
"The spell {} (rank {}) listed in `spell_ranks` for chain {} does not exist!", itr->first, itr->second, lastSpell);
916 if (itr->second != curRank)
918 TC_LOG_ERROR(
"sql.sql",
"The spell {} (rank {}) listed in `spell_ranks` for chain {} does not have a proper rank value (should be {})!", itr->first, itr->second, lastSpell, curRank);
927 std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin();
931 int32 addedSpell = itr->first;
934 TC_LOG_ERROR(
"sql.sql",
"The spell {} (rank: {}, first: {}) listed in `spell_ranks` already has ChainEntry from dbc.", addedSpell, itr->second, lastSpell);
941 prevRank = addedSpell;
944 if (itr == rankChain.end())
971 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell required records. DB table `spell_required` is empty.");
979 Field* fields = result->Fetch();
988 TC_LOG_ERROR(
"sql.sql",
"spell_id {} in `spell_required` table could not be found in dbc, skipped.", spell_id);
995 TC_LOG_ERROR(
"sql.sql",
"req_spell {} in `spell_required` table could not be found in dbc, skipped.", spell_req);
1001 TC_LOG_ERROR(
"sql.sql",
"req_spell {} and spell_id {} in `spell_required` table are ranks of the same spell, entry not needed, skipped.", spell_req, spell_id);
1007 TC_LOG_ERROR(
"sql.sql",
"Duplicate entry of req_spell {} and spell_id {} in `spell_required`, skipped.", spell_req, spell_id);
1011 mSpellReq.insert (std::pair<uint32, uint32>(spell_id, spell_req));
1012 mSpellsReqSpell.insert (std::pair<uint32, uint32>(spell_req, spell_id));
1014 }
while (result->NextRow());
1036 switch (spellEffectInfo.Effect)
1039 dbc_node.
skill = spellEffectInfo.MiscValue;
1040 dbc_node.
step = spellEffectInfo.CalcValue();
1076 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty.");
1083 Field* fields = result->Fetch();
1094 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_learn_spell` does not exist.", spell_id);
1099 if (!learnedSpellInfo)
1101 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_learn_spell` learning non-existing spell {}.", spell_id, node.
Spell);
1107 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_learn_spell` attempts learning talent spell {}, skipped.", spell_id, node.
Spell);
1114 }
while (result->NextRow());
1130 dbc_node.
Spell = spellEffectInfo.TriggerSpell;
1145 for (SpellLearnSpellMap::const_iterator itr = db_node_bounds.first; itr != db_node_bounds.second; ++itr)
1147 if (itr->second.Spell == dbc_node.
Spell)
1149 TC_LOG_ERROR(
"sql.sql",
"The spell {} is an auto-learn spell {} in spell.dbc and the record in `spell_learn_spell` is redundant. Please update your DB.",
1150 spell, dbc_node.
Spell);
1165 TC_LOG_INFO(
"server.loading",
">> Loaded {} spell learn spells + {} found in DBC in {} ms", count, dbc_count,
GetMSTimeDiffToNow(oldMSTime));
1175 QueryResult result =
WorldDatabase.Query(
"SELECT ID, EffectIndex, MapID, PositionX, PositionY, PositionZ, Orientation FROM spell_target_position");
1178 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
1185 Field* fields = result->Fetch();
1201 TC_LOG_ERROR(
"sql.sql",
"Spell (Id: {}, EffectIndex: {}) is using a non-existant MapID (ID: {}).", spellId, effIndex, st.
target_mapId);
1207 TC_LOG_ERROR(
"sql.sql",
"Spell (Id: {}, EffectIndex: {}): target coordinates not provided.", spellId, effIndex);
1214 TC_LOG_ERROR(
"sql.sql",
"Spell (Id: {}) listed in `spell_target_position` does not exist.", spellId);
1220 std::pair<uint32, SpellEffIndex> key = std::make_pair(spellId, effIndex);
1226 TC_LOG_ERROR(
"sql.sql",
"Spell (Id: {}, EffectIndex: {}) listed in `spell_target_position` does not have target TARGET_DEST_DB (17).", spellId, effIndex);
1230 }
while (result->NextRow());
1261 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
1265 std::set<uint32> groups;
1269 Field* fields = result->Fetch();
1274 TC_LOG_ERROR(
"sql.sql",
"SpellGroup id {} listed in `spell_group` is in core range, but is not defined in core!", group_id);
1279 groups.insert(group_id);
1282 }
while (result->NextRow());
1286 if (itr->second < 0)
1288 if (groups.find(abs(itr->second)) == groups.end())
1290 TC_LOG_ERROR(
"sql.sql",
"SpellGroup id {} listed in `spell_group` does not exist", abs(itr->second));
1301 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_group` does not exist", itr->second);
1304 else if (spellInfo->
GetRank() > 1)
1306 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_group` is not the first rank of the spell.", itr->second);
1314 for (
auto groupItr = groups.begin(); groupItr != groups.end(); ++groupItr)
1316 std::set<uint32> spells;
1319 for (
auto spellItr = spells.begin(); spellItr != spells.end(); ++spellItr)
1336 std::vector<uint32> sameEffectGroups;
1342 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
1349 Field* fields = result->Fetch();
1355 TC_LOG_ERROR(
"sql.sql",
"SpellGroupStackRule {} listed in `spell_group_stack_rules` does not exist.", stack_rule);
1360 if (bounds.first == bounds.second)
1362 TC_LOG_ERROR(
"sql.sql",
"SpellGroup id {} listed in `spell_group_stack_rules` does not exist.", group_id);
1370 sameEffectGroups.push_back(group_id);
1373 }
while (result->NextRow());
1379 TC_LOG_INFO(
"server.loading",
">> Parsing SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules...");
1381 for (
uint32 group_id : sameEffectGroups)
1383 std::set<uint32> spellIds;
1386 std::unordered_set<uint32> auraTypes;
1390 std::unordered_multiset<
uint32 > frequencyContainer;
1393 std::vector<std::vector<
uint32 >>
const SubGroups =
1398 for (
uint32 spellId : spellIds)
1403 if (!spellEffectInfo.IsAura())
1406 uint32 auraName = spellEffectInfo.ApplyAuraName;
1407 for (std::vector<uint32>
const& subGroup : SubGroups)
1409 if (std::find(subGroup.begin(), subGroup.end(), auraName) != subGroup.end())
1412 auraName = subGroup.front();
1417 frequencyContainer.insert(auraName);
1422 size_t auraTypeCount = 0;
1423 for (
uint32 auraName : frequencyContainer)
1425 size_t currentCount = frequencyContainer.count(auraName);
1426 if (currentCount > auraTypeCount)
1428 auraType = auraName;
1429 auraTypeCount = currentCount;
1433 for (std::vector<uint32>
const& subGroup : SubGroups)
1435 if (auraType == subGroup.front())
1437 auraTypes.insert(subGroup.begin(), subGroup.end());
1442 if (auraTypes.empty())
1443 auraTypes.insert(auraType);
1447 for (
uint32 spellId : spellIds)
1454 for (
uint32 auraType : auraTypes)
1471 TC_LOG_ERROR(
"sql.sql",
"SpellId {} listed in `spell_group` with stack rule 3 does not share aura assigned for group {}", spellId, group_id);
1478 TC_LOG_INFO(
"server.loading",
">> Parsed {} SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules in {} ms", count,
GetMSTimeDiffToNow(oldMSTime));
1488 QueryResult result =
WorldDatabase.Query(
"SELECT SpellId, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, "
1490 "ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, DisableEffectsMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc");
1497 Field* fields = result->Fetch();
1501 bool allRanks =
false;
1511 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_proc` does not exist", spellId);
1518 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_proc` with all ranks, but spell has no ranks.", spellId);
1522 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_proc` is not the first rank of the spell.", spellId);
1549 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_proc` already has its first rank in the table.", spellInfo->
Id);
1565 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has wrong `SchoolMask` set: {}", spellInfo->
Id, procEntry.
SchoolMask);
1567 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has wrong `SpellFamilyName` set: {}", spellInfo->
Id, procEntry.
SpellFamilyName);
1568 if (procEntry.
Chance < 0)
1570 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has negative value in the `Chance` field", spellInfo->
Id);
1575 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has negative value in the `ProcsPerMinute` field", spellInfo->
Id);
1579 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} doesn't have any `ProcFlags` value defined, proc will not be triggered.", spellInfo->
Id);
1581 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has wrong `SpellTypeMask` set: {}", spellInfo->
Id, procEntry.
SpellTypeMask);
1583 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has `SpellTypeMask` value defined, but it will not be used for the defined `ProcFlags` value.", spellInfo->
Id);
1585 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} doesn't have any `SpellPhaseMask` value defined, but it is required for the defined `ProcFlags` value. Proc will not be triggered.", spellInfo->
Id);
1587 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has wrong `SpellPhaseMask` set: {}", spellInfo->
Id, procEntry.
SpellPhaseMask);
1589 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has a `SpellPhaseMask` value defined, but it will not be used for the defined `ProcFlags` value.", spellInfo->
Id);
1591 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has wrong `HitMask` set: {}", spellInfo->
Id, procEntry.
HitMask);
1593 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has `HitMask` value defined, but it will not be used for defined `ProcFlags` and `SpellPhaseMask` values.", spellInfo->
Id);
1595 if ((procEntry.
DisableEffectsMask & (1u << spellEffectInfo.EffectIndex)) && !spellEffectInfo.IsAura())
1596 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has DisableEffectsMask with effect {}, but effect {} is not an aura effect", spellInfo->
Id,
static_cast<uint32>(spellEffectInfo.EffectIndex),
static_cast<uint32>(spellEffectInfo.EffectIndex));
1602 if (!spellEffectInfo.IsAura())
1613 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has Attribute PROC_ATTR_REQ_SPELLMOD, but spell has no spell mods. Proc will not be triggered", spellInfo->
Id);
1624 }
while (result->NextRow());
1627 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
1645 isTriggerAura[i] =
false;
1646 isAlwaysTriggeredAura[i] =
false;
1710 TC_LOG_INFO(
"server.loading",
"Generating spell proc data from SpellMap...");
1724 if (!spellInfo->ProcFlags)
1727 bool addTriggerFlag =
false;
1730 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1732 if (!spellEffectInfo.IsEffect())
1735 uint32 auraName = spellEffectInfo.ApplyAuraName;
1739 if (!isTriggerAura[auraName])
1742 nonProcMask |= 1 << spellEffectInfo.EffectIndex;
1746 procSpellTypeMask |= spellTypeMask[auraName];
1747 if (isAlwaysTriggeredAura[auraName])
1748 addTriggerFlag =
true;
1758 addTriggerFlag =
true;
1766 if (!procSpellTypeMask)
1768 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1770 if (spellEffectInfo.IsAura())
1772 TC_LOG_ERROR(
"sql.sql",
"Spell Id {} has DBC ProcFlags {}, but it's of non-proc aura type, it probably needs an entry in `spell_proc` table to be handled correctly.", spellInfo->Id, spellInfo->ProcFlags);
1782 procEntry.
ProcFlags = spellInfo->ProcFlags;
1784 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1785 if (spellEffectInfo.IsEffect() && isTriggerAura[spellEffectInfo.ApplyAuraName])
1795 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1797 if (!spellEffectInfo.IsAura())
1800 switch (spellEffectInfo.ApplyAuraName)
1817 if (spellEffectInfo.CalcValue() <= -100)
1834 procEntry.
Chance = spellInfo->ProcChance;
1835 procEntry.
Cooldown = Milliseconds::zero();
1836 procEntry.
Charges = spellInfo->ProcCharges;
1852 QueryResult result =
WorldDatabase.Query(
"SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
1855 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
1862 Field* fields = result->Fetch();
1868 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_bonus_data` does not exist.", entry);
1879 }
while (result->NextRow());
1894 TC_LOG_INFO(
"server.loading",
">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
1901 Field* fields = result->Fetch();
1907 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_threat` does not exist.", entry);
1918 }
while (result->NextRow());
1958 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
1965 Field* fields = result->Fetch();
1974 itr->second.AddAura(pet, aura);
1980 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_pet_auras` does not exist.", spell);
1987 TC_LOG_ERROR(
"spells",
"The spell {} listed in `spell_pet_auras` does not have any dummy aura or dummy effect.", spell);
1994 TC_LOG_ERROR(
"sql.sql",
"The aura {} listed in `spell_pet_auras` does not exist.", aura);
2003 }
while (result->NextRow());
2031 uint32 enchId = spellEffectInfo.MiscValue;
2052 QueryResult result =
WorldDatabase.Query(
"SELECT EnchantID, Chance, ProcsPerMinute, HitMask, AttributesMask FROM spell_enchant_proc_data");
2055 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
2062 Field* fields = result->Fetch();
2069 TC_LOG_ERROR(
"sql.sql",
"The enchancment {} listed in `spell_enchant_proc_data` does not exist.", enchantId);
2082 }
while (result->NextRow());
2097 TC_LOG_INFO(
"server.loading",
">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
2104 Field* fields = result->Fetch();
2113 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_linked_spell` does not exist.", abs(trigger));
2120 if (spellEffectInfo.CalcValue() == abs(effect))
2121 TC_LOG_ERROR(
"sql.sql",
"The spell {} Effect: {} listed in `spell_linked_spell` has same bp{} like effect (possible hack).", abs(trigger), abs(effect),
uint32(spellEffectInfo.EffectIndex));
2127 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_linked_spell` does not exist.", abs(effect));
2141 }
while (result->NextRow());
2158 if (!creatureFamily)
2161 for (
uint8 j = 0; j < 2; ++j)
2167 if (!skillLineAbilities)
2183 if (spellSet.empty())
2186 spellSet.insert(PetLevelupSpellSet::value_type(spell->
SpellLevel, spell->
Id));
2192 TC_LOG_INFO(
"server.loading",
">> Loaded {} pet levelup and default spells for {} families in {} ms", count, family_count,
GetMSTimeDiffToNow(oldMSTime));
2198 bool have_spell =
false;
2218 for (PetLevelupSpellSet::const_iterator itr = levelupSpells->begin(); itr != levelupSpells->end(); ++itr)
2220 if (itr->second == petDefSpells.
spellid[j])
2249 uint32 countCreature = 0;
2253 for (
auto const& creatureTemplatePair : ctc)
2255 if (!creatureTemplatePair.second.PetSpellDataId)
2260 if (!spellDataEntry)
2263 int32 petSpellsId = -
int32(creatureTemplatePair.second.PetSpellDataId);
2275 TC_LOG_INFO(
"server.loading",
">> Loaded addition spells for {} pet spell data entries in {} ms", countData,
GetMSTimeDiffToNow(oldMSTime));
2277 TC_LOG_INFO(
"server.loading",
"Loading summonable creature templates...");
2291 uint32 creature_id = spellEffectInfo.MiscValue;
2332 QueryResult result =
WorldDatabase.Query(
"SELECT spell, area, quest_start, quest_start_status, quest_end_status, quest_end, aura_spell, racemask, gender, autocast FROM spell_area");
2335 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
2343 Field* fields = result->Fetch();
2365 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` does not exist", spell);
2372 for (SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr)
2374 if (spellArea.
spellId != itr->second.spellId)
2376 if (spellArea.
areaId != itr->second.areaId)
2378 if (spellArea.
questStart != itr->second.questStart)
2380 if (spellArea.
auraSpell != itr->second.auraSpell)
2382 if ((spellArea.
raceMask & itr->second.raceMask) == 0)
2384 if (spellArea.
gender != itr->second.gender)
2394 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` is already listed with similar requirements.", spell);
2401 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has a wrong area ({}) requirement.", spell, spellArea.
areaId);
2407 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has a wrong start quest ({}) requirement.", spell, spellArea.
questStart);
2415 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has a wrong ending quest ({}) requirement.", spell, spellArea.
questEnd);
2425 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has wrong aura spell ({}) requirement", spell, abs(spellArea.
auraSpell));
2431 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has aura spell ({}) requirement for itself", spell, abs(spellArea.
auraSpell));
2440 for (SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
2442 if (itr->second->autocast && itr->second->auraSpell > 0)
2451 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has the aura spell ({}) requirement that it autocasts itself from the aura.", spell, spellArea.
auraSpell);
2456 for (SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
2458 if (itr2->second.autocast && itr2->second.auraSpell > 0)
2467 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has the aura spell ({}) requirement that the spell itself autocasts from the aura.", spell, spellArea.
auraSpell);
2475 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has wrong race mask ({}) requirement.", spell, spellArea.
raceMask);
2481 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has wrong gender ({}) requirement.", spell, spellArea.
gender);
2514 }
while (result->NextRow());
2537 ASSERT(spellEffectInfo.Effect <
TOTAL_SPELL_EFFECTS,
"TOTAL_SPELL_EFFECTS must be at least %u", spellEffectInfo.Effect + 1);
2538 ASSERT(spellEffectInfo.ApplyAuraName <
TOTAL_AURAS,
"TOTAL_AURAS must be at least %u", spellEffectInfo.ApplyAuraName + 1);
2539 ASSERT(spellEffectInfo.TargetA.GetTarget() <
TOTAL_SPELL_TARGETS,
"TOTAL_SPELL_TARGETS must be at least %u", spellEffectInfo.TargetA.GetTarget() + 1);
2540 ASSERT(spellEffectInfo.TargetB.GetTarget() <
TOTAL_SPELL_TARGETS,
"TOTAL_SPELL_TARGETS must be at least %u", spellEffectInfo.TargetB.GetTarget() + 1);
2565 uint32 oldMSTime2 = oldMSTime;
2570 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell custom attributes from DB. DB table `spell_custom_attr` is empty.");
2576 Field* fields = result->Fetch();
2584 TC_LOG_ERROR(
"sql.sql",
"Table `spell_custom_attr` has wrong spell (entry: {}), ignored.", spellId);
2592 if (spellEffectInfo.IsEffect())
2597 TC_LOG_ERROR(
"sql.sql",
"Table `spell_custom_attr` has attribute SPELL_ATTR0_CU_NEGATIVE_EFF{} for spell {} with no EFFECT_{}",
uint32(spellEffectInfo.EffectIndex), spellId,
uint32(spellEffectInfo.EffectIndex));
2605 }
while (result->NextRow());
2615 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
2618 if (spellInfo->GetEffectMechanicMask(spellEffectInfo.EffectIndex) & (1 <<
MECHANIC_BLEED))
2621 switch (spellEffectInfo.ApplyAuraName)
2635 switch (spellEffectInfo.ApplyAuraName)
2652 switch (spellEffectInfo.Effect)
2670 switch (spellEffectInfo.Effect)
2708 uint32 enchantId = spellEffectInfo.MiscValue;
2741 bool setFlag =
false;
2742 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
2744 if (spellEffectInfo.IsEffect())
2746 switch (spellEffectInfo.Effect)
2781 if (spellInfo->Id == 69649 || spellInfo->Id == 71056 || spellInfo->Id == 71057 || spellInfo->Id == 71058 || spellInfo->Id == 73061 || spellInfo->Id == 73062 || spellInfo->Id == 73063 || spellInfo->Id == 73064)
2785 if (spellInfo->SpellFamilyName ==
SPELLFAMILY_MAGE && (spellInfo->SpellFamilyFlags[0] & 0x20))
2789 if (spellInfo->Id == 55095)
2793 if (spellInfo->SpellFamilyName ==
SPELLFAMILY_WARLOCK && (spellInfo->SpellFamilyFlags[1] & 0x40000))
2813 spellInfo->SchoolMask &= ~SPELL_SCHOOL_MASK_NORMAL;
2817 spellInfo->_InitializeSpellPositivity();
2822 if (spellInfo->SpellVisual[0] == 3879)
2825 switch (spellInfo->SpellFamilyName)
2829 if (spellInfo->SpellFamilyFlags[0] & 0x20000)
2834 if (spellInfo->SpellFamilyFlags[0] & 0x8)
2839 if (spellInfo->Id == 5729)
2846 spellInfo->_InitializeExplicitTargetMask();
2848 if (spellInfo->Speed > 0.0f)
2850 if (spellVisual->HasMissile)
2851 if (spellVisual->MissileModel == -4 || spellVisual->MissileModel == -5)
2865 bool allNonBinary =
true;
2866 bool overrideAttr =
false;
2867 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
2869 if (spellEffectInfo.IsAura() && spellEffectInfo.TriggerSpell)
2871 switch (spellEffectInfo.ApplyAuraName)
2876 if (
SpellInfo const* triggerSpell =
sSpellMgr->GetSpellInfo(spellEffectInfo.TriggerSpell))
2878 overrideAttr =
true;
2880 allNonBinary =
false;
2889 if (overrideAttr && allNonBinary)
2890 spellInfo->AttributesCu &= ~SPELL_ATTR0_CU_BINARY_SPELL;
2906 if (
uint32 spellId = liquid->SpellID)
2916 for (
uint32 spellId : spellIds)
2921 TC_LOG_ERROR(
"server.loading",
"Spell info correction specified for non-existing spell {}", spellId);
2962 spellInfo->_GetEffect(
EFFECT_1).ApplyAuraPeriod = spellInfo->GetEffect(
EFFECT_0).ApplyAuraPeriod;
2991 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 23171;
2997 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 29916;
3003 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 38530;
3009 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 39856;
3015 spellInfo->_GetEffect(
EFFECT_1).TriggerSpell = 46737;
3032 spellInfo->EquippedItemClass = -1;
3059 spellInfo->_GetEffect(
EFFECT_0).BonusCoefficient = spellInfo->GetEffect(
EFFECT_1).BonusCoefficient;
3066 spellInfo->ManaCost = 0;
3067 spellInfo->ManaPerSecond = 0;
3089 spellInfo->_GetEffect(
EFFECT_0).MiscValueB = 64;
3098 spellInfo->SpellFamilyFlags =
flag96();
3141 spellInfo->Priority = 100;
3158 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 36325;
3183 spellInfo->ProcChance = 0;
3196 spellInfo->EquippedItemSubClassMask = 0x0000FC33;
3238 spellInfo->SpellLevel = 0;
3313 spellInfo->MaxAffectedTargets = 1;
3321 spellInfo->MaxAffectedTargets = 2;
3340 spellInfo->MaxAffectedTargets = 3;
3348 spellInfo->MaxAffectedTargets = 4;
3362 spellInfo->MaxAffectedTargets = 5;
3374 spellInfo->MaxAffectedTargets = 10;
3381 spellInfo->MaxAffectedTargets = 15;
3418 spellInfo->_GetEffect(
EFFECT_1).MiscValue = 127;
3425 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(685904631, 1151048, 0);
3431 spellInfo->ProcCharges = 0;
3450 spellInfo->_GetEffect(
EFFECT_1).SpellClassMask[0] |= 2;
3460 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask[0] |= 0x800;
3466 spellInfo->_GetEffect(
EFFECT_0).ApplyAuraPeriod = 3000;
3524 spellInfo->Attributes &= ~SPELL_ATTR0_NOT_SHAPESHIFT;
3542 spellInfo->_GetEffect(
EFFECT_2).BasePoints += 30000;
3554 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_STACK_FOR_DIFF_CASTERS;
3561 spellInfo->SpellFamilyFlags[2] = 0x10;
3614 spellInfo->_GetEffect(
EFFECT_1).BasePoints = -6;
3649 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_FIXED_DAMAGE;
3692 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x00067801, 0x10820001, 0x00000801);
3718 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x00000040, 0x00000000, 0x00000000);
3724 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x00000000, 0x02000000, 0x00000000);
3734 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x80000000, 0x00000000, 0x00000000);
3744 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x40000000, 0x00000000, 0x00000000);
3752 spellInfo->_GetEffect(
EFFECT_0).BasePoints = 0;
3761 spellInfo->_GetEffect(
EFFECT_0).BasePoints = 100;
3813 spellInfo->_GetEffect(
EFFECT_0).BasePoints = 1;
3819 spellInfo->_GetEffect(
EFFECT_0).DieSides = 0;
3860 spellInfo->ExcludeTargetAuraSpell = 72232;
3884 spellInfo->InterruptFlags &= ~AURA_INTERRUPT_FLAG_CAST;
3912 spellInfo->Speed = 0.f;
3953 spellInfo->RecoveryTime = 0;
3961 spellInfo->RecoveryTime = 3000;
3967 spellInfo->RecoveryTime = 2000;
3975 spellInfo->RecoveryTime = 6000;
3984 spellInfo->RecoveryTime = 10000;
3992 spellInfo->RecoveryTime = 12000;
3998 spellInfo->RecoveryTime = 15000;
4007 spellInfo->RecoveryTime = 20000;
4046 spellInfo->MaxAffectedTargets = 1;
4065 spellInfo->MaxAffectedTargets = 1;
4104 spellInfo->ChannelInterruptFlags = 0;
4110 spellInfo->Speed = 0;
4122 spellInfo->MaxAffectedTargets = 3;
4128 spellInfo->MaxAffectedTargets = 1;
4134 spellInfo->MaxAffectedTargets = 3;
4242 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_IGNORE_RESISTANCES;
4254 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_NO_INITIAL_AGGRO;
4355 spellInfo->RequiredAreasID = 0;
4407 spellInfo->Speed = 0.0f;
4508 spellInfo->MaxAffectedTargets = 1;
4515 spellInfo->MaxAffectedTargets = 3;
4546 spellInfo->MaxAffectedTargets = 3;
4555 spellInfo->_GetEffect(
EFFECT_0).MiscValue = 190;
4665 spellInfo->ManaCost = 0;
4666 spellInfo->ManaPerSecond = 0;
4692 spellInfo->_GetEffect(
EFFECT_0).ApplyAuraPeriod = 0;
4693 spellInfo->ProcChance = 10;
4851 spellInfo->ProcFlags = 0;
4876 spellInfo->_GetEffect(
EFFECT_1).SpellClassMask[0] |= 0x00004000;
4902 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65410;
4908 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65416;
4914 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65412;
4920 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65415;
4926 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65414;
4942 spellInfo->_GetEffect(
EFFECT_1).TriggerSpell = 24870;
4960 float maxRangeTrigger = spellInfoTrigger->RangeEntry ? spellInfoTrigger->RangeEntry->RangeMax[0] : 0.0f;
4963 if (maxRangeTrigger < maxRangeMain)
4964 spellInfoTrigger->RangeEntry = spellInfo->
RangeEntry;
4971 switch (spellEffectInfo.Effect)
4996 if (spellEffectInfo.IsAreaAuraEffect() && spellEffectInfo.IsTargetingArea())
5052 spellInfo->_LoadSpellSpecific();
5053 spellInfo->_LoadAuraState();
5068 spellInfo->_LoadSpellDiminishInfo();
5083 spellInfo->_LoadImmunityInfo();
@ BATTLEFIELD_BATTLEID_WG
@ ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL
@ DUNGEON_DIFFICULTY_HEROIC
#define MAX_SPELL_REAGENTS
@ SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< SpellRadiusEntry > sSpellRadiusStore(SpellRadiusfmt)
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
std::vector< SkillLineAbilityEntry const * > const * GetSkillLineAbilitiesBySkill(uint32 skillLine)
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
TalentSpellPos const * GetTalentSpellPos(uint32 spellId)
DBCStorage< CreatureSpellDataEntry > sCreatureSpellDataStore(CreatureSpellDatafmt)
DBCStorage< SpellCastTimesEntry > sSpellCastTimesStore(SpellCastTimefmt)
DBCStorage< SpellRangeEntry > sSpellRangeStore(SpellRangefmt)
uint32 GetTalentSpellCost(uint32 spellId)
DBCStorage< SpellDifficultyEntry > sSpellDifficultyStore(SpellDifficultyfmt)
DBCStorage< SpellVisualEntry > sSpellVisualStore(SpellVisualfmt)
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
DBCStorage< SpellDurationEntry > sSpellDurationStore(SpellDurationfmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
DBCStorage< SkillLineAbilityEntry > sSkillLineAbilityStore(SkillLineAbilityfmt)
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
#define MAX_ITEM_ENCHANTMENT_EFFECTS
std::shared_ptr< ResultSet > QueryResult
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
std::unordered_map< uint32, CreatureTemplate > CreatureTemplateContainer
@ SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER
@ SPELL_EFFECT_POWER_BURN
@ SPELL_EFFECT_ENERGIZE_PCT
@ SPELL_EFFECT_SUMMON_PET
@ SPELL_EFFECT_APPLY_AREA_AURA_PARTY
@ SPELL_EFFECT_APPLY_AREA_AURA_FRIEND
@ SPELL_EFFECT_TRIGGER_SPELL_WITH_VALUE
@ SPELL_EFFECT_ENCHANT_HELD_ITEM
@ SPELL_EFFECT_ENCHANT_ITEM
@ SPELL_EFFECT_HEALTH_LEECH
@ SPELL_EFFECT_WEAPON_DAMAGE
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
@ SPELL_EFFECT_TRIGGER_SPELL
@ SPELL_EFFECT_HEAL_MAX_HEALTH
@ SPELL_EFFECT_APPLY_AREA_AURA_PET
@ SPELL_EFFECT_PICKPOCKET
@ SPELL_EFFECT_HEAL_MECHANICAL
@ SPELL_EFFECT_WEAPON_PERCENT_DAMAGE
@ SPELL_EFFECT_MODIFY_THREAT_PERCENT
@ SPELL_EFFECT_APPLY_AREA_AURA_RAID
@ SPELL_EFFECT_CREATE_ITEM_2
@ SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_EFFECT_DUAL_WIELD
@ SPELL_EFFECT_POWER_DRAIN
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_CHARGE_DEST
@ SPELL_EFFECT_LEARN_SPELL
@ SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
@ SPELL_EFFECT_INTERRUPT_CAST
@ SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
@ SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
@ SPELL_EFFECT_SKILL_STEP
@ SPELL_EFFECT_CREATE_ITEM
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_EFFECT_APPLY_AREA_AURA_OWNER
@ SKILL_CATEGORY_PROFESSION
@ SPELL_ATTR5_DONT_TURN_DURING_CAST
@ SPELL_ATTR5_START_PERIODIC_AT_APPLY
@ TARGET_DEST_CASTER_LEFT
@ TARGET_UNIT_CASTER_AREA_PARTY
@ TARGET_UNIT_SRC_AREA_ENTRY
@ TARGET_UNIT_SRC_AREA_ALLY
@ TARGET_UNIT_TARGET_ALLY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ TARGET_UNIT_TARGET_ENEMY
@ TARGET_UNIT_NEARBY_ENTRY
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_SCHOOL_MASK_MAGIC
@ SPELL_ATTR2_CAN_TARGET_DEAD
@ SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA
@ SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS
@ SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY
@ SPELL_ATTR1_CANT_TARGET_SELF
@ SPELL_ATTR3_STACK_FOR_DIFF_CASTERS
@ SPELL_ATTR3_DEATH_PERSISTENT
@ SPELL_ATTR3_NO_DONE_BONUS
@ SPELL_ATTR3_NO_INITIAL_AGGRO
@ SPELL_ATTR3_CAN_PROC_FROM_PROCS
@ SPELL_ATTR3_CANT_TRIGGER_PROC
@ SPELL_ATTR3_IGNORE_HIT_RESULT
@ SPELL_DAMAGE_CLASS_MAGIC
#define MAX_CREATURE_SPELL_DATA_SLOT
@ SPELLFAMILY_DEATHKNIGHT
@ SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY
@ SPELL_ATTR0_CANT_CANCEL
@ SPELL_ATTR0_NOT_SHAPESHIFT
#define RACEMASK_ALL_PLAYABLE
@ SPELL_ATTR4_FIXED_DAMAGE
@ SPELL_ATTR6_CAN_TARGET_INVISIBLE
@ SPELL_ATTR6_LIMIT_PCT_DAMAGE_MODS
@ SPELL_AURA_MOD_ATTACK_POWER
@ SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_ABILITY_IGNORE_AURASTATE
@ SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
@ SPELL_AURA_ADD_PCT_MODIFIER
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_MOD_RESISTANCE
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_CONVERT_RUNE
@ SPELL_AURA_ADD_CASTER_HIT_TRIGGER
@ SPELL_AURA_ADD_FLAT_MODIFIER
@ SPELL_AURA_REFLECT_SPELLS
@ SPELL_AURA_CONTROL_VEHICLE
@ SPELL_AURA_MOD_MELEE_HASTE
@ SPELL_AURA_MOD_SPELL_CRIT_CHANCE
@ SPELL_AURA_MOD_INVISIBILITY
@ SPELL_AURA_MOD_HIT_CHANCE
@ SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_MOD_RANGED_HASTE
@ SPELL_AURA_MOD_POWER_COST_SCHOOL
@ SPELL_AURA_RAID_PROC_FROM_CHARGE
@ SPELL_AURA_MOD_DAMAGE_TAKEN
@ SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE
@ SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
@ SPELL_AURA_SPELL_MAGNET
@ SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_PROC_TRIGGER_DAMAGE
@ SPELL_AURA_DAMAGE_IMMUNITY
@ SPELL_AURA_MOD_DAMAGE_DONE
@ SPELL_AURA_REFLECT_SPELLS_SCHOOL
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@ SPELL_AURA_FORCE_REACTION
@ SPELL_AURA_MOD_MELEE_RANGED_HASTE
@ SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELL_AURA_MOD_ATTACK_POWER_PCT
@ SPELL_AURA_MOD_BLOCK_PERCENT
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
@ AURA_INTERRUPT_FLAG_CAST
@ AURA_INTERRUPT_FLAG_HITBYSPELL
@ AURA_INTERRUPT_FLAG_MOVE
@ AURA_INTERRUPT_FLAG_JUMP
@ SPELL_ATTR0_CU_IGNORE_ARMOR
@ SPELL_ATTR0_CU_ENCHANT_PROC
@ SPELL_ATTR0_CU_DIRECT_DAMAGE
@ SPELL_ATTR0_CU_CAN_CRIT
@ SPELL_ATTR0_CU_CONE_BACK
@ SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED
@ SPELL_ATTR0_CU_NEGATIVE
@ SPELL_ATTR0_CU_NEEDS_AMMO_DATA
@ SPELL_ATTR0_CU_NEGATIVE_EFF0
@ SPELL_ATTR0_CU_BINARY_SPELL
@ SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC
@ SPELL_ATTR0_CU_PICKPOCKET
@ SPELL_ATTR0_CU_NO_INITIAL_THREAT
@ SPELL_ATTR0_CU_IS_TALENT
bool IsPrimaryProfessionSkill(uint32 skill)
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
bool LoadPetDefaultSpells_helper(CreatureTemplate const *cInfo, PetDefaultSpellsEntry &petDefSpells)
void ApplySpellFix(std::initializer_list< uint32 > spellIds, void(*fix)(SpellInfo *))
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
std::pair< SpellsRequiringSpellMap::const_iterator, SpellsRequiringSpellMap::const_iterator > SpellsRequiringSpellMapBounds
std::pair< SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator > SpellSpellGroupMapBounds
std::pair< SpellAreaMap::const_iterator, SpellAreaMap::const_iterator > SpellAreaMapBounds
@ SPELL_GROUP_CORE_RANGE_MAX
std::pair< SpellAreaForAreaMap::const_iterator, SpellAreaForAreaMap::const_iterator > SpellAreaForAreaMapBounds
@ PROC_ATTR_REQ_MANA_COST
@ PROC_ATTR_REQ_EXP_OR_HONOR
@ PROC_ATTR_TRIGGERED_CAN_PROC
@ SPELL_GROUP_STACK_RULE_DEFAULT
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT
@ SPELL_GROUP_STACK_RULE_MAX
std::pair< SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_iterator > SpellGroupSpellMapBounds
std::pair< SpellAreaForAuraMap::const_iterator, SpellAreaForAuraMap::const_iterator > SpellAreaForAuraMapBounds
std::pair< SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator > SkillLineAbilityMapBounds
@ PROC_SPELL_TYPE_MASK_ALL
@ PROC_SPELL_TYPE_NO_DMG_HEAL
@ EFFECT_RADIUS_100_YARDS
@ EFFECT_RADIUS_50000_YARDS
@ EFFECT_RADIUS_200_YARDS
@ EFFECT_RADIUS_150_YARDS
@ PROC_SPELL_PHASE_FINISH
@ PROC_SPELL_PHASE_MASK_ALL
@ TAKEN_HIT_PROC_FLAG_MASK
@ REQ_SPELL_PHASE_PROC_FLAG_MASK
@ DONE_HIT_PROC_FLAG_MASK
std::pair< SpellAreaForQuestMap::const_iterator, SpellAreaForQuestMap::const_iterator > SpellAreaForQuestMapBounds
std::pair< SpellLearnSpellMap::const_iterator, SpellLearnSpellMap::const_iterator > SpellLearnSpellMapBounds
#define SPELL_LINKED_MAX_SPELLS
std::multimap< uint32, uint32 > PetLevelupSpellSet
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
bool CanFlyIn()
Return if we can use mount in battlefield.
virtual uint32 GetData(uint32 dataId) const override
void PSendSysMessage(char const *fmt, Args &&... args)
Class used to access individual fields of database query result.
uint8 GetSpawnMode() const
bool IsBattleground() const
static Player * ToPlayer(Object *o)
Gender GetNativeGender() const override
WorldSession * GetSession() const
Battleground * GetBattleground() const
QuestStatus GetQuestStatus(uint32 quest_id) const
uint32 GetHitMask() const
SpellSchoolMask GetSchoolMask() const
Unit * GetActionTarget() const
uint32 GetSpellTypeMask() const
uint32 GetTypeMask() const
SpellInfo const * GetSpellInfo() const
uint32 GetSpellPhaseMask() const
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr) const
SpellImplicitTargetInfo TargetA
SpellImplicitTargetInfo TargetB
Targets GetTarget() const
bool IsRankOf(SpellInfo const *spellInfo) const
std::array< int32, MAX_SPELL_REAGENTS > Reagent
SpellInfo const * GetFirstRankSpell() const
SpellEffectInfo & _GetEffect(SpellEffIndex index)
SpellRangeEntry const * RangeEntry
bool IsLootCrafting() const
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > & _GetEffects()
bool HasAttribute(SpellAttr0 attribute) const
SpellEffectInfo const & GetEffect(SpellEffIndex index) const
SpellInfo const * GetNextRankSpell() const
bool HasEffect(SpellEffects effect) const
bool HasAura(AuraType aura) const
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > const & GetEffects() const
SpellRequiredMap mSpellReq
static bool CanSpellTriggerProcOnEvent(SpellProcEntry const &procEntry, ProcEventInfo &eventInfo)
SpellLinkedMap mSpellLinkedMap
SpellInfo const * AssertSpellInfo(uint32 spellId) const
SpellGroupStackRule GetSpellGroupStackRule(SpellGroup groupid) const
SkillLineAbilityMap mSkillLineAbilityMap
SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const
EnchantCustomAttribute mEnchantCustomAttr
void SetSpellDifficultyId(uint32 spellId, uint32 id)
SpellLearnSpellMapBounds GetSpellLearnSpellMapBounds(uint32 spell_id) const
PetLevelupSpellSet const * GetPetLevelupSpellList(uint32 petFamily) const
void LoadSpellInfoStore()
SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const
SpellAreaForAuraMap mSpellAreaForAuraMap
SpellChainMap mSpellChains
void LoadEnchantCustomAttr()
void UnloadSpellInfoStore()
uint32 GetNextSpellInChain(uint32 spell_id) const
static SpellMgr * instance()
SpellPetAuraMap mSpellPetAuraMap
SpellLearnSkillMap mSpellLearnSkills
SpellInfo const * GetSpellForDifficultyFromSpell(SpellInfo const *spell, WorldObject const *caster) const
SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id) const
SpellBonusEntry const * GetSpellBonusData(uint32 spellId) const
void LoadSkillLineAbilityMap()
SkillLineAbilityMapBounds GetSkillLineAbilityMapBounds(uint32 spell_id) const
SpellAreaForQuestMap mSpellAreaForQuestEndMap
SpellGroupSpellMapBounds GetSpellGroupSpellMapBounds(SpellGroup group_id) const
PetDefaultSpellsMap mPetDefaultSpellsMap
uint32 GetSpellWithRank(uint32 spell_id, uint32 rank, bool strict=false) const
SpellLearnSkillNode const * GetSpellLearnSkill(uint32 spell_id) const
void LoadSpellInfoCustomAttributes()
SpellInfo const * GetSpellInfo(uint32 spellId) const
uint32 GetPrevSpellInChain(uint32 spell_id) const
bool IsSpellRequiringSpell(uint32 spellid, uint32 req_spellid) const
bool IsSpellLearnToSpell(uint32 spell_id1, uint32 spell_id2) const
SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const
void LoadSpellInfoDiminishing()
void LoadSpellTargetPositions()
SpellDifficultySearcherMap mSpellDifficultySearcherMap
void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set< uint32 > &foundSpells) const
void LoadSpellInfoImmunities()
void LoadSpellLearnSkills()
uint32 GetLastSpellInChain(uint32 spell_id) const
void LoadSpellTalentRanks()
bool IsSpellLearnSpell(uint32 spell_id) const
SpellThreatEntry const * GetSpellThreatEntry(uint32 spellID) const
void LoadSpellGroupStackRules()
SpellGroupStackMap mSpellGroupStack
uint32 GetSpellIdForDifficulty(uint32 spellId, WorldObject const *caster) const
uint32 GetFirstSpellInChain(uint32 spell_id) const
SpellEnchantProcEventMap mSpellEnchantProcEventMap
void LoadPetDefaultSpells()
PetLevelupSpellMap mPetLevelupSpellMap
void LoadSpellLearnSpells()
Trinity::IteratorPair< SpellRequiredMap::const_iterator > GetSpellsRequiredForSpellBounds(uint32 spell_id) const
SpellGroupStackRule CheckSpellGroupStackRules(SpellInfo const *spellInfo1, SpellInfo const *spellInfo2) const
SpellProcMap mSpellProcMap
SpellsRequiringSpellMap mSpellsReqSpell
void LoadSpellInfoCorrections()
SpellTargetPositionMap mSpellTargetPositions
SpellProcEntry const * GetSpellProcEntry(uint32 spellId) const
SpellGroupSpellMap mSpellGroupSpell
PetDefaultSpellsEntry const * GetPetDefaultSpellsEntry(int32 id) const
SpellTargetPosition const * GetSpellTargetPosition(uint32 spell_id, SpellEffIndex effIndex) const
SameEffectStackMap mSpellSameEffectStack
std::vector< int32 > const * GetSpellLinked(int32 spell_id) const
SpellEnchantProcEntry const * GetSpellEnchantProcEvent(uint32 enchId) const
SpellAreaForAreaMap mSpellAreaForAreaMap
uint32 GetSpellDifficultyId(uint32 spellId) const
static bool IsSpellValid(SpellInfo const *spellInfo, Player *player=nullptr, bool msg=true)
Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book,...
uint8 GetSpellRank(uint32 spell_id) const
void UnloadSpellInfoImplicitTargetConditionLists()
SpellSpellGroupMapBounds GetSpellSpellGroupMapBounds(uint32 spell_id) const
SpellAreaMap mSpellAreaMap
void LoadSpellEnchantProcData()
uint32 GetSpellInfoStoreSize() const
SpellBonusMap mSpellBonusMap
SpellChainNode const * GetSpellChainNode(uint32 spell_id) const
SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds(uint32 spell_id) const
bool AddSameEffectStackRuleSpellGroups(SpellInfo const *spellInfo, uint32 auraType, int32 amount, std::map< SpellGroup, int32 > &groups) const
void LoadPetLevelupSpellMap()
SpellLearnSpellMap mSpellLearnSpells
void LoadSpellInfoSpellSpecificAndAuraState()
SpellSpellGroupMap mSpellSpellGroup
PetAura const * GetPetAura(uint32 spell_id, uint8 eff) const
SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds(uint32 area_id) const
bool IsArenaAllowedEnchancment(uint32 ench_id) const
SpellThreatMap mSpellThreatMap
SpellAreaForQuestMap mSpellAreaForQuestMap
SpellInfoMap mSpellInfoMap
SpellInfo * _GetSpellInfo(uint32 spellId)
void UnloadSpellInfoChains()
bool IsSpellMemberOfSpellGroup(uint32 spellid, SpellGroup groupid) const
Utility class to enable range for loop syntax for multimap.equal_range uses.
uint32 GetRaceMask() const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
bool HasAuraType(AuraType auraType) const
auto MapEqualRange(M &map, typename M::key_type const &key)
auto MapGetValuePtr(M &map, typename M::key_type const &key)
uint32 Spells[MAX_CREATURE_SPELL_DATA_SLOT]
uint32 spells[MAX_CREATURE_SPELLS]
uint32 spellid[MAX_CREATURE_SPELL_DATA_SLOT]
bool IsFitToRequirements(Player const *player, uint32 newZone, uint32 newArea) const
int32 DifficultySpellID[MAX_DIFFICULTY]
uint32 Effect[MAX_ITEM_ENCHANTMENT_EFFECTS]
uint32 EffectArg[MAX_ITEM_ENCHANTMENT_EFFECTS]
uint32 DisableEffectsMask
std::array< uint32, MAX_TALENT_RANK > SpellRank