38 for (SkillLineAbilityMap::const_iterator itr = skillBounds.first; itr != skillBounds.second; ++itr)
39 if (itr->second->skillId == skillId)
65 else if (spellproto->
Id == 48400)
68 else if (spellproto->
Id == 47481)
74 else if (spellproto->
Id == 64155)
325 bool needCheckReagents =
false;
349 SF_LOG_ERROR(
"sql.sql",
"Craft spell %u not have create item entry.", spellInfo->
Id);
362 SF_LOG_ERROR(
"sql.sql",
"Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->
Id, spellInfo->
Effects[i].
ItemType);
367 needCheckReagents =
true;
389 if (needCheckReagents)
400 SF_LOG_ERROR(
"sql.sql",
"Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->
Id, spellInfo->
Reagent[j]);
432 SF_LOG_ERROR(
"spells",
"SpellMgr::GetSpellIdForDifficulty: Incorrect DifficultyID for spell %u.", spellId);
441 if (!difficultyEntry)
443 SF_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell %u. This should never happen.", spellId);
449 SF_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is NULL, using mode %u", spellId, mode, mode - 2);
453 if (difficultyEntry->
SpellID[mode] <= 0)
455 SF_LOG_ERROR(
"sql.sql",
"SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spellId, mode);
459 SF_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->
SpellID[mode]);
472 SF_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellForDifficultyFromSpell: spell %u not found. Check spelldifficulty_dbc!", newSpellId);
476 SF_LOG_DEBUG(
"spells",
"SpellMgr::GetSpellForDifficultyFromSpell: Spell id for instance mode is %u (original %u)", newSpell->
Id, spell->
Id);
482 SpellChainMap::const_iterator itr =
mSpellChains.find(spell_id);
492 return node->first->Id;
500 return node->last->Id;
509 return node->next->Id;
518 return node->prev->Id;
535 if (rank != node->rank)
536 return GetSpellWithRank(node->rank < rank ? node->next->Id : node->prev->Id, rank, strict);
538 else if (strict && rank > 1)
556 for (SpellsRequiringSpellMap::const_iterator itr = spellsRequiringSpell.first; itr != spellsRequiringSpell.second; ++itr)
558 if (itr->second == spellid)
586 for (SpellLearnSpellMap::const_iterator i = bounds.first; i != bounds.second; ++i)
587 if (i->second.spell == spell_id2)
594 SpellTargetPositionMap::const_iterator itr =
mSpellTargetPositions.find(std::make_pair(spell_id, effIndex));
609 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr)
611 if (itr->second == groupid)
624 std::set<SpellGroup> usedGroups;
630 if (usedGroups.find(group_id) != usedGroups.end())
632 usedGroups.insert(group_id);
635 for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second; ++itr)
644 foundSpells.insert(itr->second);
654 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr)
663 if (groups.find(group) == groups.end())
664 groups[group] = amount;
667 int32 curr_amount = groups[group];
669 if (abs(curr_amount) < abs(amount))
670 groups[group] = amount;
685 if (spellid_1 == spellid_2)
689 std::set<SpellGroup> groups;
690 for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second; ++itr)
696 for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second; ++itr2)
698 if (itr2->second < 0)
709 groups.insert(itr->second);
715 for (std::set<SpellGroup>::iterator itr = groups.begin(); itr != groups.end(); ++itr)
719 rule = found->second;
740 if ((procFlags & EventProcFlag) == 0)
743 bool hasFamilyMask =
false;
794 procEvent_procEx = spellProcEvent->
procEx;
797 if (procSpell == NULL)
818 hasFamilyMask =
true;
857 if (procEvent_procEx & procExtra)
865 SpellProcMap::const_iterator itr =
mSpellProcMap.find(spellId);
947 return &itr2->second;
974 SpellPetAuraMap::const_iterator itr =
mSpellPetAuraMap.find((spell_id << 8) + eff);
1004 return &itr->second;
1013 return &itr->second;
1071 return bg->IsSpellAllowed(
spellId, player);
1114 return battlefieldWG->IsEnabled() && (player->
GetTeamId() == battlefieldWG->GetDefenderTeam()) && !battlefieldWG->IsWarTime();
1123 return bf->IsWarTime();
1152 QueryResult result =
WorldDatabase.Query(
"SELECT first_spell_id, spell_id, spell_rank from spell_ranks ORDER BY first_spell_id, spell_rank");
1156 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
1161 bool finished =
false;
1166 std::list < std::pair < int32, int32 > > rankChain;
1167 int32 currentSpell = -1;
1168 int32 lastSpell = -1;
1171 while (currentSpell == lastSpell && !finished)
1173 Field* fields = result->Fetch();
1176 if (lastSpell == -1)
1177 lastSpell = currentSpell;
1182 if (currentSpell == lastSpell)
1184 rankChain.push_back(std::make_pair(spell_id, rank));
1185 if (!result->NextRow())
1195 SF_LOG_ERROR(
"sql.sql",
"Spell rank identifier(first_spell_id) %u listed in `spell_ranks` does not exist!", lastSpell);
1199 if (rankChain.size() < 2)
1201 SF_LOG_ERROR(
"sql.sql",
"There is only 1 spell rank for identifier(first_spell_id) %u in `spell_ranks`, entry is not needed!", lastSpell);
1207 for (std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin(); itr != rankChain.end(); ++itr)
1212 SF_LOG_ERROR(
"sql.sql",
"Spell %u (rank %u) listed in `spell_ranks` for chain %u does not exist!", itr->first, itr->second, lastSpell);
1217 if (itr->second != curRank)
1219 SF_LOG_ERROR(
"sql.sql",
"Spell %u (rank %u) listed in `spell_ranks` for chain %u does not have proper rank value(should be %u)!", itr->first, itr->second, lastSpell, curRank);
1228 std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin();
1232 int32 addedSpell = itr->first;
1235 SF_LOG_ERROR(
"sql.sql",
"Spell %u (rank: %u, first: %u) listed in `spell_ranks` has already ChainEntry from dbc.", addedSpell, itr->second, lastSpell);
1242 prevRank = addedSpell;
1245 if (itr == rankChain.end())
1253 }
while (!finished);
1270 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell required records. DB table `spell_required` is empty.");
1278 Field* fields = result->Fetch();
1287 SF_LOG_ERROR(
"sql.sql",
"spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id);
1294 SF_LOG_ERROR(
"sql.sql",
"req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req);
1300 SF_LOG_ERROR(
"sql.sql",
"req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id);
1306 SF_LOG_ERROR(
"sql.sql",
"duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id);
1310 mSpellReq.insert(std::pair<uint32, uint32>(spell_id, spell_req));
1311 mSpellsReqSpell.insert(std::pair<uint32, uint32>(spell_req, spell_id));
1313 }
while (result->NextRow());
1365 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty.");
1372 Field* fields = result->Fetch();
1383 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_learn_spell` does not exist", spell_id);
1389 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_learn_spell` learning not existed spell %u", spell_id, node.
spell);
1395 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_learn_spell` attempt learning talent spell %u, skipped", spell_id, node.
spell);
1402 }
while (result->NextRow());
1436 for (SpellLearnSpellMap::const_iterator itr = db_node_bounds.first; itr != db_node_bounds.second; ++itr)
1438 if (itr->second.spell == dbc_node.
spell)
1440 SF_LOG_ERROR(
"sql.sql",
"Spell %u auto-learn spell %u in spell.dbc then the record in `spell_learn_spell` is redundant, please fix DB.",
1441 spell, dbc_node.
spell);
1517 SF_LOG_INFO(
"server.loading",
">> Loaded %u spell learn spells, %u found in Spell.dbc and %u from TalentTab.dbc in %u ms", count, dbc_count, 0,
GetMSTimeDiffToNow(oldMSTime));
1527 QueryResult result =
WorldDatabase.Query(
"SELECT id, effIndex, target_map, target_position_x, target_position_y, target_position_z, target_orientation FROM spell_target_position");
1530 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
1537 Field* fields = result->Fetch();
1553 SF_LOG_ERROR(
"sql.sql",
"Spell (Id: %u, effIndex: %u) target map (ID: %u) does not exist in `Map.dbc`.", Spell_ID, effIndex, st.
target_mapId);
1559 SF_LOG_ERROR(
"sql.sql",
"Spell (Id: %u, effIndex: %u) target coordinates not provided.", Spell_ID, effIndex);
1566 SF_LOG_ERROR(
"sql.sql",
"Spell (Id: %u) listed in `spell_target_position` does not exist.", Spell_ID);
1572 std::pair<uint32, SpellEffIndex> key = std::make_pair(Spell_ID, effIndex);
1578 SF_LOG_ERROR(
"sql.sql",
"Spell (Id: %u, effIndex: %u) listed in `spell_target_position` does not have target TARGET_DEST_DB (17).", Spell_ID, effIndex);
1581 }
while (result->NextRow());
1632 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
1636 std::set<uint32> groups;
1640 Field* fields = result->Fetch();
1645 SF_LOG_ERROR(
"sql.sql",
"SpellGroup id %u listed in `spell_group` is in core range, but is not defined in core!", group_id);
1650 groups.insert(std::set<uint32>::value_type(group_id));
1652 }
while (result->NextRow());
1656 if (itr->second < 0)
1658 if (groups.find(abs(itr->second)) == groups.end())
1660 SF_LOG_ERROR(
"sql.sql",
"SpellGroup id %u listed in `spell_group` does not exist", abs(itr->second));
1672 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_group` does not exist", itr->second);
1675 else if (spellInfo->
GetRank() > 1)
1677 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_group` is not first rank of spell", itr->second);
1685 for (std::set<uint32>::iterator groupItr = groups.begin(); groupItr != groups.end(); ++groupItr)
1687 std::set<uint32> spells;
1690 for (std::set<uint32>::iterator spellItr = spells.begin(); spellItr != spells.end(); ++spellItr)
1710 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
1717 Field* fields = result->Fetch();
1723 SF_LOG_ERROR(
"sql.sql",
"SpellGroupStackRule %u listed in `spell_group_stack_rules` does not exist", stack_rule);
1729 if (spellGroup.first == spellGroup.second)
1731 SF_LOG_ERROR(
"sql.sql",
"SpellGroup id %u listed in `spell_group_stack_rules` does not exist", group_id);
1738 }
while (result->NextRow());
1750 QueryResult result =
WorldDatabase.Query(
"SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, SpellFamilyMask3, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
1753 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
1761 Field* fields = result->Fetch();
1766 bool allRanks =
false;
1776 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc_event` does not exist", spellId);
1783 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc_event` with all ranks, but spell has no ranks.", spellId);
1787 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc_event` is not first rank of spell.", spellId);
1810 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc_event` already has its first rank in table.", spellInfo->
Id);
1815 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc_event` probably not triggered spell", spellInfo->
Id);
1826 }
while (result->NextRow());
1838 QueryResult result =
WorldDatabase.Query(
"SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
1841 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
1848 Field* fields = result->Fetch();
1852 bool allRanks =
false;
1862 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc` does not exist", spellId);
1869 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc` with all ranks, but spell has no ranks.", spellId);
1873 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc` is not first rank of spell.", spellId);
1892 float cooldown = fields[13].
GetFloat();
1900 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_proc` already has its first rank in table.", spellInfo->
Id);
1916 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellInfo->
Id, procEntry.
schoolMask);
1918 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellInfo->
Id, procEntry.
spellFamilyName);
1919 if (procEntry.
chance < 0)
1921 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has negative value in `chance` field", spellInfo->
Id);
1926 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellInfo->
Id);
1931 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellInfo->
Id);
1935 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellInfo->
Id);
1938 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has too big value in `charges` field", spellInfo->
Id);
1942 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellInfo->
Id);
1944 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellInfo->
Id, procEntry.
spellTypeMask);
1946 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->
Id);
1948 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellInfo->
Id);
1950 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellInfo->
Id, procEntry.
spellPhaseMask);
1952 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->
Id);
1954 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellInfo->
Id, procEntry.
hitMask);
1956 SF_LOG_ERROR(
"sql.sql",
"`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellInfo->
Id);
1966 }
while (result->NextRow());
1978 QueryResult result =
WorldDatabase.Query(
"SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
1981 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
1988 Field* fields = result->Fetch();
1994 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_bonus_data` does not exist", entry);
2005 }
while (result->NextRow());
2020 SF_LOG_INFO(
"server.loading",
">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
2027 Field* fields = result->Fetch();
2033 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_threat` does not exist", entry);
2044 }
while (result->NextRow());
2080 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
2087 Field* fields = result->Fetch();
2096 itr->second.AddAura(pet, aura);
2102 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_pet_auras` does not exist", spell);
2109 SF_LOG_ERROR(
"spells",
"Spell %u listed in `spell_pet_auras` does not have dummy aura or dummy effect", spell);
2116 SF_LOG_ERROR(
"sql.sql",
"Aura %u listed in `spell_pet_auras` does not exist", aura);
2125 }
while (result->NextRow());
2138 for (
uint32 i = 0; i < size; ++i)
2177 QueryResult result =
WorldDatabase.Query(
"SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
2180 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
2187 Field* fields = result->Fetch();
2194 SF_LOG_ERROR(
"sql.sql",
"Enchancment %u listed in `spell_enchant_proc_data` does not exist", enchantId);
2207 }
while (result->NextRow());
2222 SF_LOG_INFO(
"server.loading",
">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
2229 Field* fields = result->Fetch();
2238 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_linked_spell` does not exist", abs(trigger));
2244 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_linked_spell` does not exist", abs(effect));
2258 }
while (result->NextRow());
2275 if (!creatureFamily)
2278 for (
uint8 j = 0; j < 2; ++j)
2307 if (spellSet.empty())
2310 spellSet.insert(PetLevelupSpellSet::value_type(spell->
SpellLevel, spell->
Id));
2316 SF_LOG_INFO(
"server.loading",
">> Loaded %u pet levelup and default spells for %u families in %u ms", count, family_count,
GetMSTimeDiffToNow(oldMSTime));
2322 bool have_spell =
false;
2342 for (PetLevelupSpellSet::const_iterator itr = levelupSpells->begin(); itr != levelupSpells->end(); ++itr)
2344 if (itr->second == petDefSpells.
spellid[j])
2373 uint32 countCreature = 0;
2377 for (CreatureTemplateContainer::const_iterator itr = ctc->begin(); itr != ctc->end(); ++itr)
2379 if (!itr->second.PetSpellDataId)
2384 if (!spellDataEntry)
2387 int32 petSpellsId = -
int32(itr->second.PetSpellDataId);
2399 SF_LOG_INFO(
"server.loading",
">> Loaded addition spells for %u pet spell data entries in %u ms", countData,
GetMSTimeDiffToNow(oldMSTime));
2401 SF_LOG_INFO(
"server.loading",
"Loading summonable creature templates...");
2455 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");
2458 SF_LOG_INFO(
"server.loading",
">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
2466 Field* fields = result->Fetch();
2488 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` does not exist", spell);
2495 for (SpellAreaMap::const_iterator itr = sa_bounds.first; itr != sa_bounds.second; ++itr)
2497 if (spellArea.
spellId != itr->second.spellId)
2499 if (spellArea.
areaId != itr->second.areaId)
2501 if (spellArea.
questStart != itr->second.questStart)
2503 if (spellArea.
auraSpell != itr->second.auraSpell)
2505 if ((spellArea.
raceMask & itr->second.raceMask) == 0)
2507 if (spellArea.
gender != itr->second.gender)
2517 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` already listed with similar requirements.", spell);
2524 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have wrong area (%u) requirement", spell, spellArea.
areaId);
2530 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell, spellArea.
questStart);
2538 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.
questEnd);
2548 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell, abs(spellArea.
auraSpell));
2554 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.
auraSpell));
2563 for (SpellAreaForAuraMap::const_iterator itr = saBound.first; itr != saBound.second; ++itr)
2565 if (itr->second->autocast && itr->second->auraSpell > 0)
2574 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.
auraSpell);
2579 for (SpellAreaMap::const_iterator itr2 = saBound2.first; itr2 != saBound2.second; ++itr2)
2581 if (itr2->second.autocast && itr2->second.auraSpell > 0)
2590 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.
auraSpell);
2598 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell, spellArea.
raceMask);
2604 SF_LOG_ERROR(
"sql.sql",
"Spell %u listed in `spell_area` have wrong gender (%u) requirement", spell, spellArea.
gender);
2627 }
while (result->NextRow());
2651 std::map<uint32, SpellEffectArray> effectsBySpell;
2799 switch (spellInfo->
Id)
2944 switch (spellInfo->
Id)
3386 spellInfo->
Speed = 0.0f;
3575 properties->Slot = 1;
@ BATTLEFIELD_BATTLEID_WG
UNORDERED_MAP< uint32, CreatureTemplate > CreatureTemplateContainer
#define MAX_SPELL_REAGENTS
@ ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL
@ ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< SpellRadiusEntry > sSpellRadiusStore(SpellRadiusfmt)
DBCStorage< SummonPropertiesEntry > sSummonPropertiesStore(SummonPropertiesfmt)
DBCStorage< CreatureSpellDataEntry > sCreatureSpellDataStore(CreatureSpellDatafmt)
DBCStorage< SpellRangeEntry > sSpellRangeStore(SpellRangefmt)
uint32 GetTalentSpellCost(uint32 spellId)
DBCStorage< SpellDifficultyEntry > sSpellDifficultyStore(SpellDifficultyfmt)
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
DBCStorage< SpellEffectEntry > sSpellEffectStore(SpellEffectEntryfmt)
DBCStorage< CreatureFamilyEntry > sCreatureFamilyStore(CreatureFamilyfmt)
DBCStorage< SpellDurationEntry > sSpellDurationStore(SpellDurationfmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
AreaTableEntry const * GetAreaEntryByAreaID(uint32 area_id)
DBCStorage< SkillLineAbilityEntry > sSkillLineAbilityStore(SkillLineAbilityfmt)
#define MAX_CREATURE_SPELL_DATA_SLOT
#define MAX_SPELL_EFFECTS
#define MAX_ITEM_ENCHANTMENT_EFFECTS
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
#define SF_LOG_INFO(filterType__,...)
Skyfire::AutoPtr< ResultSet, Skyfire::Mutex > QueryResult
@ SPELL_ATTR0_CANT_CANCEL
@ SPELL_ATTR0_NOT_SHAPESHIFT
@ DIMINISHING_DRAGONS_BREATH
@ DIMINISHING_MIND_CONTROL
@ DIMINISHING_OPENING_STUN
@ DIMINISHING_SCATTER_SHOT
@ DIMINISHING_CONTROLLED_ROOT
@ DIMINISHING_CONTROLLED_STUN
@ SPELL_EFFECT_POWER_BURN
@ SPELL_EFFECT_ENERGIZE_PCT
@ SPELL_EFFECT_SUMMON_PET
@ SPELL_EFFECT_ENCHANT_HELD_ITEM
@ SPELL_EFFECT_ENCHANT_ITEM
@ SPELL_EFFECT_HEALTH_LEECH
@ SPELL_EFFECT_WEAPON_DAMAGE
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
@ SPELL_EFFECT_HEAL_MAX_HEALTH
@ SPELL_EFFECT_PICKPOCKET
@ SPELL_EFFECT_HEAL_MECHANICAL
@ SPELL_EFFECT_WEAPON_PERCENT_DAMAGE
@ SPELL_EFFECT_CREATE_ITEM_2
@ SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL
@ SPELL_EFFECT_POWER_DRAIN
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_CHARGE_DEST
@ SPELL_EFFECT_LEARN_SPELL
@ SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC
@ SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY
@ SPELL_EFFECT_SKILL_STEP
@ SPELL_EFFECT_CREATE_ITEM
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY
@ SPELL_ATTR1_CHANNELED_1
@ SPELL_ATTR1_CANT_TARGET_SELF
@ SKILL_CATEGORY_PROFESSION
@ TARGET_UNIT_SRC_AREA_ENTRY
@ TARGET_UNIT_SRC_AREA_ALLY
@ TARGET_UNIT_SRC_AREA_ENEMY
@ TARGET_UNIT_TARGET_ENEMY
@ SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA
@ SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS
@ SPELL_ATTR6_CAN_TARGET_INVISIBLE
@ SPELL_ATTR3_STACK_FOR_DIFF_CASTERS
@ SPELL_ATTR3_NO_DONE_BONUS
@ SPELL_ATTR3_NO_INITIAL_AGGRO
@ SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED
@ SPELL_ATTR3_CANT_TRIGGER_PROC
@ SPELL_ATTR5_USABLE_WHILE_CONFUSED
@ SPELL_ATTR5_USABLE_WHILE_FEARED
@ SPELL_ATTR5_START_PERIODIC_AT_APPLY
@ SPELL_ATTR5_USABLE_WHILE_STUNNED
@ DIMINISHING_LEVEL_IMMUNE
@ DIMINISHING_LEVEL_TAUNT_IMMUNE
#define RACEMASK_ALL_PLAYABLE
@ SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
@ SPELL_AURA_PERIODIC_MANA_LEECH
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_OBS_MOD_POWER
@ SPELL_AURA_ADD_FLAT_MODIFIER
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_ATTR0_CU_IGNORE_ARMOR
@ SPELL_ATTR0_CU_REQ_TARGET_FACING_CASTER
@ SPELL_ATTR0_CU_ENCHANT_PROC
@ SPELL_ATTR0_CU_DIRECT_DAMAGE
@ SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET
@ SPELL_ATTR0_CU_CONE_BACK
@ SPELL_ATTR0_CU_NEGATIVE_EFF2
@ SPELL_ATTR0_CU_NEGATIVE_EFF1
@ SPELL_ATTR0_CU_NEGATIVE_EFF0
@ SPELL_ATTR0_CU_SHARE_DAMAGE
@ SPELL_ATTR0_CU_PICKPOCKET
@ SPELL_ATTR0_CU_CONE_LINE
@ SPELL_ATTR0_CU_NO_INITIAL_THREAT
bool IsPrimaryProfessionSkill(uint32 skill)
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
bool LoadPetDefaultSpells_helper(CreatureTemplate const *cInfo, PetDefaultSpellsEntry &petDefSpells)
int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellInfo const *spellproto)
DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const *spellproto, bool triggered)
bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group)
bool IsWeaponSkill(uint32 skill)
DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group)
DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group)
std::multimap< uint32, SpellLearnSpellNode > SpellLearnSpellMap
bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
#define SPELL_GROUP_STACK_RULE_MAX
std::pair< SpellsRequiringSpellMap::const_iterator, SpellsRequiringSpellMap::const_iterator > SpellsRequiringSpellMapBounds
#define AURA_SPELL_PROC_EX_MASK
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_EXP_OR_HONOR
@ SPELL_GROUP_STACK_RULE_DEFAULT
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT
std::pair< SpellRequiredMap::const_iterator, SpellRequiredMap::const_iterator > SpellRequiredMapBounds
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_EX_ONLY_ACTIVE_SPELL
@ PROC_EX_EX_TRIGGER_ALWAYS
@ PROC_EX_NOT_ACTIVE_SPELL
@ PROC_EX_INTERNAL_REQ_FAMILY
@ PROC_SPELL_TYPE_MASK_ALL
@ EFFECT_RADIUS_100_YARDS
@ EFFECT_RADIUS_50000_YARDS
@ EFFECT_RADIUS_200_YARDS
@ PROC_SPELL_PHASE_FINISH
@ PROC_SPELL_PHASE_MASK_ALL
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS
@ PROC_FLAG_DONE_PERIODIC
@ TAKEN_HIT_PROC_FLAG_MASK
@ PERIODIC_PROC_FLAG_MASK
@ PROC_FLAG_TAKEN_PERIODIC
@ REQ_SPELL_PHASE_PROC_FLAG_MASK
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS
@ DONE_HIT_PROC_FLAG_MASK
@ PROC_FLAG_DONE_TRAP_ACTIVATION
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
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)
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
@ AURA_INTERRUPT_FLAG_CAST
@ AURA_INTERRUPT_FLAG_HITBYSPELL
@ AURA_INTERRUPT_FLAG_MOVE
@ AURA_INTERRUPT_FLAG_JUMP
virtual uint32 GetData(uint32 dataId) const
bool CanFlyIn() const
Return if we can use mount in battlefield.
void PSendSysMessage(const char *format,...) ATTR_PRINTF(2
uint8 GetSpawnMode() const
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
uint32 ApplyAuraTickCount
SpellRadiusEntry const * MaxRadiusEntry
SpellRadiusEntry const * RadiusEntry
SpellImplicitTargetInfo TargetA
int32 CalcValue(Unit const *caster=NULL, int32 const *basePoints=NULL, Unit const *target=NULL) const
SpellImplicitTargetInfo TargetB
Targets GetTarget() const
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
bool IsRankOf(SpellInfo const *spellInfo) const
SpellInfo const * GetFirstRankSpell() const
SpellRangeEntry const * RangeEntry
bool IsLootCrafting() const
bool _IsPositiveEffect(uint8 effIndex, bool deep) const
SpellDurationEntry const * DurationEntry
uint32 MaxAffectedTargets
uint32 GetAllEffectsMechanicMask() const
void _InitializeExplicitTargetMask()
SpellInfo const * GetNextRankSpell() const
bool HasEffect(SpellEffects effect) const
bool HasAura(AuraType aura) const
int32 Reagent[MAX_SPELL_REAGENTS]
uint32 AuraInterruptFlags
SpellRequiredMap mSpellReq
SpellLinkedMap mSpellLinkedMap
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()
uint32 GetSpellIdForDifficulty(uint32 spellId, Unit const *caster) const
SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const
SpellAreaForAuraMap mSpellAreaForAuraMap
SpellProcEventEntry const * GetSpellProcEvent(uint32 spellId) const
SpellChainMap mSpellChains
void LoadEnchantCustomAttr()
void UnloadSpellInfoStore()
uint32 GetNextSpellInChain(uint32 spell_id) const
SpellPetAuraMap mSpellPetAuraMap
SpellLearnSkillMap mSpellLearnSkills
SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id) const
SpellBonusEntry const * GetSpellBonusData(uint32 spellId) const
void LoadSkillLineAbilityMap()
SkillLineAbilityMapBounds GetSkillLineAbilityMapBounds(uint32 spell_id) const
SpellProcEventMap mSpellProcEventMap
static bool IsSpellValid(SpellInfo const *spellInfo, Player *player=NULL, bool msg=true)
Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book,...
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()
const std::vector< int32 > * GetSpellLinked(int32 spell_id) const
SpellRequiredMapBounds GetSpellsRequiredForSpellBounds(uint32 spell_id) const
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
SpellInfo const * GetSpellForDifficultyFromSpell(SpellInfo const *spell, Unit const *caster) const
void LoadSpellTargetPositions()
SpellDifficultySearcherMap mSpellDifficultySearcherMap
void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set< uint32 > &foundSpells) const
void LoadSpellLearnSkills()
uint32 GetLastSpellInChain(uint32 spell_id) const
bool AddSameEffectStackRuleSpellGroups(SpellInfo const *spellInfo, int32 amount, std::map< SpellGroup, int32 > &groups) const
void LoadSpellTalentRanks()
bool IsSpellLearnSpell(uint32 spell_id) const
SpellThreatEntry const * GetSpellThreatEntry(uint32 spellID) const
void LoadSpellGroupStackRules()
SpellGroupStackMap mSpellGroupStack
uint32 GetFirstSpellInChain(uint32 spell_id) const
bool CanSpellTriggerProcOnEvent(SpellProcEntry const &procEntry, ProcEventInfo &eventInfo) const
SpellEnchantProcEventMap mSpellEnchantProcEventMap
void LoadPetDefaultSpells()
PetLevelupSpellMap mPetLevelupSpellMap
void LoadSpellLearnSpells()
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
SpellEnchantProcEntry const * GetSpellEnchantProcEvent(uint32 enchId) const
SpellAreaForAreaMap mSpellAreaForAreaMap
bool IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const *spellProcEvent, uint32 EventProcFlag, SpellInfo const *procSpell, uint32 procFlags, uint32 procExtra, bool active) const
uint32 GetSpellDifficultyId(uint32 spellId) const
void LoadSpellProcEvents()
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
void LoadPetLevelupSpellMap()
SpellLearnSpellMap mSpellLearnSpells
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
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
uint32 getRaceMask() const
bool HasAuraType(AuraType auraType) const
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
bool HasAnyMechanic(uint32 mask, std::initializer_list< uint32 > mechanics)
bool HasMechanic(uint32 mask, uint32 mechanic)
uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]
uint32 spells[CREATURE_MAX_SPELLS]
uint32 spellid[MAX_CREATURE_SPELL_DATA_SLOT]
bool IsFitToRequirements(Player const *player, uint32 newZone, uint32 newArea) const
SpellEffectEntry const * effects[MAX_SPELL_EFFECTS]
uint32 type[MAX_ITEM_ENCHANTMENT_EFFECTS]
uint32 spellid[MAX_ITEM_ENCHANTMENT_EFFECTS]