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);
1100 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_learn_spell` learning non-existing spell {}.", spell_id, node.
spell);
1106 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_learn_spell` attempts learning talent spell {}, skipped.", spell_id, node.
spell);
1113 }
while (result->NextRow());
1129 dbc_node.
spell = spellEffectInfo.TriggerSpell;
1144 for (SpellLearnSpellMap::const_iterator itr = db_node_bounds.first; itr != db_node_bounds.second; ++itr)
1146 if (itr->second.spell == dbc_node.
spell)
1148 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.",
1149 spell, dbc_node.
spell);
1164 TC_LOG_INFO(
"server.loading",
">> Loaded {} spell learn spells + {} found in DBC in {} ms", count, dbc_count,
GetMSTimeDiffToNow(oldMSTime));
1174 QueryResult result =
WorldDatabase.Query(
"SELECT ID, EffectIndex, MapID, PositionX, PositionY, PositionZ, Orientation FROM spell_target_position");
1177 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
1184 Field* fields = result->Fetch();
1200 TC_LOG_ERROR(
"sql.sql",
"Spell (Id: {}, effIndex: {}) target map (ID: {}) does not exist in `Map.dbc`.", Spell_ID, effIndex, st.
target_mapId);
1206 TC_LOG_ERROR(
"sql.sql",
"Spell (Id: {}, effIndex: {}) target coordinates not provided.", Spell_ID, effIndex);
1213 TC_LOG_ERROR(
"sql.sql",
"Spell (Id: {}) listed in `spell_target_position` does not exist.", Spell_ID);
1219 std::pair<uint32, SpellEffIndex> key = std::make_pair(Spell_ID, effIndex);
1225 TC_LOG_ERROR(
"sql.sql",
"Spell (Id: {}, effIndex: {}) listed in `spell_target_position` does not have a target TARGET_DEST_DB (17).", Spell_ID, effIndex);
1229 }
while (result->NextRow());
1280 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
1284 std::set<uint32> groups;
1288 Field* fields = result->Fetch();
1293 TC_LOG_ERROR(
"sql.sql",
"SpellGroup id {} listed in `spell_group` is in core range, but is not defined in core!", group_id);
1298 groups.insert(group_id);
1301 }
while (result->NextRow());
1305 if (itr->second < 0)
1307 if (groups.find(abs(itr->second)) == groups.end())
1309 TC_LOG_ERROR(
"sql.sql",
"SpellGroup id {} listed in `spell_group` does not exist", abs(itr->second));
1320 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_group` does not exist", itr->second);
1323 else if (spellInfo->
GetRank() > 1)
1325 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_group` is not the first rank of the spell.", itr->second);
1333 for (
auto groupItr = groups.begin(); groupItr != groups.end(); ++groupItr)
1335 std::set<uint32> spells;
1338 for (
auto spellItr = spells.begin(); spellItr != spells.end(); ++spellItr)
1355 std::vector<uint32> sameEffectGroups;
1361 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
1368 Field* fields = result->Fetch();
1374 TC_LOG_ERROR(
"sql.sql",
"SpellGroupStackRule {} listed in `spell_group_stack_rules` does not exist.", stack_rule);
1379 if (bounds.first == bounds.second)
1381 TC_LOG_ERROR(
"sql.sql",
"SpellGroup id {} listed in `spell_group_stack_rules` does not exist.", group_id);
1389 sameEffectGroups.push_back(group_id);
1392 }
while (result->NextRow());
1398 TC_LOG_INFO(
"server.loading",
">> Parsing SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules...");
1400 for (
uint32 group_id : sameEffectGroups)
1402 std::set<uint32> spellIds;
1405 std::unordered_set<uint32> auraTypes;
1409 std::unordered_multiset<
uint32 > frequencyContainer;
1412 std::vector<std::vector<
uint32 >>
const SubGroups =
1417 for (
uint32 spellId : spellIds)
1422 if (!spellEffectInfo.IsAura())
1425 uint32 auraName = spellEffectInfo.ApplyAuraName;
1426 for (std::vector<uint32>
const& subGroup : SubGroups)
1428 if (std::find(subGroup.begin(), subGroup.end(), auraName) != subGroup.end())
1431 auraName = subGroup.front();
1436 frequencyContainer.insert(auraName);
1441 size_t auraTypeCount = 0;
1442 for (
uint32 auraName : frequencyContainer)
1444 size_t currentCount = frequencyContainer.count(auraName);
1445 if (currentCount > auraTypeCount)
1447 auraType = auraName;
1448 auraTypeCount = currentCount;
1452 for (std::vector<uint32>
const& subGroup : SubGroups)
1454 if (auraType == subGroup.front())
1456 auraTypes.insert(subGroup.begin(), subGroup.end());
1461 if (auraTypes.empty())
1462 auraTypes.insert(auraType);
1466 for (
uint32 spellId : spellIds)
1473 for (
uint32 auraType : auraTypes)
1490 TC_LOG_ERROR(
"sql.sql",
"SpellId {} listed in `spell_group` with stack rule 3 does not share aura assigned for group {}", spellId, group_id);
1497 TC_LOG_INFO(
"server.loading",
">> Parsed {} SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT stack rules in {} ms", count,
GetMSTimeDiffToNow(oldMSTime));
1507 QueryResult result =
WorldDatabase.Query(
"SELECT SpellId, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, "
1509 "ProcFlags, SpellTypeMask, SpellPhaseMask, HitMask, AttributesMask, DisableEffectsMask, ProcsPerMinute, Chance, Cooldown, Charges FROM spell_proc");
1516 Field* fields = result->Fetch();
1520 bool allRanks =
false;
1530 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_proc` does not exist", spellId);
1537 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_proc` with all ranks, but spell has no ranks.", spellId);
1541 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_proc` is not the first rank of the spell.", spellId);
1568 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_proc` already has its first rank in the table.", spellInfo->
Id);
1584 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has wrong `SchoolMask` set: {}", spellInfo->
Id, procEntry.
SchoolMask);
1586 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has wrong `SpellFamilyName` set: {}", spellInfo->
Id, procEntry.
SpellFamilyName);
1587 if (procEntry.
Chance < 0)
1589 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has negative value in the `Chance` field", spellInfo->
Id);
1594 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has negative value in the `ProcsPerMinute` field", spellInfo->
Id);
1598 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);
1600 TC_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId {} has wrong `SpellTypeMask` set: {}", spellInfo->
Id, procEntry.
SpellTypeMask);
1602 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);
1604 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);
1606 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has wrong `SpellPhaseMask` set: {}", spellInfo->
Id, procEntry.
SpellPhaseMask);
1608 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);
1610 TC_LOG_ERROR(
"sql.sql",
"The `spell_proc` table entry for spellId {} has wrong `HitMask` set: {}", spellInfo->
Id, procEntry.
HitMask);
1612 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);
1614 if ((procEntry.
DisableEffectsMask & (1u << spellEffectInfo.EffectIndex)) && !spellEffectInfo.IsAura())
1615 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));
1621 if (!spellEffectInfo.IsAura())
1632 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);
1643 }
while (result->NextRow());
1646 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
1664 isTriggerAura[i] =
false;
1665 isAlwaysTriggeredAura[i] =
false;
1729 TC_LOG_INFO(
"server.loading",
"Generating spell proc data from SpellMap...");
1743 if (!spellInfo->ProcFlags)
1746 bool addTriggerFlag =
false;
1749 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1751 if (!spellEffectInfo.IsEffect())
1754 uint32 auraName = spellEffectInfo.ApplyAuraName;
1758 if (!isTriggerAura[auraName])
1761 nonProcMask |= 1 << spellEffectInfo.EffectIndex;
1765 procSpellTypeMask |= spellTypeMask[auraName];
1766 if (isAlwaysTriggeredAura[auraName])
1767 addTriggerFlag =
true;
1777 addTriggerFlag =
true;
1785 if (!procSpellTypeMask)
1787 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1789 if (spellEffectInfo.IsAura())
1791 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);
1801 procEntry.
ProcFlags = spellInfo->ProcFlags;
1803 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1804 if (spellEffectInfo.IsEffect() && isTriggerAura[spellEffectInfo.ApplyAuraName])
1814 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1816 if (!spellEffectInfo.IsAura())
1819 switch (spellEffectInfo.ApplyAuraName)
1836 if (spellEffectInfo.CalcValue() <= -100)
1853 procEntry.
Chance = spellInfo->ProcChance;
1854 procEntry.
Cooldown = Milliseconds::zero();
1855 procEntry.
Charges = spellInfo->ProcCharges;
1871 QueryResult result =
WorldDatabase.Query(
"SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
1874 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
1881 Field* fields = result->Fetch();
1887 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_bonus_data` does not exist.", entry);
1898 }
while (result->NextRow());
1913 TC_LOG_INFO(
"server.loading",
">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
1920 Field* fields = result->Fetch();
1926 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_threat` does not exist.", entry);
1937 }
while (result->NextRow());
1977 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
1984 Field* fields = result->Fetch();
1993 itr->second.AddAura(pet, aura);
1999 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_pet_auras` does not exist.", spell);
2006 TC_LOG_ERROR(
"spells",
"The spell {} listed in `spell_pet_auras` does not have any dummy aura or dummy effect.", spell);
2013 TC_LOG_ERROR(
"sql.sql",
"The aura {} listed in `spell_pet_auras` does not exist.", aura);
2022 }
while (result->NextRow());
2050 uint32 enchId = spellEffectInfo.MiscValue;
2071 QueryResult result =
WorldDatabase.Query(
"SELECT EnchantID, Chance, ProcsPerMinute, HitMask, AttributesMask FROM spell_enchant_proc_data");
2074 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
2081 Field* fields = result->Fetch();
2088 TC_LOG_ERROR(
"sql.sql",
"The enchancment {} listed in `spell_enchant_proc_data` does not exist.", enchantId);
2101 }
while (result->NextRow());
2116 TC_LOG_INFO(
"server.loading",
">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
2123 Field* fields = result->Fetch();
2132 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_linked_spell` does not exist.", abs(trigger));
2139 if (spellEffectInfo.CalcValue() == abs(effect))
2140 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));
2146 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_linked_spell` does not exist.", abs(effect));
2160 }
while (result->NextRow());
2177 if (!creatureFamily)
2180 for (
uint8 j = 0; j < 2; ++j)
2186 if (!skillLineAbilities)
2202 if (spellSet.empty())
2205 spellSet.insert(PetLevelupSpellSet::value_type(spell->
SpellLevel, spell->
Id));
2211 TC_LOG_INFO(
"server.loading",
">> Loaded {} pet levelup and default spells for {} families in {} ms", count, family_count,
GetMSTimeDiffToNow(oldMSTime));
2217 bool have_spell =
false;
2237 for (PetLevelupSpellSet::const_iterator itr = levelupSpells->begin(); itr != levelupSpells->end(); ++itr)
2239 if (itr->second == petDefSpells.
spellid[j])
2268 uint32 countCreature = 0;
2272 for (
auto const& creatureTemplatePair : ctc)
2274 if (!creatureTemplatePair.second.PetSpellDataId)
2279 if (!spellDataEntry)
2282 int32 petSpellsId = -
int32(creatureTemplatePair.second.PetSpellDataId);
2294 TC_LOG_INFO(
"server.loading",
">> Loaded addition spells for {} pet spell data entries in {} ms", countData,
GetMSTimeDiffToNow(oldMSTime));
2296 TC_LOG_INFO(
"server.loading",
"Loading summonable creature templates...");
2310 uint32 creature_id = spellEffectInfo.MiscValue;
2351 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");
2354 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
2362 Field* fields = result->Fetch();
2384 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` does not exist", spell);
2391 for (SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr)
2393 if (spellArea.
spellId != itr->second.spellId)
2395 if (spellArea.
areaId != itr->second.areaId)
2397 if (spellArea.
questStart != itr->second.questStart)
2399 if (spellArea.
auraSpell != itr->second.auraSpell)
2401 if ((spellArea.
raceMask & itr->second.raceMask) == 0)
2403 if (spellArea.
gender != itr->second.gender)
2413 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` is already listed with similar requirements.", spell);
2420 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has a wrong area ({}) requirement.", spell, spellArea.
areaId);
2426 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has a wrong start quest ({}) requirement.", spell, spellArea.
questStart);
2434 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has a wrong ending quest ({}) requirement.", spell, spellArea.
questEnd);
2444 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has wrong aura spell ({}) requirement", spell, abs(spellArea.
auraSpell));
2450 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has aura spell ({}) requirement for itself", spell, abs(spellArea.
auraSpell));
2459 for (SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
2461 if (itr->second->autocast && itr->second->auraSpell > 0)
2470 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);
2475 for (SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
2477 if (itr2->second.autocast && itr2->second.auraSpell > 0)
2486 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);
2494 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has wrong race mask ({}) requirement.", spell, spellArea.
raceMask);
2500 TC_LOG_ERROR(
"sql.sql",
"The spell {} listed in `spell_area` has wrong gender ({}) requirement.", spell, spellArea.
gender);
2533 }
while (result->NextRow());
2556 ASSERT(spellEffectInfo.Effect <
TOTAL_SPELL_EFFECTS,
"TOTAL_SPELL_EFFECTS must be at least %u", spellEffectInfo.Effect + 1);
2557 ASSERT(spellEffectInfo.ApplyAuraName <
TOTAL_AURAS,
"TOTAL_AURAS must be at least %u", spellEffectInfo.ApplyAuraName + 1);
2558 ASSERT(spellEffectInfo.TargetA.GetTarget() <
TOTAL_SPELL_TARGETS,
"TOTAL_SPELL_TARGETS must be at least %u", spellEffectInfo.TargetA.GetTarget() + 1);
2559 ASSERT(spellEffectInfo.TargetB.GetTarget() <
TOTAL_SPELL_TARGETS,
"TOTAL_SPELL_TARGETS must be at least %u", spellEffectInfo.TargetB.GetTarget() + 1);
2584 uint32 oldMSTime2 = oldMSTime;
2589 TC_LOG_INFO(
"server.loading",
">> Loaded 0 spell custom attributes from DB. DB table `spell_custom_attr` is empty.");
2595 Field* fields = result->Fetch();
2603 TC_LOG_ERROR(
"sql.sql",
"Table `spell_custom_attr` has wrong spell (entry: {}), ignored.", spellId);
2611 if (spellEffectInfo.IsEffect())
2616 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));
2624 }
while (result->NextRow());
2634 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
2637 if (spellInfo->GetEffectMechanicMask(spellEffectInfo.EffectIndex) & (1 <<
MECHANIC_BLEED))
2640 switch (spellEffectInfo.ApplyAuraName)
2654 switch (spellEffectInfo.ApplyAuraName)
2671 switch (spellEffectInfo.Effect)
2689 switch (spellEffectInfo.Effect)
2727 uint32 enchantId = spellEffectInfo.MiscValue;
2760 bool setFlag =
false;
2761 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
2763 if (spellEffectInfo.IsEffect())
2765 switch (spellEffectInfo.Effect)
2800 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)
2804 if (spellInfo->SpellFamilyName ==
SPELLFAMILY_MAGE && (spellInfo->SpellFamilyFlags[0] & 0x20))
2808 if (spellInfo->Id == 55095)
2812 if (spellInfo->SpellFamilyName ==
SPELLFAMILY_WARLOCK && (spellInfo->SpellFamilyFlags[1] & 0x40000))
2832 spellInfo->SchoolMask &= ~SPELL_SCHOOL_MASK_NORMAL;
2836 spellInfo->_InitializeSpellPositivity();
2838 if (spellInfo->SpellVisual[0] == 3879)
2841 switch (spellInfo->SpellFamilyName)
2845 if (spellInfo->SpellFamilyFlags[0] & 0x20000)
2850 if (spellInfo->SpellFamilyFlags[0] & 0x8)
2855 if (spellInfo->Id == 5729)
2862 spellInfo->_InitializeExplicitTargetMask();
2864 if (spellInfo->Speed > 0.0f)
2866 if (spellVisual->HasMissile)
2867 if (spellVisual->MissileModel == -4 || spellVisual->MissileModel == -5)
2881 bool allNonBinary =
true;
2882 bool overrideAttr =
false;
2883 for (
SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
2885 if (spellEffectInfo.IsAura() && spellEffectInfo.TriggerSpell)
2887 switch (spellEffectInfo.ApplyAuraName)
2892 if (
SpellInfo const* triggerSpell =
sSpellMgr->GetSpellInfo(spellEffectInfo.TriggerSpell))
2894 overrideAttr =
true;
2896 allNonBinary =
false;
2905 if (overrideAttr && allNonBinary)
2906 spellInfo->AttributesCu &= ~SPELL_ATTR0_CU_BINARY_SPELL;
2922 if (
uint32 spellId = liquid->SpellID)
2932 for (
uint32 spellId : spellIds)
2937 TC_LOG_ERROR(
"server.loading",
"Spell info correction specified for non-existing spell {}", spellId);
2978 spellInfo->_GetEffect(
EFFECT_1).ApplyAuraPeriod = spellInfo->GetEffect(
EFFECT_0).ApplyAuraPeriod;
3007 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 23171;
3013 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 29916;
3019 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 38530;
3025 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 39856;
3031 spellInfo->_GetEffect(
EFFECT_1).TriggerSpell = 46737;
3048 spellInfo->EquippedItemClass = -1;
3075 spellInfo->_GetEffect(
EFFECT_0).BonusCoefficient = spellInfo->GetEffect(
EFFECT_1).BonusCoefficient;
3082 spellInfo->ManaCost = 0;
3083 spellInfo->ManaPerSecond = 0;
3105 spellInfo->_GetEffect(
EFFECT_0).MiscValueB = 64;
3114 spellInfo->SpellFamilyFlags =
flag96();
3157 spellInfo->Priority = 100;
3174 spellInfo->_GetEffect(
EFFECT_0).TriggerSpell = 36325;
3199 spellInfo->ProcChance = 0;
3212 spellInfo->EquippedItemSubClassMask = 0x0000FC33;
3254 spellInfo->SpellLevel = 0;
3329 spellInfo->MaxAffectedTargets = 1;
3337 spellInfo->MaxAffectedTargets = 2;
3356 spellInfo->MaxAffectedTargets = 3;
3364 spellInfo->MaxAffectedTargets = 4;
3378 spellInfo->MaxAffectedTargets = 5;
3390 spellInfo->MaxAffectedTargets = 10;
3397 spellInfo->MaxAffectedTargets = 15;
3434 spellInfo->_GetEffect(
EFFECT_1).MiscValue = 127;
3441 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(685904631, 1151048, 0);
3447 spellInfo->ProcCharges = 0;
3466 spellInfo->_GetEffect(
EFFECT_1).SpellClassMask[0] |= 2;
3476 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask[0] |= 0x800;
3482 spellInfo->_GetEffect(
EFFECT_0).ApplyAuraPeriod = 3000;
3540 spellInfo->Attributes &= ~SPELL_ATTR0_NOT_SHAPESHIFT;
3558 spellInfo->_GetEffect(
EFFECT_2).BasePoints += 30000;
3570 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_STACK_FOR_DIFF_CASTERS;
3577 spellInfo->SpellFamilyFlags[2] = 0x10;
3630 spellInfo->_GetEffect(
EFFECT_1).BasePoints = -6;
3659 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_FIXED_DAMAGE;
3702 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x00067801, 0x10820001, 0x00000801);
3728 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x00000040, 0x00000000, 0x00000000);
3734 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x00000000, 0x02000000, 0x00000000);
3744 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x80000000, 0x00000000, 0x00000000);
3754 spellInfo->_GetEffect(
EFFECT_0).SpellClassMask =
flag96(0x40000000, 0x00000000, 0x00000000);
3762 spellInfo->_GetEffect(
EFFECT_0).BasePoints = 0;
3771 spellInfo->_GetEffect(
EFFECT_0).BasePoints = 100;
3823 spellInfo->_GetEffect(
EFFECT_0).BasePoints = 1;
3829 spellInfo->_GetEffect(
EFFECT_0).DieSides = 0;
3870 spellInfo->ExcludeTargetAuraSpell = 72232;
3894 spellInfo->InterruptFlags &= ~AURA_INTERRUPT_FLAG_CAST;
3922 spellInfo->Speed = 0.f;
3962 spellInfo->RecoveryTime = 3000;
3968 spellInfo->RecoveryTime = 2000;
3976 spellInfo->RecoveryTime = 6000;
3985 spellInfo->RecoveryTime = 10000;
3993 spellInfo->RecoveryTime = 12000;
3999 spellInfo->RecoveryTime = 15000;
4008 spellInfo->RecoveryTime = 20000;
4047 spellInfo->MaxAffectedTargets = 1;
4066 spellInfo->MaxAffectedTargets = 1;
4105 spellInfo->ChannelInterruptFlags = 0;
4111 spellInfo->Speed = 0;
4123 spellInfo->MaxAffectedTargets = 3;
4129 spellInfo->MaxAffectedTargets = 1;
4135 spellInfo->MaxAffectedTargets = 3;
4243 spellInfo->AttributesEx4 &= ~SPELL_ATTR4_IGNORE_RESISTANCES;
4255 spellInfo->AttributesEx3 &= ~SPELL_ATTR3_NO_INITIAL_AGGRO;
4356 spellInfo->RequiredAreasID = 0;
4408 spellInfo->Speed = 0.0f;
4509 spellInfo->MaxAffectedTargets = 1;
4516 spellInfo->MaxAffectedTargets = 3;
4547 spellInfo->MaxAffectedTargets = 3;
4556 spellInfo->_GetEffect(
EFFECT_0).MiscValue = 190;
4666 spellInfo->ManaCost = 0;
4667 spellInfo->ManaPerSecond = 0;
4693 spellInfo->_GetEffect(
EFFECT_0).ApplyAuraPeriod = 0;
4694 spellInfo->ProcChance = 10;
4852 spellInfo->ProcFlags = 0;
4877 spellInfo->_GetEffect(
EFFECT_1).SpellClassMask[0] |= 0x00004000;
4903 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65410;
4909 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65416;
4915 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65412;
4921 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65415;
4927 spellInfo->_GetEffect(
EFFECT_2).TriggerSpell = 65414;
4943 spellInfo->_GetEffect(
EFFECT_1).TriggerSpell = 24870;
4961 float maxRangeTrigger = spellInfoTrigger->RangeEntry ? spellInfoTrigger->RangeEntry->RangeMax[0] : 0.0f;
4964 if (maxRangeTrigger < maxRangeMain)
4965 spellInfoTrigger->RangeEntry = spellInfo->
RangeEntry;
4972 switch (spellEffectInfo.Effect)
4997 if (spellEffectInfo.IsAreaAuraEffect() && spellEffectInfo.IsTargetingArea())
5053 spellInfo->_LoadSpellSpecific();
5054 spellInfo->_LoadAuraState();
5069 spellInfo->_LoadSpellDiminishInfo();
5084 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)
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
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