aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
authorPeter Keresztes Schmidt <carbenium@outlook.com>2020-07-12 15:36:55 +0200
committerGitHub <noreply@github.com>2020-07-12 15:36:55 +0200
commitc92950b3e1f6366d85d707365a8ad2caddafeecc (patch)
tree9c034dc61e7b8dc5d480bfd476a6631b8d9dd592 /src/server/game/Spells/SpellMgr.cpp
parent352944266822f8c8d3bfdd6078c6f82d3555dd85 (diff)
Core/DataStores: Update DBC field names to generated ones (#24999)
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 65d9a0e7071..2bcce293cdf 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -38,7 +38,7 @@ bool IsPrimaryProfessionSkill(uint32 skill)
if (!pSkill)
return false;
- if (pSkill->categoryId != SKILL_CATEGORY_PROFESSION)
+ if (pSkill->CategoryID != SKILL_CATEGORY_PROFESSION)
return false;
return true;
@@ -48,7 +48,7 @@ bool IsPartOfSkillLine(uint32 skillId, uint32 spellId)
{
SkillLineAbilityMapBounds skillBounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId);
for (SkillLineAbilityMap::const_iterator itr = skillBounds.first; itr != skillBounds.second; ++itr)
- if (itr->second->skillId == skillId)
+ if (itr->second->SkillLine == skillId)
return true;
return false;
@@ -199,20 +199,20 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, WorldObject const* cast
return spellId; //return source spell
}
- if (difficultyEntry->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC)
+ if (difficultyEntry->DifficultySpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC)
{
TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is NULL, using mode %u", spellId, mode, mode - 2);
mode -= 2;
}
- if (difficultyEntry->SpellID[mode] <= 0)
+ if (difficultyEntry->DifficultySpellID[mode] <= 0)
{
TC_LOG_ERROR("sql.sql", "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spellId, mode);
return spellId;
}
- TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->SpellID[mode]);
- return uint32(difficultyEntry->SpellID[mode]);
+ TC_LOG_DEBUG("spells", "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->DifficultySpellID[mode]);
+ return uint32(difficultyEntry->DifficultySpellID[mode]);
}
SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell, WorldObject const* caster) const
@@ -727,7 +727,7 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return false;
AreaTableEntry const* pArea = sAreaTableStore.LookupEntry(player->GetAreaId());
- if (!(pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE))
+ if (!(pArea && pArea->Flags & AREA_FLAG_NO_FLY_ZONE))
return false;
if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY))
return false;
@@ -810,9 +810,9 @@ void SpellMgr::LoadSpellTalentRanks()
SpellInfo const* lastSpell = nullptr;
for (uint8 rank = MAX_TALENT_RANK - 1; rank > 0; --rank)
{
- if (talentInfo->RankID[rank])
+ if (talentInfo->SpellRank[rank])
{
- lastSpell = GetSpellInfo(talentInfo->RankID[rank]);
+ lastSpell = GetSpellInfo(talentInfo->SpellRank[rank]);
break;
}
}
@@ -820,17 +820,17 @@ void SpellMgr::LoadSpellTalentRanks()
if (!lastSpell)
continue;
- SpellInfo const* firstSpell = GetSpellInfo(talentInfo->RankID[0]);
+ SpellInfo const* firstSpell = GetSpellInfo(talentInfo->SpellRank[0]);
if (!firstSpell)
{
- TC_LOG_ERROR("spells", "SpellMgr::LoadSpellTalentRanks: First Rank Spell %u for TalentEntry %u does not exist.", talentInfo->RankID[0], i);
+ TC_LOG_ERROR("spells", "SpellMgr::LoadSpellTalentRanks: First Rank Spell %u for TalentEntry %u does not exist.", talentInfo->SpellRank[0], i);
continue;
}
SpellInfo const* prevSpell = nullptr;
for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank)
{
- uint32 spellId = talentInfo->RankID[rank];
+ uint32 spellId = talentInfo->SpellRank[rank];
if (!spellId)
break;
@@ -847,7 +847,7 @@ void SpellMgr::LoadSpellTalentRanks()
node.rank = rank + 1;
node.prev = prevSpell;
- node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->RankID[node.rank]) : nullptr;
+ node.next = node.rank < MAX_TALENT_RANK ? GetSpellInfo(talentInfo->SpellRank[node.rank]) : nullptr;
mSpellChains[spellId] = node;
mSpellInfoMap[spellId]->ChainEntry = &mSpellChains[spellId];
@@ -1970,7 +1970,7 @@ void SpellMgr::LoadSkillLineAbilityMap()
if (!SkillInfo)
continue;
- mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId, SkillInfo));
+ mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->Spell, SkillInfo));
++count;
}
@@ -2195,7 +2195,7 @@ void SpellMgr::LoadPetLevelupSpellMap()
for (uint8 j = 0; j < 2; ++j)
{
- if (!creatureFamily->skillLine[j])
+ if (!creatureFamily->SkillLine[j])
continue;
for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k)
@@ -2204,17 +2204,17 @@ void SpellMgr::LoadPetLevelupSpellMap()
if (!skillLine)
continue;
- //if (skillLine->skillId != creatureFamily->skillLine[0] &&
- // (!creatureFamily->skillLine[1] || skillLine->skillId != creatureFamily->skillLine[1]))
+ //if (skillLine->skillId != creatureFamily->SkillLine[0] &&
+ // (!creatureFamily->SkillLine[1] || skillLine->skillId != creatureFamily->SkillLine[1]))
// continue;
- if (skillLine->skillId != creatureFamily->skillLine[j])
+ if (skillLine->SkillLine != creatureFamily->SkillLine[j])
continue;
- if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
+ if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;
- SpellInfo const* spell = GetSpellInfo(skillLine->spellId);
+ SpellInfo const* spell = GetSpellInfo(skillLine->Spell);
if (!spell) // not exist or triggered or talent
continue;
@@ -2305,7 +2305,7 @@ void SpellMgr::LoadPetDefaultSpells()
int32 petSpellsId = -int32(creatureTemplatePair.second.PetSpellDataId);
PetDefaultSpellsEntry petDefSpells;
for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
- petDefSpells.spellid[j] = spellDataEntry->spellId[j];
+ petDefSpells.spellid[j] = spellDataEntry->Spells[j];
if (LoadPetDefaultSpells_helper(&creatureTemplatePair.second, petDefSpells))
{
@@ -2566,7 +2566,7 @@ void SpellMgr::LoadSpellInfoStore()
mSpellInfoMap.resize(sSpellStore.GetNumRows(), nullptr);
for (SpellEntry const* spellEntry : sSpellStore)
- mSpellInfoMap[spellEntry->Id] = new SpellInfo(spellEntry);
+ mSpellInfoMap[spellEntry->ID] = new SpellInfo(spellEntry);
for (uint32 spellIndex = 0; spellIndex < GetSpellInfoStoreSize(); ++spellIndex)
{
@@ -2734,10 +2734,10 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
{
- if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
- SpellInfo* procInfo = _GetSpellInfo(enchant->spellid[s]);
+ SpellInfo* procInfo = _GetSpellInfo(enchant->EffectArg[s]);
if (!procInfo)
continue;
@@ -2943,7 +2943,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
// add custom attribute to liquid auras
for (LiquidTypeEntry const* liquid : sLiquidTypeStore)
{
- if (uint32 spellId = liquid->SpellId)
+ if (uint32 spellId = liquid->SpellID)
if (SpellInfo* spellInfo = _GetSpellInfo(spellId))
spellInfo->AttributesCu |= SPELL_ATTR0_CU_LIQUID_AURA;
}
@@ -4931,8 +4931,8 @@ void SpellMgr::LoadSpellInfoCorrections()
// Get triggered spell if any
if (SpellInfo* spellInfoTrigger = const_cast<SpellInfo*>(GetSpellInfo(spellInfo->Effects[j].TriggerSpell)))
{
- float maxRangeMain = spellInfo->RangeEntry ? spellInfo->RangeEntry->maxRangeHostile : 0.0f;
- float maxRangeTrigger = spellInfoTrigger->RangeEntry ? spellInfoTrigger->RangeEntry->maxRangeHostile : 0.0f;
+ float maxRangeMain = spellInfo->RangeEntry ? spellInfo->RangeEntry->RangeMax[0] : 0.0f;
+ float maxRangeTrigger = spellInfoTrigger->RangeEntry ? spellInfoTrigger->RangeEntry->RangeMax[0] : 0.0f;
// check if triggered spell has enough max range to cover trajectory
if (maxRangeTrigger < maxRangeMain)
@@ -5004,11 +5004,11 @@ void SpellMgr::LoadSpellInfoCorrections()
}
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121)))
- properties->Type = SUMMON_TYPE_TOTEM;
+ properties->Title = SUMMON_TYPE_TOTEM;
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647))) // 52893
- properties->Type = SUMMON_TYPE_TOTEM;
+ properties->Title = SUMMON_TYPE_TOTEM;
if (SummonPropertiesEntry* properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(628))) // Hungry Plaguehound
- properties->Category = SUMMON_CATEGORY_PET;
+ properties->Control = SUMMON_CATEGORY_PET;
if (LockEntry* entry = const_cast<LockEntry*>(sLockStore.LookupEntry(36))) // 3366 Opening, allows to open without proper key
entry->Type[2] = LOCK_KEY_NONE;