diff options
Diffstat (limited to 'src/server/game')
80 files changed, 966 insertions, 966 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 364690c2999..0036e2e48be 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -312,7 +312,7 @@ bool SpellTargetSelector::operator()(Unit const* target) const float rangeMod = 0.0f; if (_spellInfo->RangeEntry) { - if (_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE) + if (_spellInfo->RangeEntry->Flags & SPELL_RANGE_MELEE) { rangeMod = _caster->GetCombatReach() + 4.0f / 3.0f; rangeMod += target->GetCombatReach(); @@ -322,7 +322,7 @@ bool SpellTargetSelector::operator()(Unit const* target) const else { float meleeRange = 0.0f; - if (_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED) + if (_spellInfo->RangeEntry->Flags & SPELL_RANGE_RANGED) { meleeRange = _caster->GetCombatReach() + 4.0f / 3.0f; meleeRange += target->GetCombatReach(); @@ -336,12 +336,12 @@ bool SpellTargetSelector::operator()(Unit const* target) const rangeMod = _caster->GetCombatReach(); rangeMod += target->GetCombatReach(); - if (minRange > 0.0f && !(_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED)) + if (minRange > 0.0f && !(_spellInfo->RangeEntry->Flags & SPELL_RANGE_RANGED)) minRange += rangeMod; } if (_caster->isMoving() && target->isMoving() && !_caster->IsWalking() && !target->IsWalking() && - (_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE || target->GetTypeId() == TYPEID_PLAYER)) + (_spellInfo->RangeEntry->Flags & SPELL_RANGE_MELEE || target->GetTypeId() == TYPEID_PLAYER)) rangeMod += 8.0f / 3.0f; } diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index e028665e843..b13c1660fc8 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -161,7 +161,7 @@ static bool ShouldFollowOnSpawn(SummonPropertiesEntry const* properties) if (!properties) return false; - switch (properties->Category) + switch (properties->Control) { case SUMMON_CATEGORY_PET: return true; @@ -170,7 +170,7 @@ static bool ShouldFollowOnSpawn(SummonPropertiesEntry const* properties) case SUMMON_CATEGORY_UNK: if (properties->Flags & 512) return true; - switch (properties->Type) + switch (properties->Title) { case SUMMON_TYPE_PET: case SUMMON_TYPE_GUARDIAN: diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index d348515ef45..e45e8e3841a 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -1123,10 +1123,10 @@ class SmartTrigger : public AreaTriggerScript if (!player->IsAlive()) return false; - TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->id); + TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->ID); SmartScript script; script.OnInitialize(player, trigger); - script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id); + script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->ID); return true; } }; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 1df7d601d21..706c48f2dcd 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3693,7 +3693,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn if (obj) TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); if (at) - TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); + TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->ID); return; } for (SmartScriptHolder& scriptholder : e) @@ -3737,7 +3737,7 @@ void SmartScript::GetScript() } else if (trigger) { - e = sSmartScriptMgr->GetScript((int32)trigger->id, mScriptType); + e = sSmartScriptMgr->GetScript((int32)trigger->ID, mScriptType); FillScript(e, nullptr, trigger); } } @@ -3764,7 +3764,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER; trigger = at; atPlayer = obj->ToPlayer(); - TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u, triggered by player %s", trigger->id, atPlayer->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u, triggered by player %s", trigger->ID, atPlayer->GetGUID().ToString().c_str()); } else TC_LOG_ERROR("misc", "SmartScript::OnInitialize: !WARNING! Player TypeID is only allowed for AreaTriggers"); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 0e4f4c7f06a..31c98d61fab 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -1539,7 +1539,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; } - if (areaEntry->zone != 0) + if (areaEntry->ParentAreaID != 0) { TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses subzone (ID: %u) instead of zone, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.overrideLight.zoneId); return false; @@ -1568,7 +1568,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; } - if (areaEntry->zone != 0) + if (areaEntry->ParentAreaID != 0) { TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses subzone (ID: %u) instead of zone, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.overrideWeather.zoneId); return false; diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index d66dce6adf2..3acc3a6efc2 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -451,7 +451,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Wo case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE: { if (CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(known_title.title_id)) - return source->HasTitle(titleInfo->bit_index); + return source->HasTitle(titleInfo->MaskID); return false; } case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_ITEM_QUALITY: @@ -521,7 +521,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaCondition condi for (AchievementCriteriaEntry const* achievementCriteria : *achievementCriteriaList) { - AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->ReferredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->AchievementID); if (!achievement) continue; @@ -771,7 +771,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type, miscValue1); for (AchievementCriteriaEntry const* achievementCriteria : achievementCriteriaList) { - AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->ReferredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(achievementCriteria->AchievementID); if (!achievement) continue; @@ -997,7 +997,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter.first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) { - if (skillIter->second->skillId == achievementCriteria->Asset.SkillID) + if (skillIter->second->SkillLine == achievementCriteria->Asset.SkillID) { // do not add couter twice if by any chance skill is listed twice in dbc (eg. skill 777 and spell 22717) ++spellCount; @@ -1025,7 +1025,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter.first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) { - if (skillIter->second->skillId == achievementCriteria->Asset.SkillID) + if (skillIter->second->SkillLine == achievementCriteria->Asset.SkillID) { // do not add couter twice if by any chance skill is listed twice in dbc (eg. skill 777 and spell 22717) ++spellCount; @@ -1215,18 +1215,18 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE: case ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS: case ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS: - return progress->counter >= achievementCriteria->Amount; + return progress->counter >= achievementCriteria->Quantity; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT: case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL: case ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA: return progress->counter >= 1; case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL: - return progress->counter >= (achievementCriteria->Amount * 75); + return progress->counter >= (achievementCriteria->Quantity * 75); case ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS: return progress->counter >= 9000; case ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA: - return achievementCriteria->Amount && progress->counter >= achievementCriteria->Amount; + return achievementCriteria->Quantity && progress->counter >= achievementCriteria->Quantity; case ACHIEVEMENT_CRITERIA_TYPE_ON_LOGIN: return true; // handle all statistic-only criteria here @@ -1312,7 +1312,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) count += progress->counter; // for counters, field4 contains the main count requirement - if (count >= criteria->Amount) + if (count >= criteria->Quantity) return true; } return false; @@ -1408,7 +1408,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, if (entry->StartTimer) { // has to exist, otherwise we wouldn't be here - timedCompleted = IsCompletedCriteria(entry, sAchievementMgr->GetAchievement(entry->ReferredAchievement)); + timedCompleted = IsCompletedCriteria(entry, sAchievementMgr->GetAchievement(entry->AchievementID)); // Client expects this in packet timeElapsed = entry->StartTimer - (timedIter->second/IN_MILLISECONDS); @@ -1465,7 +1465,7 @@ void AchievementMgr::StartTimedAchievement(AchievementCriteriaTimedTypes type, u if (criteria->StartAsset != entry) continue; - AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->ReferredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->AchievementID); if (m_timedAchievements.find(criteria->ID) == m_timedAchievements.end() && !IsCompletedCriteria(criteria, achievement)) { // Start the timer @@ -1640,7 +1640,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, return false; } - if (achievement->MapID != -1 && GetPlayer()->GetMapId() != uint32(achievement->MapID)) + if (achievement->InstanceID != -1 && GetPlayer()->GetMapId() != uint32(achievement->InstanceID)) { TC_LOG_TRACE("achievement", "CanUpdateCriteria: (Id: %u Type %s Achievement %u) Wrong map", criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->Type), achievement->ID); @@ -1885,17 +1885,17 @@ bool AchievementMgr::RequirementsSatisfied(AchievementCriteriaEntry const* achie return false; bool matchFound = false; - for (uint32 j : worldOverlayEntry->areatableID) + for (uint32 j : worldOverlayEntry->AreaID) { AreaTableEntry const* area = sAreaTableStore.LookupEntry(j); if (!area) break; - uint32 playerIndexOffset = uint32(area->exploreFlag) / 32; + uint32 playerIndexOffset = uint32(area->AreaBit) / 32; if (playerIndexOffset >= PLAYER_EXPLORED_ZONES_SIZE) continue; - uint32 mask = 1 << (uint32(area->exploreFlag) % 32); + uint32 mask = 1 << (uint32(area->AreaBit) % 32); if (GetPlayer()->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + playerIndexOffset) & mask) { matchFound = true; @@ -2325,7 +2325,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() criteria->Type + 1, ACHIEVEMENT_CRITERIA_TYPE_TOTAL); m_AchievementCriteriasByType[criteria->Type].push_back(criteria); - m_AchievementCriteriaListByAchievement[criteria->ReferredAchievement].push_back(criteria); + m_AchievementCriteriaListByAchievement[criteria->AchievementID].push_back(criteria); if (IsAchievementCriteriaTypeStoredByMiscValue(AchievementCriteriaTypes(criteria->Type))) { if (criteria->Type != ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA) @@ -2338,14 +2338,14 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() for (uint8 j = 0; j < MAX_WORLD_MAP_OVERLAY_AREA_IDX; ++j) { - if (worldOverlayEntry->areatableID[j]) + if (worldOverlayEntry->AreaID[j]) { bool valid = true; for (uint8 i = 0; i < j; ++i) - if (worldOverlayEntry->areatableID[j] == worldOverlayEntry->areatableID[i]) + if (worldOverlayEntry->AreaID[j] == worldOverlayEntry->AreaID[i]) valid = false; if (valid) - m_AchievementCriteriasByMiscValue[criteria->Type][worldOverlayEntry->areatableID[j]].push_back(criteria); + m_AchievementCriteriasByMiscValue[criteria->Type][worldOverlayEntry->AreaID[j]].push_back(criteria); } } } @@ -2403,7 +2403,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() // Once Bitten, Twice Shy (10 player) - Icecrown Citadel if (AchievementEntry const* achievement = sAchievementMgr->GetAchievement(4539)) - const_cast<AchievementEntry*>(achievement)->MapID = 631; // Correct map requirement (currently has Ulduar) + const_cast<AchievementEntry*>(achievement)->InstanceID = 631; // Correct map requirement (currently has Ulduar) TC_LOG_INFO("server.loading", ">> Loaded %u achievement references in %u ms.", count, GetMSTimeDiffToNow(oldMSTime)); } @@ -2495,7 +2495,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() break; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST: { - AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->ReferredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->AchievementID); if (!achievement) continue; @@ -2510,21 +2510,21 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() continue; break; case ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE: // need skip generic cases - if (criteria->Amount == 0) + if (criteria->Quantity == 0) continue; break; case ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL: // skip statistics - if (criteria->Amount == 0) + if (criteria->Quantity == 0) continue; break; case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: // need skip generic cases - if (criteria->Amount != 1) + if (criteria->Quantity != 1) continue; break; case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST: case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM: // only Children's Week achievements { - AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->ReferredAchievement); + AchievementEntry const* achievement = sAchievementMgr->GetAchievement(criteria->AchievementID); if (!achievement) continue; if (achievement->Category != CATEGORY_CHILDRENS_WEEK && achievement->ID != 1785) @@ -2536,7 +2536,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() } if (!GetCriteriaDataSet(criteria) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, nullptr)) - TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` does not contain expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->Type, criteria->ReferredAchievement); + TC_LOG_ERROR("sql.sql", "Table `achievement_criteria_data` does not contain expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->Type, criteria->AchievementID); } TC_LOG_INFO("server.loading", ">> Loaded %u additional achievement criteria data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index a46a3d404c0..ec40e80ff6d 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -65,9 +65,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) FactionTemplateEntry const* uEntry = sFactionTemplateStore.LookupEntry(factionTemplateId); if (!uEntry) return &mNeutralAuctions; - else if (uEntry->ourMask & FACTION_MASK_ALLIANCE) + else if (uEntry->FactionGroup & FACTION_MASK_ALLIANCE) return &mAllianceAuctions; - else if (uEntry->ourMask & FACTION_MASK_HORDE) + else if (uEntry->FactionGroup & FACTION_MASK_HORDE) return &mHordeAuctions; else return &mNeutralAuctions; @@ -93,7 +93,7 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 if (MSV <= 0) return AH_MINIMUM_DEPOSIT * sWorld->getRate(RATE_AUCTION_DEPOSIT); - float multiplier = CalculatePct(float(entry->depositPercent), 3); + float multiplier = CalculatePct(float(entry->DepositRate), 3); uint32 timeHr = (((time / 60) / 60) / 12); uint32 deposit = uint32(MSV * multiplier * sWorld->getRate(RATE_AUCTION_DEPOSIT)); float remainderbase = float(MSV * multiplier * sWorld->getRate(RATE_AUCTION_DEPOSIT)) - deposit; @@ -576,9 +576,9 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(factionTemplateId); if (!u_entry) houseid = AUCTIONHOUSE_NEUTRAL; // goblin auction house - else if (u_entry->ourMask & FACTION_MASK_ALLIANCE) + else if (u_entry->FactionGroup & FACTION_MASK_ALLIANCE) houseid = AUCTIONHOUSE_ALLIANCE; // human auction house - else if (u_entry->ourMask & FACTION_MASK_HORDE) + else if (u_entry->FactionGroup & FACTION_MASK_HORDE) houseid = AUCTIONHOUSE_HORDE; // orc auction house else houseid = AUCTIONHOUSE_NEUTRAL; // goblin auction house @@ -798,13 +798,13 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player { ItemRandomSuffixEntry const* itemRandSuffix = sItemRandomSuffixStore.LookupEntry(-propRefID); if (itemRandSuffix) - suffix = itemRandSuffix->nameSuffix; + suffix = itemRandSuffix->Name; } else { ItemRandomPropertiesEntry const* itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID); if (itemRandProp) - suffix = itemRandProp->nameSuffix; + suffix = itemRandProp->Name; } // dbc local name @@ -869,7 +869,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data, Item* sourceItem) const uint32 AuctionEntry::GetAuctionCut() const { - int32 cut = int32(CalculatePct(bid, auctionHouseEntry->cutPercent) * sWorld->getRate(RATE_AUCTION_CUT)); + int32 cut = int32(CalculatePct(bid, auctionHouseEntry->ConsignmentRate) * sWorld->getRate(RATE_AUCTION_CUT)); return std::max(cut, 0); } diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index b41a21b2a94..f85e9588fea 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -672,7 +672,7 @@ void BfGraveyard::SetSpirit(Creature* spirit, TeamId team) float BfGraveyard::GetDistance(Player* player) { WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(m_GraveyardId); - return player->GetDistance2d(safeLoc->x, safeLoc->y); + return player->GetDistance2d(safeLoc->Loc.X, safeLoc->Loc.Y); } void BfGraveyard::AddPlayer(ObjectGuid playerGuid) @@ -748,12 +748,12 @@ void BfGraveyard::RelocateDeadPlayers() continue; if (closestGrave) - player->TeleportTo(player->GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation()); + player->TeleportTo(player->GetMapId(), closestGrave->Loc.X, closestGrave->Loc.Y, closestGrave->Loc.Z, player->GetOrientation()); else { closestGrave = m_Bf->GetClosestGraveyard(player); if (closestGrave) - player->TeleportTo(player->GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation()); + player->TeleportTo(player->GetMapId(), closestGrave->Loc.X, closestGrave->Loc.Y, closestGrave->Loc.Z, player->GetOrientation()); } } } diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 6ff4e1c6ea4..11c2b134fd7 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1281,7 +1281,7 @@ void Battleground::RelocateDeadPlayers(ObjectGuid guideGuid) closestGrave = GetClosestGraveyard(player); if (closestGrave) - player->TeleportTo(GetMapId(), closestGrave->x, closestGrave->y, closestGrave->z, player->GetOrientation()); + player->TeleportTo(GetMapId(), closestGrave->Loc.X, closestGrave->Loc.Y, closestGrave->Loc.Z, player->GetOrientation()); } ghostList.clear(); } @@ -1773,7 +1773,7 @@ void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uin void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry) { m_BracketId = bracketEntry->GetBracketId(); - SetLevelRange(bracketEntry->minLevel, bracketEntry->maxLevel); + SetLevelRange(bracketEntry->MinLevel, bracketEntry->MaxLevel); } void Battleground::RewardXPAtKill(Player* killer, Player* victim) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 65e2561a257..cd3e926c277 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -49,7 +49,7 @@ bool BattlegroundTemplate::IsArena() const { - return BattlemasterEntry->type == MAP_ARENA; + return BattlemasterEntry->InstanceType == MAP_ARENA; } /*********************************************************/ @@ -499,8 +499,8 @@ bool BattlegroundMgr::CreateBattleground(BattlegroundTemplate const* bgTemplate) AddBattleground(bg); } - bg->SetMapId(bgTemplate->BattlemasterEntry->mapid[0]); - bg->SetName(bgTemplate->BattlemasterEntry->name[sWorld->GetDefaultDbcLocale()]); + bg->SetMapId(bgTemplate->BattlemasterEntry->MapID[0]); + bg->SetName(bgTemplate->BattlemasterEntry->Name[sWorld->GetDefaultDbcLocale()]); bg->SetArenaorBGType(bgTemplate->IsArena()); bg->SetMinPlayersPerTeam(bgTemplate->MinPlayersPerTeam); bg->SetMaxPlayersPerTeam(bgTemplate->MaxPlayersPerTeam); @@ -580,7 +580,7 @@ void BattlegroundMgr::LoadBattlegroundTemplates() uint32 startId = fields[5].GetUInt32(); if (WorldSafeLocsEntry const* start = sWorldSafeLocsStore.LookupEntry(startId)) { - bgTemplate.StartLocation[TEAM_ALLIANCE].Relocate(start->x, start->y, start->z, fields[6].GetFloat()); + bgTemplate.StartLocation[TEAM_ALLIANCE].Relocate(start->Loc.X, start->Loc.Y, start->Loc.Z, fields[6].GetFloat()); } else { @@ -591,7 +591,7 @@ void BattlegroundMgr::LoadBattlegroundTemplates() startId = fields[7].GetUInt32(); if (WorldSafeLocsEntry const* start = sWorldSafeLocsStore.LookupEntry(startId)) { - bgTemplate.StartLocation[TEAM_HORDE].Relocate(start->x, start->y, start->z, fields[8].GetFloat()); + bgTemplate.StartLocation[TEAM_HORDE].Relocate(start->Loc.X, start->Loc.Y, start->Loc.Z, fields[8].GetFloat()); } else { @@ -605,8 +605,8 @@ void BattlegroundMgr::LoadBattlegroundTemplates() _battlegroundTemplates[bgTypeId] = bgTemplate; - if (bgTemplate.BattlemasterEntry->mapid[1] == -1) // in this case we have only one mapId - _battlegroundMapTemplates[bgTemplate.BattlemasterEntry->mapid[0]] = &_battlegroundTemplates[bgTypeId]; + if (bgTemplate.BattlemasterEntry->MapID[1] == -1) // in this case we have only one mapId + _battlegroundMapTemplates[bgTemplate.BattlemasterEntry->MapID[0]] = &_battlegroundTemplates[bgTypeId]; ++count; } @@ -973,7 +973,7 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId) ids.reserve(16); std::vector<double> weights; weights.reserve(16); - for (int32 mapId : bgTemplate->BattlemasterEntry->mapid) + for (int32 mapId : bgTemplate->BattlemasterEntry->MapID) { if (mapId == -1) break; diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 633226f5caf..9f36154feff 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -205,8 +205,8 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr uint32 MinPlayers = bg->GetMinPlayersPerTeam(); uint32 qHorde = 0; uint32 qAlliance = 0; - uint32 q_min_level = bracketEntry->minLevel; - uint32 q_max_level = bracketEntry->maxLevel; + uint32 q_min_level = bracketEntry->MinLevel; + uint32 q_max_level = bracketEntry->MaxLevel; GroupsQueueType::const_iterator itr; for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 1b3d927840c..5dce8af082f 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -658,7 +658,7 @@ WorldSafeLocsEntry const* BattlegroundAB::GetClosestGraveyard(Player* player) WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(BG_AB_GraveyardIds[nodes[i]]); if (!entry) continue; - float dist = (entry->x - plr_x)*(entry->x - plr_x)+(entry->y - plr_y)*(entry->y - plr_y); + float dist = (entry->Loc.X - plr_x)*(entry->Loc.X - plr_x)+(entry->Loc.Y - plr_y)*(entry->Loc.Y - plr_y); if (mindist > dist) { mindist = dist; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 5d3fbc48589..1bf959a3905 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1117,7 +1117,7 @@ WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveyard(Player* player) player->GetPosition(x, y); pGraveyard = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[GetTeamIndexByTeamId(player->GetTeam())+7]); - minDist = (pGraveyard->x - x)*(pGraveyard->x - x)+(pGraveyard->y - y)*(pGraveyard->y - y); + minDist = (pGraveyard->Loc.X - x)*(pGraveyard->Loc.X - x)+(pGraveyard->Loc.Y - y)*(pGraveyard->Loc.Y - y); for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED) @@ -1125,7 +1125,7 @@ WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveyard(Player* player) entry = sWorldSafeLocsStore.LookupEntry(BG_AV_GraveyardIds[i]); if (entry) { - dist = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y); + dist = (entry->Loc.X - x)*(entry->Loc.X - x)+(entry->Loc.Y - y)*(entry->Loc.Y - y); if (dist < minDist) { minDist = dist; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 5c7dc7cc64f..81524e44fd7 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -506,22 +506,22 @@ bool BattlegroundEY::SetupBattleground() TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]); continue; } - if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) - || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) - || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) ) TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Could not spawn Speedbuff Fel Reaver."); } WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE); - if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE)) + if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.124139f, TEAM_ALLIANCE)) { TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created."); return false; } sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_HORDE); - if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE)) + if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.193953f, TEAM_HORDE)) { TC_LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created."); return false; @@ -758,7 +758,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point) DelCreature(Point); WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveyardId); - if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, GetTeamIndexByTeamId(Team))) + if (!sg || !AddSpiritGuide(Point, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.124139f, GetTeamIndexByTeamId(Team))) TC_LOG_ERROR("bg.battleground", "BatteGroundEY: Failed to spawn spirit guide. point: %u, team: %u, graveyard_id: %u", Point, Team, m_CapturingPointTypes[Point].GraveyardId); @@ -897,7 +897,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveyard(Player* player) float plr_y = player->GetPositionY(); float plr_z = player->GetPositionZ(); - distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z); + distance = (entry->Loc.X - plr_x)*(entry->Loc.X - plr_x) + (entry->Loc.Y - plr_y)*(entry->Loc.Y - plr_y) + (entry->Loc.Z - plr_z)*(entry->Loc.Z - plr_z); nearestDistance = distance; for (uint8 i = 0; i < EY_POINTS_MAX; ++i) @@ -909,7 +909,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveyard(Player* player) TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Graveyard %u could not be found.", m_CapturingPointTypes[i].GraveyardId); else { - distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z); + distance = (entry->Loc.X - plr_x)*(entry->Loc.X - plr_x) + (entry->Loc.Y - plr_y)*(entry->Loc.Y - plr_y) + (entry->Loc.Z - plr_z)*(entry->Loc.Z - plr_z); if (distance < nearestDistance) { nearestDistance = distance; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index 249688c1419..4209edc3eec 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -884,7 +884,7 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveyard(Player* player) WorldSafeLocsEntry const*entry = sWorldSafeLocsStore.LookupEntry(BG_IC_GraveyardIds[nodes[i]]); if (!entry) continue; - float dist = (entry->x - player_x)*(entry->x - player_x)+(entry->y - player_y)*(entry->y - player_y); + float dist = (entry->Loc.X - player_x)*(entry->Loc.X - player_x)+(entry->Loc.Y - player_y)*(entry->Loc.Y - player_y); if (mindist > dist) { mindist = dist; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 99eb4808461..ed7d96ca693 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -205,12 +205,12 @@ bool BattlegroundSA::ResetObjs() if (i == BG_SA_BEACH_GY) { GraveyardStatus[i] = Attackers; - AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], Attackers); + AddSpiritGuide(i + BG_SA_MAXNPC, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, BG_SA_GYOrientation[i], Attackers); } else { GraveyardStatus[i] = ((Attackers == TEAM_HORDE)? TEAM_ALLIANCE : TEAM_HORDE); - if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], Attackers == TEAM_HORDE ? TEAM_ALLIANCE : TEAM_HORDE)) + if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, BG_SA_GYOrientation[i], Attackers == TEAM_HORDE ? TEAM_ALLIANCE : TEAM_HORDE)) TC_LOG_ERROR("bg.battleground", "SOTA: couldn't spawn GY: %u", i); } } @@ -706,7 +706,7 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveyard(Player* player) safeloc = BG_SA_GYEntries[BG_SA_DEFENDER_LAST_GY]; closest = sWorldSafeLocsStore.LookupEntry(safeloc); - nearest = player->GetExactDistSq(closest->x, closest->y, closest->z); + nearest = player->GetExactDistSq(closest->Loc.X, closest->Loc.Y, closest->Loc.Z); for (uint8 i = BG_SA_RIGHT_CAPTURABLE_GY; i < BG_SA_MAX_GY; i++) { @@ -714,7 +714,7 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveyard(Player* player) continue; ret = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]); - dist = player->GetExactDistSq(ret->x, ret->y, ret->z); + dist = player->GetExactDistSq(ret->Loc.X, ret->Loc.Y, ret->Loc.Z); if (dist < nearest) { closest = ret; @@ -814,7 +814,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source) return; } - AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], GraveyardStatus[i]); + AddSpiritGuide(i + BG_SA_MAXNPC, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, BG_SA_GYOrientation[i], GraveyardStatus[i]); uint32 npc = 0; uint32 flag = 0; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index 8b24aa1bc0f..b1f129d06cb 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -697,14 +697,14 @@ bool BattlegroundWS::SetupBattleground() } WorldSafeLocsEntry const* sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE); - if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE)) + if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.124139f, TEAM_ALLIANCE)) { TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!"); return false; } sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE); - if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE)) + if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.193953f, TEAM_HORDE)) { TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!"); return false; diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index e3e235ace23..b533e6901ef 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -47,13 +47,13 @@ Channel::Channel(uint32 channelId, uint32 team /*= 0*/, AreaTableEntry const* zo _zoneEntry(zoneEntry) { ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); - if (channelEntry->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel + if (channelEntry->Flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel _channelFlags |= CHANNEL_FLAG_TRADE; - if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels + if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels _channelFlags |= CHANNEL_FLAG_CITY; - if (channelEntry->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel + if (channelEntry->Flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel _channelFlags |= CHANNEL_FLAG_LFG; else // for all other channels _channelFlags |= CHANNEL_FLAG_NOT_LFG; @@ -90,15 +90,15 @@ void Channel::GetChannelName(std::string& channelName, uint32 channelId, LocaleC if (channelId) { ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); - if (!(channelEntry->flags & CHANNEL_DBC_FLAG_GLOBAL)) + if (!(channelEntry->Flags & CHANNEL_DBC_FLAG_GLOBAL)) { - if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY) - channelName = Trinity::StringFormat(channelEntry->pattern[locale], sObjectMgr->GetTrinityString(LANG_CHANNEL_CITY, locale)); + if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY) + channelName = Trinity::StringFormat(channelEntry->Name[locale], sObjectMgr->GetTrinityString(LANG_CHANNEL_CITY, locale)); else - channelName = Trinity::StringFormat(channelEntry->pattern[locale], ASSERT_NOTNULL(zoneEntry)->area_name[locale]); + channelName = Trinity::StringFormat(channelEntry->Name[locale], ASSERT_NOTNULL(zoneEntry)->AreaName[locale]); } else - channelName = channelEntry->pattern[locale]; + channelName = channelEntry->Name[locale]; } } diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index 9d05ff3caae..bd0a3667c63 100644 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -154,7 +154,7 @@ Channel* ChannelMgr::GetSystemChannel(uint32 channelId, AreaTableEntry const* zo { ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); uint32 zoneId = zoneEntry ? zoneEntry->ID : 0; - if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) + if (channelEntry->Flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) zoneId = 0; std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId); @@ -210,7 +210,7 @@ Channel* ChannelMgr::GetChannel(uint32 channelId, std::string const& name, Playe { ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); uint32 zoneId = zoneEntry ? zoneEntry->ID : 0; - if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) + if (channelEntry->Flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) zoneId = 0; std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId); @@ -252,7 +252,7 @@ void ChannelMgr::LeftChannel(uint32 channelId, AreaTableEntry const* zoneEntry) { ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); uint32 zoneId = zoneEntry ? zoneEntry->ID : 0; - if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) + if (channelEntry->Flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) zoneId = 0; std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index b5fde171ba0..20468af0511 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -290,9 +290,9 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId)) { int locale = GetSessionDbcLocale(); - areaName = area->area_name[locale]; - if (AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->zone)) - zoneName = zone->area_name[locale]; + areaName = area->AreaName[locale]; + if (AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->ParentAreaID)) + zoneName = zone->AreaName[locale]; } sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (%s) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected: %s (%s)]", @@ -877,7 +877,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text) if (rank >= MAX_TALENT_RANK) return 0; - return talentEntry->RankID[rank]; + return talentEntry->SpellRank[rank]; } case SPELL_LINK_ENCHANT: case SPELL_LINK_TRADE: @@ -890,7 +890,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text) if (!glyphPropEntry) return 0; - return glyphPropEntry->SpellId; + return glyphPropEntry->SpellID; } } diff --git a/src/server/game/Chat/HyperlinkTags.cpp b/src/server/game/Chat/HyperlinkTags.cpp index dd3ee990204..6276cd0cafb 100644 --- a/src/server/game/Chat/HyperlinkTags.cpp +++ b/src/server/game/Chat/HyperlinkTags.cpp @@ -130,7 +130,7 @@ bool Trinity::Hyperlinks::LinkTags::talent::StoreTo(TalentLinkData& val, char co val.Rank = rank+1; if (!(val.Talent = sTalentStore.LookupEntry(talentId))) return false; - if (val.Rank > 0 && !val.Talent->RankID[val.Rank - 1]) + if (val.Rank > 0 && !val.Talent->SpellRank[val.Rank - 1]) return false; return true; } diff --git a/src/server/game/Chat/Hyperlinks.cpp b/src/server/game/Chat/Hyperlinks.cpp index f561b1d7ebb..eb49cdcc10b 100644 --- a/src/server/game/Chat/Hyperlinks.cpp +++ b/src/server/game/Chat/Hyperlinks.cpp @@ -128,14 +128,14 @@ struct LinkValidator<LinkTags::item> if (data.RandomPropertyId < 0) { if (ItemRandomSuffixEntry const* suffixEntry = sItemRandomSuffixStore.LookupEntry(-data.RandomPropertyId)) - randomSuffix = suffixEntry->nameSuffix; + randomSuffix = suffixEntry->Name; else return false; } else if (data.RandomPropertyId > 0) { if (ItemRandomPropertiesEntry const* propEntry = sItemRandomPropertiesStore.LookupEntry(data.RandomPropertyId)) - randomSuffix = propEntry->nameSuffix; + randomSuffix = propEntry->Name; else return false; } @@ -227,13 +227,13 @@ struct LinkValidator<LinkTags::enchant> for (auto pair = bounds.first; pair != bounds.second; ++pair) { - SkillLineEntry const* skill = sSkillLineStore.LookupEntry(pair->second->skillId); + SkillLineEntry const* skill = sSkillLineStore.LookupEntry(pair->second->SkillLine); if (!skill) return false; for (uint8 i = 0; i < TOTAL_LOCALES; ++i) { - char const* skillName = skill->name[i]; + char const* skillName = skill->DisplayName[i]; size_t skillLen = strlen(skillName); if (len > skillLen + 2 && // or of form [Skill Name: Spell Name] !strncmp(pos, skillName, skillLen) && !strncmp(pos + skillLen, ": ", 2) && @@ -255,7 +255,7 @@ struct LinkValidator<LinkTags::glyph> { static bool IsTextValid(GlyphLinkData const& data, char const* pos, size_t len) { - if (SpellInfo const* info = sSpellMgr->GetSpellInfo(data.Glyph->SpellId)) + if (SpellInfo const* info = sSpellMgr->GetSpellInfo(data.Glyph->SpellID)) return LinkValidator<LinkTags::spell>::IsTextValid(info, pos, len); return false; } @@ -271,7 +271,7 @@ struct LinkValidator<LinkTags::talent> { static bool IsTextValid(TalentLinkData const& data, char const* pos, size_t len) { - if (SpellInfo const* info = sSpellMgr->GetSpellInfo(data.Talent->RankID[0])) + if (SpellInfo const* info = sSpellMgr->GetSpellInfo(data.Talent->SpellRank[0])) return LinkValidator<LinkTags::spell>::IsTextValid(info, pos, len); return false; } diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 0cfa9e9a71d..50a81782fa2 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1894,7 +1894,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const return false; } - if (areaEntry->zone != 0) + if (areaEntry->ParentAreaID != 0) { TC_LOG_ERROR("sql.sql", "%s requires to be in area (%u) which is a subzone but zone expected, skipped.", cond->ToString(true).c_str(), cond->ConditionValue1); return false; diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 546037984fb..7147e3c8e10 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -131,7 +131,7 @@ void LoadDisables() continue; } bool isFlagInvalid = false; - switch (mapEntry->map_type) + switch (mapEntry->InstanceType) { case MAP_COMMON: if (flags) @@ -195,7 +195,7 @@ void LoadDisables() TC_LOG_ERROR("sql.sql", "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry); continue; } - switch (mapEntry->map_type) + switch (mapEntry->InstanceType) { case MAP_COMMON: if (flags & VMAP::VMAP_DISABLE_AREAFLAG) @@ -235,7 +235,7 @@ void LoadDisables() TC_LOG_ERROR("sql.sql", "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry); continue; } - switch (mapEntry->map_type) + switch (mapEntry->InstanceType) { case MAP_COMMON: TC_LOG_INFO("misc", "Pathfinding disabled for world map %u.", entry); @@ -383,7 +383,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, WorldObject const* ref, uint8 return (disabledModes & RAID_STATUSFLAG_25MAN_HEROIC) != 0; } } - else if (mapEntry->map_type == MAP_COMMON) + else if (mapEntry->InstanceType == MAP_COMMON) return true; } return false; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 5e49a5dae97..03658b832d3 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -146,7 +146,7 @@ DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt); DBCStorage <QuestSortEntry> sQuestSortStore(QuestSortEntryfmt); DBCStorage <QuestXPEntry> sQuestXPStore(QuestXPfmt); DBCStorage <QuestFactionRewEntry> sQuestFactionRewardStore(QuestFactionRewardfmt); -DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore(RandomPropertiesPointsfmt); +DBCStorage <RandPropPointsEntry> sRandPropPointsStore(RandPropPointsfmt); DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore(ScalingStatDistributionfmt); DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore(ScalingStatValuesfmt); @@ -171,7 +171,7 @@ DBCStorage <SpellFocusObjectEntry> sSpellFocusObjectStore(SpellFocusObjectfmt); DBCStorage <SpellRadiusEntry> sSpellRadiusStore(SpellRadiusfmt); DBCStorage <SpellRangeEntry> sSpellRangeStore(SpellRangefmt); DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostfmt); -DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore(SpellShapeshiftfmt); +DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore(SpellShapeshiftFormfmt); DBCStorage <SpellVisualEntry> sSpellVisualStore(SpellVisualfmt); DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore(StableSlotPricesfmt); DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt); @@ -353,7 +353,7 @@ void LoadDBCStores(const std::string& dataPath) LOAD_DBC(sQuestXPStore, "QuestXP.dbc"); LOAD_DBC(sQuestFactionRewardStore, "QuestFactionReward.dbc"); LOAD_DBC(sQuestSortStore, "QuestSort.dbc"); - LOAD_DBC(sRandomPropertiesPointsStore, "RandPropPoints.dbc"); + LOAD_DBC(sRandPropPointsStore, "RandPropPoints.dbc"); LOAD_DBC(sScalingStatDistributionStore, "ScalingStatDistribution.dbc"); LOAD_DBC(sScalingStatValuesStore, "ScalingStatValues.dbc"); LOAD_DBC(sSkillLineStore, "SkillLine.dbc"); @@ -370,7 +370,7 @@ void LoadDBCStores(const std::string& dataPath) LOAD_DBC(sSpellRadiusStore, "SpellRadius.dbc"); LOAD_DBC(sSpellRangeStore, "SpellRange.dbc"); LOAD_DBC(sSpellRuneCostStore, "SpellRuneCost.dbc"); - LOAD_DBC(sSpellShapeshiftStore, "SpellShapeshiftForm.dbc"); + LOAD_DBC(sSpellShapeshiftFormStore, "SpellShapeshiftForm.dbc"); LOAD_DBC(sSpellVisualStore, "SpellVisual.dbc"); LOAD_DBC(sStableSlotPricesStore, "StableSlotPrices.dbc"); LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc"); @@ -401,41 +401,41 @@ void LoadDBCStores(const std::string& dataPath) #undef LOAD_DBC_EXT for (CharacterFacialHairStylesEntry const* entry : sCharacterFacialHairStylesStore) - if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races - sCharFacialHairMap.insert({ entry->Race | (entry->Gender << 8) | (entry->Variation << 16), entry }); + if (entry->RaceID && ((1 << (entry->RaceID - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races + sCharFacialHairMap.insert({ entry->RaceID | (entry->SexID << 8) | (entry->VariationID << 16), entry }); for (CharSectionsEntry const* entry : sCharSectionsStore) - if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races - sCharSectionMap.insert({ entry->GenType | (entry->Gender << 8) | (entry->Race << 16), entry }); + if (entry->RaceID && ((1 << (entry->RaceID - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races + sCharSectionMap.insert({ entry->BaseSection | (entry->SexID << 8) | (entry->RaceID << 16), entry }); for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore) - sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit; + sCharStartOutfitMap[outfit->RaceID | (outfit->ClassID << 8) | (outfit->SexID << 16)] = outfit; for (EmotesTextSoundEntry const* entry : sEmotesTextSoundStore) - sEmotesTextSoundMap[EmotesTextSoundKey(entry->EmotesTextId, entry->RaceId, entry->SexId)] = entry; + sEmotesTextSoundMap[EmotesTextSoundKey(entry->EmotesTextID, entry->RaceID, entry->SexID)] = entry; for (FactionEntry const* faction : sFactionStore) { - if (faction->team) + if (faction->ParentFactionID) { - SimpleFactionsList& flist = sFactionTeamMap[faction->team]; + SimpleFactionsList& flist = sFactionTeamMap[faction->ParentFactionID]; flist.push_back(faction->ID); } } for (GameObjectDisplayInfoEntry const* info : sGameObjectDisplayInfoStore) { - if (info->maxX < info->minX) - std::swap(*(float*)(&info->maxX), *(float*)(&info->minX)); - if (info->maxY < info->minY) - std::swap(*(float*)(&info->maxY), *(float*)(&info->minY)); - if (info->maxZ < info->minZ) - std::swap(*(float*)(&info->maxZ), *(float*)(&info->minZ)); + if (info->GeoBoxMax.X < info->GeoBoxMin.X) + std::swap(*(float*)(&info->GeoBoxMax.X), *(float*)(&info->GeoBoxMin.X)); + if (info->GeoBoxMax.Y < info->GeoBoxMin.Y) + std::swap(*(float*)(&info->GeoBoxMax.Y), *(float*)(&info->GeoBoxMin.Y)); + if (info->GeoBoxMax.Z < info->GeoBoxMin.Z) + std::swap(*(float*)(&info->GeoBoxMax.Z), *(float*)(&info->GeoBoxMin.Z)); } // fill data for (MapDifficultyEntry const* entry : sMapDifficultyStore) - sMapDifficultyMap[MAKE_PAIR32(entry->MapId, entry->Difficulty)] = MapDifficulty(entry->resetTime, entry->maxPlayers, entry->areaTriggerText[0] != '\0'); + sMapDifficultyMap[MAKE_PAIR32(entry->MapID, entry->Difficulty)] = MapDifficulty(entry->RaidDuration, entry->MaxPlayers, entry->Message[0] != '\0'); for (NamesProfanityEntry const* namesProfanity : sNamesProfanityStore) { @@ -467,29 +467,29 @@ void LoadDBCStores(const std::string& dataPath) for (PvPDifficultyEntry const* entry : sPvPDifficultyStore) { - ASSERT(entry->bracketId < MAX_BATTLEGROUND_BRACKETS, "PvpDifficulty bracket (%d) exceeded max allowed value (%d)", entry->bracketId, MAX_BATTLEGROUND_BRACKETS); + ASSERT(entry->RangeIndex < MAX_BATTLEGROUND_BRACKETS, "PvpDifficulty bracket (%d) exceeded max allowed value (%d)", entry->RangeIndex, MAX_BATTLEGROUND_BRACKETS); } for (SkillRaceClassInfoEntry const* entry : sSkillRaceClassInfoStore) - if (sSkillLineStore.LookupEntry(entry->SkillId)) - SkillRaceClassInfoBySkill.emplace(entry->SkillId, entry); + if (sSkillLineStore.LookupEntry(entry->SkillID)) + SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry); for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore) { - SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); + SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->Spell); if (spellInfo && spellInfo->Attributes & SPELL_ATTR0_PASSIVE) { for (CreatureFamilyEntry const* cFamily : sCreatureFamilyStore) { - if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1]) + if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1]) continue; - if (spellInfo->spellLevel) + if (spellInfo->SpellLevel) continue; - if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; - sPetFamilySpellsStore[cFamily->ID].insert(spellInfo->Id); + sPetFamilySpellsStore[cFamily->ID].insert(spellInfo->ID); } } } @@ -498,32 +498,32 @@ void LoadDBCStores(const std::string& dataPath) for (SpellDifficultyEntry const* spellDiff : sSpellDifficultyStore) { SpellDifficultyEntry newEntry; - memset(newEntry.SpellID, 0, 4*sizeof(uint32)); + memset(newEntry.DifficultySpellID, 0, 4*sizeof(uint32)); for (uint8 x = 0; x < MAX_DIFFICULTY; ++x) { - if (spellDiff->SpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->SpellID[x])) + if (spellDiff->DifficultySpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->DifficultySpellID[x])) { - if (spellDiff->SpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values - TC_LOG_ERROR("sql.sql", "spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->SpellID[x], spellDiff->ID, x); - newEntry.SpellID[x] = 0;//spell was <= 0 or invalid, set to 0 + if (spellDiff->DifficultySpellID[x] > 0)//don't show error if spell is <= 0, not all modes have spells and there are unknown negative values + TC_LOG_ERROR("sql.sql", "spelldifficulty_dbc: spell %i at field id:%u at spellid%i does not exist in SpellStore (spell.dbc), loaded as 0", spellDiff->DifficultySpellID[x], spellDiff->ID, x); + newEntry.DifficultySpellID[x] = 0;//spell was <= 0 or invalid, set to 0 } else - newEntry.SpellID[x] = spellDiff->SpellID[x]; + newEntry.DifficultySpellID[x] = spellDiff->DifficultySpellID[x]; } - if (newEntry.SpellID[0] <= 0 || newEntry.SpellID[1] <= 0)//id0-1 must be always set! + if (newEntry.DifficultySpellID[0] <= 0 || newEntry.DifficultySpellID[1] <= 0)//id0-1 must be always set! continue; for (uint8 x = 0; x < MAX_DIFFICULTY; ++x) - if (newEntry.SpellID[x]) - sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID); + if (newEntry.DifficultySpellID[x]) + sSpellMgr->SetSpellDifficultyId(uint32(newEntry.DifficultySpellID[x]), spellDiff->ID); } // create talent spells set for (TalentEntry const* talentInfo : sTalentStore) { for (uint8 j = 0; j < MAX_TALENT_RANK; ++j) - if (talentInfo->RankID[j]) - sTalentSpellPosMap[talentInfo->RankID[j]] = TalentSpellPos(talentInfo->TalentID, j); + if (talentInfo->SpellRank[j]) + sTalentSpellPosMap[talentInfo->SpellRank[j]] = TalentSpellPos(talentInfo->ID, j); } @@ -539,12 +539,12 @@ void LoadDBCStores(const std::string& dataPath) // store class talent tab pages for (uint32 cls = 1; cls < MAX_CLASSES; ++cls) if (talentTabInfo->ClassMask & (1 << (cls - 1))) - sTalentTabPages[cls][talentTabInfo->tabpage] = talentTabInfo->TalentTabID; + sTalentTabPages[cls][talentTabInfo->OrderIndex] = talentTabInfo->ID; } } for (TaxiPathEntry const* entry : sTaxiPathStore) - sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price); + sTaxiPathSetBySource[entry->FromTaxiNode][entry->ToTaxiNode] = TaxiPathBySourceAndDestination(entry->ID, entry->Cost); uint32 pathCount = sTaxiPathStore.GetNumRows(); // Calculate path nodes count @@ -611,7 +611,7 @@ void LoadDBCStores(const std::string& dataPath) sDeathKnightTaxiNodesMask[field] |= submask; // old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info) - if (node->map_id < 2 || node->ID == 82 || node->ID == 83 || node->ID == 93 || node->ID == 94) + if (node->ContinentID < 2 || node->ID == 82 || node->ID == 83 || node->ID == 93 || node->ID == 94) sOldContinentsNodesMask[field] |= submask; // fix DK node at Ebon Hold and Shadow Vault flight master @@ -621,7 +621,7 @@ void LoadDBCStores(const std::string& dataPath) } for (WMOAreaTableEntry const* entry : sWMOAreaTableStore) - sWMOAreaInfoByTripple[WMOAreaTableKey(entry->rootId, entry->adtId, entry->groupId)] = entry; + sWMOAreaInfoByTripple[WMOAreaTableKey(entry->WMOID, entry->NameSetID, entry->WMOGroupID)] = entry; // error checks if (bad_dbc_files.size() >= DBCFileCount) @@ -704,13 +704,13 @@ WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid char const* GetRaceName(uint8 race, uint8 locale) { ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race); - return raceEntry ? raceEntry->name[locale] : nullptr; + return raceEntry ? raceEntry->Name[locale] : nullptr; } char const* GetClassName(uint8 class_, uint8 locale) { ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_); - return classEntry ? classEntry->name[locale] : nullptr; + return classEntry ? classEntry->Name[locale] : nullptr; } uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId) @@ -719,7 +719,7 @@ uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId) return mapid; if (WorldMapAreaEntry const* wma = sWorldMapAreaStore.LookupEntry(zoneId)) - return wma->virtual_map_id >= 0 ? wma->virtual_map_id : wma->map_id; + return wma->DisplayMapID >= 0 ? wma->DisplayMapID : wma->MapID; return mapid; } @@ -756,10 +756,10 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT if (!reqEntry) return false; - if (itemEntry->categoryType != reqEntry->categoryType) + if (itemEntry->TotemCategoryType != reqEntry->TotemCategoryType) return false; - return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask; + return (itemEntry->TotemCategoryMask & reqEntry->TotemCategoryMask) == reqEntry->TotemCategoryMask; } void Zone2MapCoordinates(float& x, float& y, uint32 zone) @@ -771,8 +771,8 @@ void Zone2MapCoordinates(float& x, float& y, uint32 zone) return; std::swap(x, y); // at client map coords swapped - x = x*((maEntry->x2-maEntry->x1)/100)+maEntry->x1; - y = y*((maEntry->y2-maEntry->y1)/100)+maEntry->y1; // client y coord from top to down + x = x*((maEntry->LocBottom-maEntry->LocTop)/100)+maEntry->LocTop; + y = y*((maEntry->LocRight-maEntry->LocLeft)/100)+maEntry->LocLeft; // client y coord from top to down } void Map2ZoneCoordinates(float& x, float& y, uint32 zone) @@ -783,8 +783,8 @@ void Map2ZoneCoordinates(float& x, float& y, uint32 zone) if (!maEntry) return; - x = (x-maEntry->x1)/((maEntry->x2-maEntry->x1)/100); - y = (y-maEntry->y1)/((maEntry->y2-maEntry->y1)/100); // client y coord from top to down + x = (x-maEntry->LocTop)/((maEntry->LocBottom-maEntry->LocTop)/100); + y = (y-maEntry->LocLeft)/((maEntry->LocRight-maEntry->LocLeft)/100); // client y coord from top to down std::swap(x, y); // client have map coords swapped } @@ -826,15 +826,15 @@ PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 lev if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) { // skip unrelated and too-high brackets - if (entry->mapId != mapid || entry->minLevel > level) + if (entry->MapID != mapid || entry->MinLevel > level) continue; // exactly fit - if (entry->maxLevel >= level) + if (entry->MaxLevel >= level) return entry; // remember for possible out-of-range case (search higher from existed) - if (!maxEntry || maxEntry->maxLevel < entry->maxLevel) + if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel) maxEntry = entry; } } @@ -846,7 +846,7 @@ PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundB { for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) - if (entry->mapId == mapid && entry->GetBracketId() == id) + if (entry->MapID == mapid && entry->GetBracketId() == id) return entry; return nullptr; @@ -860,7 +860,7 @@ uint32 const* GetTalentTabPages(uint8 cls) uint32 GetLiquidFlags(uint32 liquidType) { if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType)) - return 1 << liq->Type; + return 1 << liq->SoundBank; return 0; } @@ -879,7 +879,7 @@ CharSectionsEntry const* GetCharSectionEntry(uint8 race, CharSectionType genType uint32 const key = uint32(genType) | uint32(gender << 8) | uint32(race << 16); for (auto const& section : Trinity::Containers::MapEqualRange(sCharSectionMap, key)) { - if (section.second->Type == type && section.second->Color == color) + if (section.second->VariationIndex == type && section.second->ColorIndex == color) return section.second; } @@ -904,7 +904,7 @@ LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty) if (!dungeon) continue; - if (dungeon->map == int32(mapId) && Difficulty(dungeon->difficulty) == difficulty) + if (dungeon->MapID == int32(mapId) && Difficulty(dungeon->Difficulty) == difficulty) return dungeon; } @@ -919,8 +919,8 @@ uint32 GetDefaultMapLight(uint32 mapId) if (!light) continue; - if (light->MapId == mapId && light->X == 0.0f && light->Y == 0.0f && light->Z == 0.0f) - return light->Id; + if (light->ContinentID == mapId && light->GameCoords.X == 0.0f && light->GameCoords.Y == 0.0f && light->GameCoords.Z == 0.0f) + return light->ID; } return 0; diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index fcd83f7d409..4711a6eafe5 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -162,7 +162,7 @@ TC_GAME_API extern DBCStorage <PowerDisplayEntry> sPowerDisplayStore; TC_GAME_API extern DBCStorage <QuestSortEntry> sQuestSortStore; TC_GAME_API extern DBCStorage <QuestXPEntry> sQuestXPStore; TC_GAME_API extern DBCStorage <QuestFactionRewEntry> sQuestFactionRewardStore; -TC_GAME_API extern DBCStorage <RandomPropertiesPointsEntry> sRandomPropertiesPointsStore; +TC_GAME_API extern DBCStorage <RandPropPointsEntry> sRandPropPointsStore; TC_GAME_API extern DBCStorage <ScalingStatDistributionEntry> sScalingStatDistributionStore; TC_GAME_API extern DBCStorage <ScalingStatValuesEntry> sScalingStatValuesStore; TC_GAME_API extern DBCStorage <SkillLineEntry> sSkillLineStore; @@ -180,7 +180,7 @@ TC_GAME_API extern PetFamilySpellsStore sPetFamilySpellsSto TC_GAME_API extern DBCStorage <SpellRadiusEntry> sSpellRadiusStore; TC_GAME_API extern DBCStorage <SpellRangeEntry> sSpellRangeStore; TC_GAME_API extern DBCStorage <SpellRuneCostEntry> sSpellRuneCostStore; -TC_GAME_API extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore; +TC_GAME_API extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore; TC_GAME_API extern DBCStorage <SpellEntry> sSpellStore; TC_GAME_API extern DBCStorage <SpellVisualEntry> sSpellVisualStore; TC_GAME_API extern DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore; diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 7d7dbbbeee2..0c7e1855e1e 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -48,10 +48,10 @@ LFGDungeonData::LFGDungeonData() : id(0), name(), map(0), type(0), expansion(0), { } -LFGDungeonData::LFGDungeonData(LFGDungeonEntry const* dbc) : id(dbc->ID), name(dbc->name[0]), map(dbc->map), - type(dbc->type), expansion(uint8(dbc->expansion)), group(uint8(dbc->grouptype)), - minlevel(uint8(dbc->minlevel)), maxlevel(uint8(dbc->maxlevel)), difficulty(Difficulty(dbc->difficulty)), - seasonal((dbc->flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f) +LFGDungeonData::LFGDungeonData(LFGDungeonEntry const* dbc) : id(dbc->ID), name(dbc->Name[0]), map(dbc->MapID), + type(dbc->TypeID), expansion(uint8(dbc->ExpansionLevel)), group(uint8(dbc->GroupID)), + minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->Difficulty)), + seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f) { } @@ -198,7 +198,7 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */) if (!dungeon) continue; - switch (dungeon->type) + switch (dungeon->TypeID) { case LFG_TYPE_DUNGEON: case LFG_TYPE_HEROIC: @@ -982,7 +982,7 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal) { uint32 rDungeonId = (*dungeons.begin()); LFGDungeonEntry const* dungeonEntry = sLFGDungeonStore.LookupEntry(rDungeonId); - if (dungeonEntry && dungeonEntry->type == LFG_TYPE_RANDOM) + if (dungeonEntry && dungeonEntry->TypeID == LFG_TYPE_RANDOM) player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false); } } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 766cabefe1e..6ba76fc0a5a 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -590,7 +590,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/, // checked and error show at loading templates if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction)) - SetPvP((factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP) != 0); + SetPvP((factionTemplate->Flags & FACTION_TEMPLATE_FLAG_PVP) != 0); // updates spell bars for vehicles and set player's faction - should be called here, to overwrite faction that is set from the new template if (IsVehicle()) diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index b030cc03ac5..f7cedc168f2 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -360,7 +360,7 @@ void Minion::setDeathState(DeathState s) bool Minion::IsGuardianPet() const { - return IsPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET); + return IsPet() || (m_Properties && m_Properties->Control == SUMMON_CATEGORY_PET); } std::string Minion::GetDebugInfo() const @@ -377,7 +377,7 @@ Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool is { memset(m_statFromOwner, 0, sizeof(float)*MAX_STATS); m_unitTypeMask |= UNIT_MASK_GUARDIAN; - if (properties && (properties->Type == SUMMON_TYPE_PET || properties->Category == SUMMON_CATEGORY_PET)) + if (properties && (properties->Title == SUMMON_TYPE_PET || properties->Control == SUMMON_CATEGORY_PET)) { m_unitTypeMask |= UNIT_MASK_CONTROLABLE_GUARDIAN; InitCharmInfo(); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 0cb8ab61365..ecf12d94db6 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -2105,9 +2105,9 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const float cosB = dy / dist; dx = dist * (cosA * cosB + sinA * sinB); dy = dist * (cosA * sinB - sinA * cosB); - return dx < info->maxX + radius && dx > info->minX - radius - && dy < info->maxY + radius && dy > info->minY - radius - && dz < info->maxZ + radius && dz > info->minZ - radius; + return dx < info->GeoBoxMax.X + radius && dx > info->GeoBoxMin.X - radius + && dy < info->GeoBoxMax.Y + radius && dy > info->GeoBoxMin.Y - radius + && dz < info->GeoBoxMax.Z + radius && dz > info->GeoBoxMin.Z - radius; } void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= nullptr*/) @@ -2709,12 +2709,12 @@ bool GameObject::IsAtInteractDistance(Position const& pos, float radius) const { float scale = GetObjectScale(); - float minX = displayInfo->minX * scale - radius; - float minY = displayInfo->minY * scale - radius; - float minZ = displayInfo->minZ * scale - radius; - float maxX = displayInfo->maxX * scale + radius; - float maxY = displayInfo->maxY * scale + radius; - float maxZ = displayInfo->maxZ * scale + radius; + float minX = displayInfo->GeoBoxMin.X * scale - radius; + float minY = displayInfo->GeoBoxMin.Y * scale - radius; + float minZ = displayInfo->GeoBoxMin.Z * scale - radius; + float maxX = displayInfo->GeoBoxMax.X * scale + radius; + float maxY = displayInfo->GeoBoxMax.Y * scale + radius; + float maxZ = displayInfo->GeoBoxMax.Z * scale + radius; QuaternionData worldRotation = GetWorldRotation(); G3D::Quat worldRotationQuat(worldRotation.x, worldRotation.y, worldRotation.z, worldRotation.w); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index ab0b8291945..97d4dcfaa07 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -50,7 +50,7 @@ void AddItemsSetItem(Player* player, Item* item) return; } - if (set->required_skill_id && player->GetSkillValue(set->required_skill_id) < set->required_skill_value) + if (set->RequiredSkill && player->GetSkillValue(set->RequiredSkill) < set->RequiredSkillRank) return; ItemSetEffect* eff = nullptr; @@ -84,15 +84,15 @@ void AddItemsSetItem(Player* player, Item* item) for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; ++x) { - if (!set->spells [x]) + if (!set->SetSpellID[x]) continue; //not enough for spell - if (set->items_to_triggerspell[x] > eff->item_count) + if (set->SetThreshold[x] > eff->item_count) continue; uint32 z = 0; for (; z < MAX_ITEM_SET_SPELLS; ++z) - if (eff->spells[z] && eff->spells[z]->Id == set->spells[x]) + if (eff->spells[z] && eff->spells[z]->Id == set->SetSpellID[x]) break; if (z < MAX_ITEM_SET_SPELLS) @@ -103,10 +103,10 @@ void AddItemsSetItem(Player* player, Item* item) { if (!eff->spells[y]) // free slot { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->spells[x]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->SetSpellID[x]); if (!spellInfo) { - TC_LOG_ERROR("entities.player.items", "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid); + TC_LOG_ERROR("entities.player.items", "WORLD: unknown spell id %u in items set %u effects", set->SetSpellID[x], setid); break; } @@ -150,16 +150,16 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto) for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; x++) { - if (!set->spells[x]) + if (!set->SetSpellID[x]) continue; // enough for spell - if (set->items_to_triggerspell[x] <= eff->item_count) + if (set->SetThreshold[x] <= eff->item_count) continue; for (uint32 z = 0; z < MAX_ITEM_SET_SPELLS; z++) { - if (eff->spells[z] && eff->spells[z]->Id == set->spells[x]) + if (eff->spells[z] && eff->spells[z]->Id == set->SetSpellID[x]) { // spell can be not active if not fit form requirement player->ApplyEquipSpell(eff->spells[z], nullptr, false); @@ -591,7 +591,7 @@ void Item::SetItemRandomProperties(int32 randomPropId) SetState(ITEM_CHANGED, GetOwner()); } for (uint32 i = PROP_ENCHANTMENT_SLOT_2; i < PROP_ENCHANTMENT_SLOT_2 + 3; ++i) - SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_2], 0, 0); + SetEnchantment(EnchantmentSlot(i), item_rand->Enchantment[i - PROP_ENCHANTMENT_SLOT_2], 0, 0); } } else @@ -608,7 +608,7 @@ void Item::SetItemRandomProperties(int32 randomPropId) } for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i < PROP_ENCHANTMENT_SLOT_0 + 3; ++i) - SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0], 0, 0); + SetEnchantment(EnchantmentSlot(i), item_rand->Enchantment[i - PROP_ENCHANTMENT_SLOT_0], 0, 0); } } } @@ -735,7 +735,7 @@ bool Item::HasEnchantRequiredSkill(Player const* player) const for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->requiredSkill && player->GetSkillValue(enchantEntry->requiredSkill) < enchantEntry->requiredSkillValue) + if (enchantEntry->RequiredSkillID && player->GetSkillValue(enchantEntry->RequiredSkillID) < enchantEntry->RequiredSkillRank) return false; return true; @@ -749,8 +749,8 @@ uint32 Item::GetEnchantRequiredLevel() const for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->requiredLevel > level) - level = enchantEntry->requiredLevel; + if (enchantEntry->MinLevel > level) + level = enchantEntry->MinLevel; return level; } @@ -761,7 +761,7 @@ bool Item::IsBoundByEnchant() const for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot) if (uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot))) if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id)) - if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND) + if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND) return true; return false; } @@ -889,7 +889,7 @@ bool Item::GemsFitSockets() const uint8 GemColor = 0; - uint32 gemid = enchantEntry->GemID; + uint32 gemid = enchantEntry->SrcItemID; if (gemid) { ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(gemid); @@ -897,7 +897,7 @@ bool Item::GemsFitSockets() const { GemPropertiesEntry const* gemProperty = sGemPropertiesStore.LookupEntry(gemProto->GemProperties); if (gemProperty) - GemColor = gemProperty->color; + GemColor = gemProperty->Type; } } @@ -920,7 +920,7 @@ uint8 Item::GetGemCountWithID(uint32 GemID) const if (!enchantEntry) continue; - if (GemID == enchantEntry->GemID) + if (GemID == enchantEntry->SrcItemID) ++count; } return count; @@ -939,7 +939,7 @@ uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const if (!enchantEntry) continue; - ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID); + ItemTemplate const* gemProto = sObjectMgr->GetItemTemplate(enchantEntry->SrcItemID); if (!gemProto) continue; diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index 5ce88118e7a..48404116a34 100644 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -174,7 +174,7 @@ uint32 GenerateEnchSuffixFactor(uint32 item_id) if (!itemProto->RandomSuffix) return 0; - RandomPropertiesPointsEntry const* randomProperty = sRandomPropertiesPointsStore.LookupEntry(itemProto->ItemLevel); + RandPropPointsEntry const* randomProperty = sRandPropPointsStore.LookupEntry(itemProto->ItemLevel); if (!randomProperty) return 0; @@ -230,11 +230,11 @@ uint32 GenerateEnchSuffixFactor(uint32 item_id) switch (itemProto->Quality) { case ITEM_QUALITY_UNCOMMON: - return randomProperty->UncommonPropertiesPoints[suffixFactor]; + return randomProperty->Good[suffixFactor]; case ITEM_QUALITY_RARE: - return randomProperty->RarePropertiesPoints[suffixFactor]; + return randomProperty->Superior[suffixFactor]; case ITEM_QUALITY_EPIC: - return randomProperty->EpicPropertiesPoints[suffixFactor]; + return randomProperty->Epic[suffixFactor]; case ITEM_QUALITY_LEGENDARY: case ITEM_QUALITY_ARTIFACT: return 0; // not have random properties diff --git a/src/server/game/Entities/Item/ItemTemplate.h b/src/server/game/Entities/Item/ItemTemplate.h index 3ce67c232a3..e08a04d0063 100644 --- a/src/server/game/Entities/Item/ItemTemplate.h +++ b/src/server/game/Entities/Item/ItemTemplate.h @@ -559,16 +559,6 @@ const uint32 MaxItemSubclassValues[MAX_ITEM_CLASS] = MAX_ITEM_SUBCLASS_GLYPH }; -inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemSubClass) -{ - switch (ItemClass) - { - case ITEM_CLASS_WEAPON: return ItemSubClass; - case ITEM_CLASS_ARMOR: return ItemSubClass + 21; - } - return 0; -} - #pragma pack(push, 1) struct _Damage diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index fb9a5034366..42b6c9eb450 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -455,7 +455,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const ASSERT(unit); ASSERT(unit->GetVehicleKit()); ASSERT(unit->GetVehicleKit()->GetVehicleInfo()); - *data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->m_ID); + *data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->ID); if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) *data << float(unit->GetTransOffsetO()); else @@ -1066,8 +1066,8 @@ void WorldObject::ProcessPositionDataChanged(PositionFullTerrainStatus const& da { m_zoneId = m_areaId = data.areaId; if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(m_areaId)) - if (area->zone) - m_zoneId = area->zone; + if (area->ParentAreaID) + m_zoneId = area->ParentAreaID; m_outdoors = data.outdoors; m_staticFloorZ = data.floorZ; m_liquidStatus = data.liquidStatus; @@ -1846,7 +1846,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert uint32 mask = UNIT_MASK_SUMMON; if (properties) { - switch (properties->Category) + switch (properties->Control) { case SUMMON_CATEGORY_PET: mask = UNIT_MASK_GUARDIAN; @@ -1861,7 +1861,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert case SUMMON_CATEGORY_ALLY: case SUMMON_CATEGORY_UNK: { - switch (properties->Type) + switch (properties->Title) { case SUMMON_TYPE_MINION: case SUMMON_TYPE_GUARDIAN: @@ -2217,7 +2217,7 @@ float WorldObject::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const if (!spellInfo->RangeEntry) return 0.f; - if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile) + if (spellInfo->RangeEntry->RangeMax[0] == spellInfo->RangeEntry->RangeMax[1]) return spellInfo->GetMaxRange(); if (!target) @@ -2231,7 +2231,7 @@ float WorldObject::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const if (!spellInfo->RangeEntry) return 0.f; - if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile) + if (spellInfo->RangeEntry->RangeMin[0] == spellInfo->RangeEntry->RangeMin[1]) return spellInfo->GetMinRange(); if (!target) @@ -2680,12 +2680,12 @@ ReputationRank WorldObject::GetReactionTo(WorldObject const* target) const return *repRank; if (!selfPlayerOwner->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION)) { - if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->faction)) + if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->Faction)) { if (targetFactionEntry->CanHaveReputation()) { // check contested flags - if ((targetFactionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) && + if ((targetFactionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) && selfPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) return REP_HOSTILE; @@ -2718,14 +2718,14 @@ ReputationRank WorldObject::GetReactionTo(WorldObject const* target) const if (Player const* targetPlayerOwner = target->GetAffectingPlayer()) { // check contested flags - if ((factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) && + if ((factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) && targetPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) return REP_HOSTILE; if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry)) return *repRank; if (target->ToUnit() && !target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION)) { - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction)) { if (factionEntry->CanHaveReputation()) { @@ -2746,7 +2746,7 @@ ReputationRank WorldObject::GetReactionTo(WorldObject const* target) const return REP_FRIENDLY; if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry)) return REP_FRIENDLY; - if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT) + if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT) return REP_HOSTILE; // neutral by default return REP_NEUTRAL; @@ -2765,11 +2765,11 @@ bool WorldObject::IsFriendlyTo(WorldObject const* target) const bool WorldObject::IsHostileToPlayers() const { FactionTemplateEntry const* my_faction = GetFactionTemplateEntry(); - if (!my_faction->faction) + if (!my_faction->Faction) return false; - FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction); - if (raw_faction && raw_faction->reputationListID >= 0) + FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction); + if (raw_faction && raw_faction->ReputationIndex >= 0) return false; return my_faction->IsHostileToPlayers(); @@ -2778,11 +2778,11 @@ bool WorldObject::IsHostileToPlayers() const bool WorldObject::IsNeutralToAll() const { FactionTemplateEntry const* my_faction = GetFactionTemplateEntry(); - if (!my_faction->faction) + if (!my_faction->Faction) return true; - FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction); - if (raw_faction && raw_faction->reputationListID >= 0) + FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction); + if (raw_faction && raw_faction->ReputationIndex >= 0) return false; return my_faction->IsNeutralToAll(); @@ -2936,7 +2936,7 @@ bool WorldObject::IsValidAttackTarget(WorldObject const* target, SpellInfo const if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry()) { if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate))) - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->Faction)) if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry)) if (!(repState->Flags & FACTION_FLAG_AT_WAR)) return false; diff --git a/src/server/game/Entities/Object/Position.cpp b/src/server/game/Entities/Object/Position.cpp index 7b884ab27ee..1304acebe5d 100644 --- a/src/server/game/Entities/Object/Position.cpp +++ b/src/server/game/Entities/Object/Position.cpp @@ -225,6 +225,6 @@ std::string WorldLocation::GetDebugInfo() const { std::stringstream sstr; MapEntry const* mapEntry = sMapStore.LookupEntry(m_mapId); - sstr << "MapID: " << m_mapId << " Map name: '" << (mapEntry ? mapEntry->name[sWorld->GetDefaultDbcLocale()] : "<not found>") <<"' " << Position::ToString(); + sstr << "MapID: " << m_mapId << " Map name: '" << (mapEntry ? mapEntry->MapName[sWorld->GetDefaultDbcLocale()] : "<not found>") <<"' " << Position::ToString(); return sstr.str(); } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 2685fa1ae57..82ca652d390 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1077,7 +1077,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const if (!cFamily) return false; - uint32 diet = cFamily->petFoodMask; + uint32 diet = cFamily->PetFoodMask; uint32 FoodMask = 1 << (item->FoodType-1); return (diet & FoodMask) != 0; } @@ -1384,7 +1384,7 @@ bool Pet::addSpell(uint32 spellId, ActiveStates active /*= ACT_DECIDE*/, PetSpel for (uint8 i = 0; i < MAX_TALENT_RANK; ++i) { // skip learning spell and no rank spell case - uint32 rankSpellId = talentInfo->RankID[i]; + uint32 rankSpellId = talentInfo->SpellRank[i]; if (!rankSpellId || rankSpellId == spellId) continue; @@ -1605,7 +1605,7 @@ bool Pet::resetTalents() return false; // Check pet talent type CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family); - if (!pet_family || pet_family->petTalentType < 0) + if (!pet_family || pet_family->PetTalentType < 0) return false; uint8 level = GetLevel(); @@ -1624,13 +1624,13 @@ bool Pet::resetTalents() if (!talentInfo) continue; - TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); + TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID); if (!talentTabInfo) continue; // unlearn only talents for pets family talent type - if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)) + if (!((1 << pet_family->PetTalentType) & talentTabInfo->CategoryEnumID)) continue; for (uint8 j = 0; j < MAX_TALENT_RANK; ++j) @@ -1646,7 +1646,7 @@ bool Pet::resetTalents() uint32 itrFirstId = sSpellMgr->GetFirstSpellInChain(itr->first); // unlearn if first rank is talent or learned by talent - if (itrFirstId == talentInfo->RankID[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->RankID[j], itrFirstId)) + if (itrFirstId == talentInfo->SpellRank[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->SpellRank[j], itrFirstId)) { unlearnSpell(itr->first, false); itr = m_spells.begin(); @@ -1964,15 +1964,15 @@ Player* Pet::GetOwner() const float Pet::GetNativeObjectScale() const { CreatureFamilyEntry const* creatureFamily = sCreatureFamilyStore.LookupEntry(GetCreatureTemplate()->family); - if (creatureFamily && creatureFamily->minScale > 0.0f && getPetType() == HUNTER_PET) + if (creatureFamily && creatureFamily->MinScale > 0.0f && getPetType() == HUNTER_PET) { float scale; - if (GetLevel() >= creatureFamily->maxScaleLevel) - scale = creatureFamily->maxScale; - else if (GetLevel() <= creatureFamily->minScaleLevel) - scale = creatureFamily->minScale; + if (GetLevel() >= creatureFamily->MaxScaleLevel) + scale = creatureFamily->MaxScale; + else if (GetLevel() <= creatureFamily->MinScaleLevel) + scale = creatureFamily->MinScale; else - scale = creatureFamily->minScale + float(GetLevel() - creatureFamily->minScaleLevel) / creatureFamily->maxScaleLevel * (creatureFamily->maxScale - creatureFamily->minScale); + scale = creatureFamily->MinScale + float(GetLevel() - creatureFamily->MinScaleLevel) / creatureFamily->MaxScaleLevel * (creatureFamily->MaxScale - creatureFamily->MinScale); return scale; } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bfd4b0c636e..6a478c0f868 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -495,7 +495,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo SetMap(sMapMgr->CreateMap(info->mapId, this)); - uint8 powertype = cEntry->powerType; + uint8 powertype = cEntry->DisplayPower; SetObjectScale(1.0f); @@ -603,10 +603,10 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo { for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j) { - if (oEntry->ItemId[j] <= 0) + if (oEntry->ItemID[j] <= 0) continue; - uint32 itemId = oEntry->ItemId[j]; + uint32 itemId = oEntry->ItemID[j]; // just skip, reported in ObjectMgr::LoadItemTemplates ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId); @@ -916,7 +916,7 @@ void Player::HandleDrowning(uint32 time_diff) SendMirrorTimer(FATIGUE_TIMER, DarkWaterTime, m_MirrorTimer[FATIGUE_TIMER], 10); } - if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !(_lastLiquid && _lastLiquid->SpellId)) + if (m_MirrorTimerFlags & (UNDERWATER_INLAVA /*| UNDERWATER_INSLIME*/) && !(_lastLiquid && _lastLiquid->SpellID)) { // Breath timer not activated - activate it if (m_MirrorTimer[FIRE_TIMER] == DISABLED_MIRROR_TIMER) @@ -1574,7 +1574,7 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data) *data << uint32(proto->DisplayInfoID); *data << uint8(proto->InventoryType); - *data << uint32(enchant ? enchant->aura_id : 0); + *data << uint32(enchant ? enchant->ItemVisual : 0); } return true; @@ -2342,20 +2342,20 @@ void Player::SetInWater(bool apply) bool Player::IsInAreaTriggerRadius(AreaTriggerEntry const* trigger) const { - if (!trigger || GetMapId() != trigger->mapid) + if (!trigger || GetMapId() != trigger->ContinentID) return false; - if (trigger->radius > 0.f) + if (trigger->Radius > 0.f) { // if we have radius check it - float dist = GetDistance(trigger->x, trigger->y, trigger->z); - if (dist > trigger->radius) + float dist = GetDistance(trigger->Pos.X, trigger->Pos.Y, trigger->Pos.Z); + if (dist > trigger->Radius) return false; } else { - Position center(trigger->x, trigger->y, trigger->z, trigger->box_orientation); - if (!IsWithinBox(center, trigger->box_x / 2.f, trigger->box_y / 2.f, trigger->box_z / 2.f)) + Position center(trigger->Pos.X, trigger->Pos.Y, trigger->Pos.Z, trigger->BoxYaw); + if (!IsWithinBox(center, trigger->BoxLength / 2.f, trigger->BoxWidth / 2.f, trigger->BoxHeight / 2.f)) return false; } @@ -2930,7 +2930,7 @@ void Player::SendUnlearnSpells() bool hasSupercededSpellInfoInClient = false; for (auto boundsItr = skillLineAbilities.first; boundsItr != skillLineAbilities.second; ++boundsItr) { - if (boundsItr->second->forward_spellid) + if (boundsItr->second->SupercededBySpell) { hasSupercededSpellInfoInClient = true; break; @@ -3087,7 +3087,7 @@ bool Player::AddTalent(uint32 spellId, uint8 spec, bool learning) for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank) { // skip learning spell and no rank spell case - uint32 rankSpellId = talentInfo->RankID[rank]; + uint32 rankSpellId = talentInfo->SpellRank[rank]; if (!rankSpellId || rankSpellId == spellId) continue; @@ -3119,7 +3119,7 @@ static bool IsUnlearnSpellsPacketNeededForSpell(uint32 spellId) bool hasSupercededSpellInfoInClient = false; for (auto boundsItr = skillLineAbilities.first; boundsItr != skillLineAbilities.second; ++boundsItr) { - if (boundsItr->second->forward_spellid) + if (boundsItr->second->SupercededBySpell) { hasSupercededSpellInfoInClient = true; break; @@ -3290,7 +3290,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent for (uint8 rank = 0; rank < MAX_TALENT_RANK; ++rank) { // skip learning spell and no rank spell case - uint32 rankSpellId = talentInfo->RankID[rank]; + uint32 rankSpellId = talentInfo->SpellRank[rank]; if (!rankSpellId || rankSpellId == spellId) continue; @@ -3433,19 +3433,19 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent // not ranked skills for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx) { - SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId); + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->SkillLine); if (!pSkill) continue; - if (pSkill->id == fromSkill) + if (pSkill->ID == fromSkill) continue; ///@todo: confirm if rogues start with lockpicking skill at level 1 but only receive the spell to use it at level 16 // Also added for runeforging. It's already confirmed this happens upon learning for Death Knights, not from character creation. - if ((_spell_idx->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->id)) || ((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0)) - LearnDefaultSkill(pSkill->id, 0); + if ((_spell_idx->second->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->ID)) || ((pSkill->ID == SKILL_LOCKPICKING || pSkill->ID == SKILL_RUNEFORGING) && _spell_idx->second->TrivialSkillLineRankHigh == 0)) + LearnDefaultSkill(pSkill->ID, 0); - if (pSkill->id == SKILL_MOUNTS && !Has310Flyer(false)) + if (pSkill->ID == SKILL_MOUNTS && !Has310Flyer(false)) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && spellInfo->Effects[i].CalcValue() == 310) @@ -3472,8 +3472,8 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent // not ranked skills for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx) { - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->SkillLine); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->SkillLine); } UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId); @@ -3694,11 +3694,11 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled, bool learn_low_rank) { for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { - SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId); + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->SkillLine); if (!pSkill) continue; - if (_spell_idx->second->skillId == SKILL_MOUNTS) + if (_spell_idx->second->SkillLine == SKILL_MOUNTS) { for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { @@ -3803,7 +3803,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(itr->first); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { - if (_spell_idx->second->skillId != SKILL_MOUNTS) + if (_spell_idx->second->SkillLine != SKILL_MOUNTS) break; // We can break because mount spells belong only to one skillline (at least 310 flyers do) spellInfo = sSpellMgr->AssertSpellInfo(itr->first); @@ -3907,7 +3907,7 @@ bool Player::ResetTalents(bool no_cost) if (!talentInfo) continue; - TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); + TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID); if (!talentTabInfo) continue; @@ -3921,18 +3921,18 @@ bool Player::ResetTalents(bool no_cost) for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { // skip non-existing talent ranks - if (talentInfo->RankID[rank] == 0) + if (talentInfo->SpellRank[rank] == 0) continue; - SpellInfo const* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank]); + SpellInfo const* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->SpellRank[rank]); if (!_spellEntry) continue; - RemoveSpell(talentInfo->RankID[rank], true); + RemoveSpell(talentInfo->SpellRank[rank], true); // search for spells that the talent teaches and unlearn them for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL) RemoveSpell(_spellEntry->Effects[i].TriggerSpell, true); // if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted - PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]); + PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->SpellRank[rank]); if (plrTalent != m_talents[m_activeSpec]->end()) plrTalent->second->state = PLAYERSPELL_REMOVED; } @@ -4936,8 +4936,18 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g return TotalCost; } - uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class, ditemProto->SubClass)]; - uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->quality_mod)); + uint32 dmultiplier; + switch (ditemProto->Class) + { + case ITEM_CLASS_WEAPON: + dmultiplier = dcost->WeaponSubClassCost[ditemProto->SubClass]; + case ITEM_CLASS_ARMOR: + dmultiplier = dcost->ArmorSubClassCost[ditemProto->SubClass]; + default: + dmultiplier = 0; + } + + uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->Data)); costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST)); @@ -4991,7 +5001,7 @@ void Player::RepopAtGraveyard() bool shouldResurrect = false; // Such zones are considered unreachable as a ghost and the player must be automatically revived - if ((!IsAlive() && zone && zone->flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < GetMap()->GetMinHeight(GetPositionX(), GetPositionY())) + if ((!IsAlive() && zone && zone->Flags & AREA_FLAG_NEED_FLY) || GetTransport() || GetPositionZ() < GetMap()->GetMinHeight(GetPositionX(), GetPositionY())) { shouldResurrect = true; SpawnCorpseBones(); @@ -5017,12 +5027,12 @@ void Player::RepopAtGraveyard() // and don't show spirit healer location if (ClosestGrave) { - TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation(), shouldResurrect ? TELE_REVIVE_AT_TELEPORT : 0); + TeleportTo(ClosestGrave->Continent, ClosestGrave->Loc.X, ClosestGrave->Loc.Y, ClosestGrave->Loc.Z, GetOrientation(), shouldResurrect ? TELE_REVIVE_AT_TELEPORT : 0); if (isDead()) // not send if alive, because it used in TeleportTo() { WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap - data << ClosestGrave->map_id; - data << TaggedPosition<Position::XYZ>(ClosestGrave->x, ClosestGrave->y, ClosestGrave->z); + data << ClosestGrave->Continent; + data << TaggedPosition<Position::XYZ>(ClosestGrave->Loc.X, ClosestGrave->Loc.Y, ClosestGrave->Loc.Z); SendDirectMessage(&data); } } @@ -5034,13 +5044,13 @@ void Player::RepopAtGraveyard() bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone) const { - if (channel->flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->flags & AREA_FLAG_ARENA_INSTANCE) + if (channel->Flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->Flags & AREA_FLAG_ARENA_INSTANCE) return false; - if ((channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL))) + if ((channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->Flags & AREA_FLAG_SLAVE_CAPITAL))) return false; - if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId()) + if ((channel->Flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId()) return false; return true; @@ -5107,12 +5117,12 @@ void Player::UpdateLocalChannels(uint32 newZone) if (CanJoinConstantChannelInZone(channelEntry, current_zone)) { - if (!(channelEntry->flags & CHANNEL_DBC_FLAG_GLOBAL)) + if (!(channelEntry->Flags & CHANNEL_DBC_FLAG_GLOBAL)) { - if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel) + if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel) continue; // Already on the channel, as city channel names are not changing - joinChannel = cMgr->GetSystemChannel(channelEntry->ChannelID, current_zone); + joinChannel = cMgr->GetSystemChannel(channelEntry->ID, current_zone); if (usedChannel) { if (joinChannel != usedChannel) @@ -5125,7 +5135,7 @@ void Player::UpdateLocalChannels(uint32 newZone) } } else - joinChannel = cMgr->GetSystemChannel(channelEntry->ChannelID); + joinChannel = cMgr->GetSystemChannel(channelEntry->ID); } else removeChannel = usedChannel; @@ -5242,14 +5252,14 @@ void Player::UpdateDamageDoneMods(WeaponAttackType attackType, int32 skipEnchant for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i) { - switch (enchantmentEntry->type[i]) + switch (enchantmentEntry->Effect[i]) { case ITEM_ENCHANTMENT_TYPE_DAMAGE: - amount += enchantmentEntry->amount[i]; + amount += enchantmentEntry->EffectPointsMin[i]; break; case ITEM_ENCHANTMENT_TYPE_TOTEM: if (GetClass() == CLASS_SHAMAN) - amount += enchantmentEntry->amount[i] * item->GetTemplate()->Delay / 1000.0f; + amount += enchantmentEntry->EffectPointsMin[i] * item->GetTemplate()->Delay / 1000.0f; break; default: break; @@ -5318,7 +5328,7 @@ float Player::GetMeleeCritFromAgility() const if (critBase == nullptr || critRatio == nullptr) return 0.0f; - float crit = critBase->base + GetStat(STAT_AGILITY)*critRatio->ratio; + float crit = critBase->Data + GetStat(STAT_AGILITY)*critRatio->Data; return crit*100.0f; } @@ -5371,8 +5381,8 @@ void Player::GetDodgeFromAgility(float &diminishing, float &nondiminishing) cons float bonus_agility = GetStat(STAT_AGILITY) - base_agility; // calculate diminishing (green in char screen) and non-diminishing (white) contribution - diminishing = 100.0f * bonus_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]; - nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->ratio * crit_to_dodge[pclass-1]); + diminishing = 100.0f * bonus_agility * dodgeRatio->Data * crit_to_dodge[pclass-1]; + nondiminishing = 100.0f * (dodge_base[pclass-1] + base_agility * dodgeRatio->Data * crit_to_dodge[pclass-1]); } float Player::GetSpellCritFromIntellect() const @@ -5388,7 +5398,7 @@ float Player::GetSpellCritFromIntellect() const if (critBase == nullptr || critRatio == nullptr) return 0.0f; - float crit = critBase->base + GetStat(STAT_INTELLECT) * critRatio->ratio; + float crit = critBase->Data + GetStat(STAT_INTELLECT) * critRatio->Data; return crit * 100.0f; } @@ -5405,7 +5415,7 @@ float Player::GetRatingMultiplier(CombatRating cr) const if (!Rating || !classRating) return 1.0f; // By default use minimum coefficient (not must be called) - return classRating->ratio / Rating->ratio; + return classRating->Data / Rating->Data; } float Player::GetRatingBonusValue(CombatRating cr) const @@ -5446,7 +5456,7 @@ float Player::OCTRegenHPPerSpirit() const if (baseSpirit > 50) baseSpirit = 50; float moreSpirit = spirit - baseSpirit; - float regen = baseSpirit * baseRatio->ratio + moreSpirit * moreRatio->ratio; + float regen = baseSpirit * baseRatio->Data + moreSpirit * moreRatio->Data; return regen; } @@ -5465,7 +5475,7 @@ float Player::OCTRegenMPPerSpirit() const // Formula get from PaperDollFrame script float spirit = GetStat(STAT_SPIRIT); - float regen = spirit * moreRatio->ratio; + float regen = spirit * moreRatio->Data; return regen; } @@ -5671,24 +5681,24 @@ bool Player::UpdateCraftSkill(uint32 spellid) for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { - if (_spell_idx->second->skillId) + if (_spell_idx->second->SkillLine) { - uint32 SkillValue = GetPureSkillValue(_spell_idx->second->skillId); + uint32 SkillValue = GetPureSkillValue(_spell_idx->second->SkillLine); // Alchemy Discoveries here SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellid); if (spellEntry && spellEntry->Mechanic == MECHANIC_DISCOVERY) { - if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->skillId, spellid, this)) + if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->SkillLine, spellid, this)) LearnSpell(discoveredSpell, false); } uint32 craft_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING); - return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue, - _spell_idx->second->max_value, - (_spell_idx->second->max_value + _spell_idx->second->min_value)/2, - _spell_idx->second->min_value), + return UpdateSkillPro(_spell_idx->second->SkillLine, SkillGainChance(SkillValue, + _spell_idx->second->TrivialSkillLineRankHigh, + (_spell_idx->second->TrivialSkillLineRankHigh + _spell_idx->second->TrivialSkillLineRankLow)/2, + _spell_idx->second->TrivialSkillLineRankLow), craft_skill_gain); } } @@ -6039,8 +6049,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) // remove all spells that related to this skill for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) if (SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j)) - if (pAbility->skillId == id) - RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->spellId)); + if (pAbility->SkillLine == id) + RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->Spell)); } } else if (newVal) //add @@ -6403,7 +6413,7 @@ void Player::SendCinematicStart(uint32 CinematicSequenceId) const SendDirectMessage(packet.Write()); if (CinematicSequencesEntry const* sequence = sCinematicSequencesStore.LookupEntry(CinematicSequenceId)) - _cinematicMgr->SetActiveCinematicCamera(sequence->cinematicCamera); + _cinematicMgr->SetActiveCinematicCamera(sequence->Camera[0]); } void Player::SendMovieStart(uint32 movieId) @@ -6437,16 +6447,16 @@ void Player::CheckAreaExploreAndOutdoor() return; } - uint32 offset = areaEntry->exploreFlag / 32; + uint32 offset = areaEntry->AreaBit / 32; if (offset >= PLAYER_EXPLORED_ZONES_SIZE) { TC_LOG_ERROR("entities.player", "Player::CheckAreaExploreAndOutdoor: Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", - areaEntry->exploreFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE); + areaEntry->AreaBit, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE); return; } - uint32 val = (uint32)(1 << (areaEntry->exploreFlag % 32)); + uint32 val = (uint32)(1 << (areaEntry->AreaBit % 32)); uint32 currFields = GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); if (!(currFields & val)) @@ -6455,7 +6465,7 @@ void Player::CheckAreaExploreAndOutdoor() UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA, GetAreaId()); - if (areaEntry->area_level > 0) + if (areaEntry->ExplorationLevel > 0) { if (IsMaxLevel()) { @@ -6463,7 +6473,7 @@ void Player::CheckAreaExploreAndOutdoor() } else { - int32 diff = int32(GetLevel()) - areaEntry->area_level; + int32 diff = int32(GetLevel()) - areaEntry->ExplorationLevel; uint32 XP; if (diff < -5) { @@ -6475,16 +6485,16 @@ void Player::CheckAreaExploreAndOutdoor() if (exploration_percent < 0) exploration_percent = 0; - XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(areaEntry->ExplorationLevel)*exploration_percent/100*sWorld->getRate(RATE_XP_EXPLORE)); } else { - XP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*sWorld->getRate(RATE_XP_EXPLORE)); + XP = uint32(sObjectMgr->GetBaseXP(areaEntry->ExplorationLevel)*sWorld->getRate(RATE_XP_EXPLORE)); } if (sWorld->getIntConfig(CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO)) { - uint32 minScaledXP = uint32(sObjectMgr->GetBaseXP(areaEntry->area_level)*sWorld->getRate(RATE_XP_EXPLORE)) * sWorld->getIntConfig(CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO) / 100; + uint32 minScaledXP = uint32(sObjectMgr->GetBaseXP(areaEntry->ExplorationLevel)*sWorld->getRate(RATE_XP_EXPLORE)) * sWorld->getIntConfig(CONFIG_MIN_DISCOVERED_SCALED_XP_RATIO) / 100; XP = std::max(minScaledXP, XP); } @@ -6500,12 +6510,12 @@ uint32 Player::TeamForRace(uint8 race) { if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race)) { - switch (rEntry->TeamID) + switch (rEntry->BaseLanguage) { case 1: return HORDE; case 7: return ALLIANCE; } - TC_LOG_ERROR("entities.player", "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID); + TC_LOG_ERROR("entities.player", "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->BaseLanguage); } else TC_LOG_ERROR("entities.player", "Race (%u) not found in DBC: wrong DBC files?", uint32(race)); @@ -6628,7 +6638,7 @@ void Player::RewardReputation(Unit* victim, float rate) Map const* map = GetMap(); if (map->IsNonRaidDungeon()) if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficulty())) - if (dungeon->reclevel == 80) + if (dungeon->TargetLevel == 80) ChampioningFaction = GetChampioningFaction(); } @@ -6684,7 +6694,7 @@ void Player::RewardReputation(Quest const* quest) if (QuestFactionRewEntry const* questFactionRewEntry = sQuestFactionRewardStore.LookupEntry(row)) { uint32 field = abs(quest->RewardFactionValueId[i]); - rep = questFactionRewEntry->QuestRewFactionValue[field]; + rep = questFactionRewEntry->Difficulty[field]; } } @@ -6799,7 +6809,7 @@ bool Player::RewardHonor(Unit* victim, uint32 groupsize, int32 honor, bool pvpto // [29..38] Other title and player name // [39+] Nothing uint32 victim_title = victim->GetUInt32Value(PLAYER_CHOSEN_TITLE); - // Get Killer titles, CharTitlesEntry::bit_index + // Get Killer titles, CharTitlesEntry::MaskID // Ranks: // title[1..14] -> rank[5..18] // title[15..28] -> rank[5..18] @@ -7013,7 +7023,7 @@ void Player::UpdateArea(uint32 newArea) AreaTableEntry const* area = sAreaTableStore.LookupEntry(newArea); bool oldFFAPvPArea = pvpInfo.IsInFFAPvPArea; - pvpInfo.IsInFFAPvPArea = area && (area->flags & AREA_FLAG_ARENA); + pvpInfo.IsInFFAPvPArea = area && (area->Flags & AREA_FLAG_ARENA); UpdatePvPState(true); // check if we were in ffa arena and we left @@ -7035,7 +7045,7 @@ void Player::UpdateArea(uint32 newArea) RemoveByteFlag(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, UNIT_BYTE2_FLAG_SANCTUARY); uint32 const areaRestFlag = (GetTeam() == ALLIANCE) ? AREA_FLAG_REST_ZONE_ALLIANCE : AREA_FLAG_REST_ZONE_HORDE; - if (area && area->flags & areaRestFlag) + if (area && area->Flags & areaRestFlag) SetRestFlag(REST_FLAG_IN_FACTION_AREA); else RemoveRestFlag(REST_FLAG_IN_FACTION_AREA); @@ -7076,19 +7086,19 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) GetMap()->SendZoneDynamicInfo(newZone, this); - // in PvP, any not controlled zone (except zone->team == 6, default case) + // in PvP, any not controlled zone (except zone->FactionGroupMask == 6, default case) // in PvE, only opposition team capital - switch (zone->team) + switch (zone->FactionGroupMask) { case AREATEAM_ALLY: - pvpInfo.IsInHostileArea = GetTeam() != ALLIANCE && (sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL); + pvpInfo.IsInHostileArea = GetTeam() != ALLIANCE && (sWorld->IsPvPRealm() || zone->Flags & AREA_FLAG_CAPITAL); break; case AREATEAM_HORDE: - pvpInfo.IsInHostileArea = GetTeam() != HORDE && (sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL); + pvpInfo.IsInHostileArea = GetTeam() != HORDE && (sWorld->IsPvPRealm() || zone->Flags & AREA_FLAG_CAPITAL); break; case AREATEAM_NONE: // overwrite for battlegrounds, maybe batter some zone flags but current known not 100% fit to this - pvpInfo.IsInHostileArea = sWorld->IsPvPRealm() || InBattleground() || zone->flags & AREA_FLAG_WINTERGRASP; + pvpInfo.IsInHostileArea = sWorld->IsPvPRealm() || InBattleground() || zone->Flags & AREA_FLAG_WINTERGRASP; break; default: // 6 in fact pvpInfo.IsInHostileArea = false; @@ -7098,7 +7108,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) // Treat players having a quest flagging for PvP as always in hostile area pvpInfo.IsHostile = pvpInfo.IsInHostileArea || HasPvPForcingQuest(); - if (zone->flags & AREA_FLAG_CAPITAL) // Is in a capital city + if (zone->Flags & AREA_FLAG_CAPITAL) // Is in a capital city { if (!pvpInfo.IsHostile || zone->IsSanctuary()) SetRestFlag(REST_FLAG_IN_CITY); @@ -7349,7 +7359,7 @@ ScalingStatValuesEntry const* Player::GetScalingStatValuesFor(ItemTemplate const return nullptr; // req. check at equip, but allow use for extended range if range limit max level, set proper level - uint32 const ssd_level = std::min(uint32(GetLevel()), ssd->MaxLevel); + uint32 const ssd_level = std::min(uint32(GetLevel()), ssd->Maxlevel); return sScalingStatValuesStore.LookupEntry(ssd_level); } @@ -7370,10 +7380,10 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply // If set ScalingStatDistribution need get stats and values from it if (ssd && ssv) { - if (ssd->StatMod[i] < 0) + if (ssd->StatID[i] < 0) continue; - statType = ssd->StatMod[i]; - val = (ssv->getssdMultiplier(proto->ScalingStatValue) * ssd->Modifier[i]) / 10000; + statType = ssd->StatID[i]; + val = (ssv->getssdMultiplier(proto->ScalingStatValue) * ssd->Bonus[i]) / 10000; } else { @@ -8008,7 +8018,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { - if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; SpellEnchantProcEntry const* entry = sSpellMgr->GetSpellEnchantProcEvent(enchant_id); @@ -8030,15 +8040,15 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT if (entry && (entry->AttributesMask & ENCHANT_PROC_ATTR_WHITE_HIT) && damageInfo.GetSpellInfo()) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectArg[s]); if (!spellInfo) { TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell: Player '%s' (%s) cast unknown spell (EnchantID: %u, SpellID: %i), ignoring", - GetName().c_str(), GetGUID().ToString().c_str(), pEnchant->ID, pEnchant->spellid[s]); + GetName().c_str(), GetGUID().ToString().c_str(), pEnchant->ID, pEnchant->EffectArg[s]); continue; } - float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance(); + float chance = pEnchant->EffectPointsMin[s] != 0 ? float(pEnchant->EffectPointsMin[s]) : GetWeaponProcChance(); if (entry) { if (entry->ProcsPerMinute) @@ -8048,7 +8058,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT } // Apply spell mods - ApplySpellMod(pEnchant->spellid[s], SPELLMOD_CHANCE_OF_SUCCESS, chance); + ApplySpellMod(pEnchant->EffectArg[s], SPELLMOD_CHANCE_OF_SUCCESS, chance); // Shiv has 100% chance to apply the poison if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT) @@ -8141,13 +8151,13 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 continue; for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { - if (pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL) + if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectArg[s]); if (!spellInfo) { - TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]); + TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->EffectArg[s]); continue; } @@ -9407,12 +9417,12 @@ void Player::SendBGWeekendWorldStates() const for (uint32 i = 1; i < sBattlemasterListStore.GetNumRows(); ++i) { BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(i); - if (bl && bl->HolidayWorldStateId) + if (bl && bl->HolidayWorldState) { - if (BattlegroundMgr::IsBGWeekend((BattlegroundTypeId)bl->id)) - SendUpdateWorldState(bl->HolidayWorldStateId, 1); + if (BattlegroundMgr::IsBGWeekend((BattlegroundTypeId)bl->ID)) + SendUpdateWorldState(bl->HolidayWorldState, 1); else - SendUpdateWorldState(bl->HolidayWorldStateId, 0); + SendUpdateWorldState(bl->HolidayWorldState, 0); } } } @@ -10290,13 +10300,13 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; } - if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE) + if (limitEntry->Flags == ITEM_LIMIT_CATEGORY_MODE_HAVE) { uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem); - if (curcount + count > uint32(limitEntry->maxCount)) + if (curcount + count > uint32(limitEntry->Quantity)) { if (no_space_count) - *no_space_count = count + curcount - limitEntry->maxCount; + *no_space_count = count + curcount - limitEntry->Quantity; if (itemLimitCategory) *itemLimitCategory = pProto->ItemLimitCategory; return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED; @@ -11361,7 +11371,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool ScalingStatDistributionEntry const* ssd = pProto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(pProto->ScalingStatDistribution) : 0; // check allowed level (extend range to upper values if MaxLevel more or equal max player level, this let GM set high level with 1...max range items) - if (ssd && ssd->MaxLevel < DEFAULT_MAX_LEVEL && ssd->MaxLevel < GetLevel()) + if (ssd && ssd->Maxlevel < DEFAULT_MAX_LEVEL && ssd->Maxlevel < GetLevel()) return EQUIP_ERR_ITEM_CANT_BE_EQUIPPED; uint8 eslot = FindEquipSlot(pProto, slot, swap); @@ -13729,13 +13739,13 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool if (!pEnchant) return; - if (!ignore_condition && pEnchant->EnchantmentCondition && !EnchantmentFitsRequirements(pEnchant->EnchantmentCondition, -1)) + if (!ignore_condition && pEnchant->ConditionID && !EnchantmentFitsRequirements(pEnchant->ConditionID, -1)) return; - if (pEnchant->requiredLevel > GetLevel()) + if (pEnchant->MinLevel > GetLevel()) return; - if (pEnchant->requiredSkill > 0 && pEnchant->requiredSkillValue > GetSkillValue(pEnchant->requiredSkill)) + if (pEnchant->RequiredSkillID > 0 && pEnchant->RequiredSkillRank > GetSkillValue(pEnchant->RequiredSkillID)) return; // If we're dealing with a gem inside a prismatic socket we need to check the prismatic socket requirements @@ -13745,7 +13755,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool { // Check if the requirements for the prismatic socket are met before applying the gem stats SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)); - if (!pPrismaticEnchant || (pPrismaticEnchant->requiredSkill > 0 && pPrismaticEnchant->requiredSkillValue > GetSkillValue(pPrismaticEnchant->requiredSkill))) + if (!pPrismaticEnchant || (pPrismaticEnchant->RequiredSkillID > 0 && pPrismaticEnchant->RequiredSkillRank > GetSkillValue(pPrismaticEnchant->RequiredSkillID))) return; } @@ -13753,9 +13763,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool { for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { - uint32 enchant_display_type = pEnchant->type[s]; - uint32 enchant_amount = pEnchant->amount[s]; - uint32 enchant_spell_id = pEnchant->spellid[s]; + uint32 enchant_display_type = pEnchant->Effect[s]; + uint32 enchant_amount = pEnchant->EffectPointsMin[s]; + uint32 enchant_spell_id = pEnchant->EffectArg[s]; switch (enchant_display_type) { @@ -13786,9 +13796,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool // Search enchant_amount for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) { - if (item_rand->enchant_id[k] == enchant_id) + if (item_rand->Enchantment[k] == enchant_id) { - basepoints = int32((item_rand->prefix[k] * item->GetItemSuffixFactor()) / 10000); + basepoints = int32((item_rand->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000); break; } } @@ -13815,9 +13825,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool { for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) { - if (item_rand->enchant_id[k] == enchant_id) + if (item_rand->Enchantment[k] == enchant_id) { - enchant_amount = uint32((item_rand->prefix[k] * item->GetItemSuffixFactor()) / 10000); + enchant_amount = uint32((item_rand->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000); break; } } @@ -13835,9 +13845,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool { for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) { - if (item_rand_suffix->enchant_id[k] == enchant_id) + if (item_rand_suffix->Enchantment[k] == enchant_id) { - enchant_amount = uint32((item_rand_suffix->prefix[k] * item->GetItemSuffixFactor()) / 10000); + enchant_amount = uint32((item_rand_suffix->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000); break; } } @@ -14093,12 +14103,12 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16 if (!Enchant) return; - if (Enchant->requiredSkill == skill_id) + if (Enchant->RequiredSkillID == skill_id) { // Checks if the enchantment needs to be applied or removed - if (curr_value < Enchant->requiredSkillValue && new_value >= Enchant->requiredSkillValue) + if (curr_value < Enchant->RequiredSkillRank && new_value >= Enchant->RequiredSkillRank) ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true); - else if (new_value < Enchant->requiredSkillValue && curr_value >= Enchant->requiredSkillValue) + else if (new_value < Enchant->RequiredSkillRank && curr_value >= Enchant->RequiredSkillRank) ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false); } @@ -14109,11 +14119,11 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16 { SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(m_items[i]->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)); - if (pPrismaticEnchant && pPrismaticEnchant->requiredSkill == skill_id) + if (pPrismaticEnchant && pPrismaticEnchant->RequiredSkillID == skill_id) { - if (curr_value < pPrismaticEnchant->requiredSkillValue && new_value >= pPrismaticEnchant->requiredSkillValue) + if (curr_value < pPrismaticEnchant->RequiredSkillRank && new_value >= pPrismaticEnchant->RequiredSkillRank) ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true); - else if (new_value < pPrismaticEnchant->requiredSkillValue && curr_value >= pPrismaticEnchant->requiredSkillValue) + else if (new_value < pPrismaticEnchant->RequiredSkillRank && curr_value >= pPrismaticEnchant->RequiredSkillRank) ApplyEnchantment(m_items[i], EnchantmentSlot(slot), false); } } @@ -17518,8 +17528,8 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder* holder) else // has start node, teleport to it { TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has too short taxi destination list, teleport to original node.", GetGUID().ToString().c_str()); - mapId = nodeEntry->map_id; - Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f); + mapId = nodeEntry->ContinentID; + Relocate(nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z, 0.0f); } m_taxi.ClearTaxiDestinations(); } @@ -17528,11 +17538,11 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder* holder) { // save source node as recall coord to prevent recall and fall from sky TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id); - if (nodeEntry && nodeEntry->map_id == GetMapId()) + if (nodeEntry && nodeEntry->ContinentID == GetMapId()) { ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString - mapId = nodeEntry->map_id; - Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f); + mapId = nodeEntry->ContinentID; + Relocate(nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z, 0.0f); } // flight will started later @@ -18095,13 +18105,13 @@ void Player::_LoadGlyphAuras() { if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(GetGlyphSlot(i))) { - if (gp->TypeFlags == gs->TypeFlags) + if (gp->GlyphSlotFlags == gs->Type) { - CastSpell(this, gp->SpellId, true); + CastSpell(this, gp->SpellID, true); continue; } else - TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has glyph with typeflags %u in slot with typeflags %u, removing.", GetName().c_str(), GetGUID().ToString().c_str(), gp->TypeFlags, gs->TypeFlags); + TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has glyph with typeflags %u in slot with typeflags %u, removing.", GetName().c_str(), GetGUID().ToString().c_str(), gp->GlyphSlotFlags, gs->Type); } else TC_LOG_ERROR("entities.player", "Player::_LoadGlyphAuras: Player '%s' (%s) has not existing glyph slot entry %u on index %u", GetName().c_str(), GetGUID().ToString().c_str(), GetGlyphSlot(i), i); @@ -18840,7 +18850,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) bool deleteInstance = false; MapEntry const* mapEntry = sMapStore.LookupEntry(mapId); - std::string mapname = mapEntry ? mapEntry->name[sWorld->GetDefaultDbcLocale()] : "Unknown"; + std::string mapname = mapEntry ? mapEntry->MapName[sWorld->GetDefaultDbcLocale()] : "Unknown"; if (!mapEntry || !mapEntry->IsDungeon()) { @@ -20501,7 +20511,7 @@ void Player::ResetInstances(uint8 method, bool isRaid) if (method == INSTANCE_RESET_ALL) { // the "reset all instances" method can only reset normal maps - if (entry->map_type == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC) + if (entry->InstanceType == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC) { ++itr; continue; @@ -21469,7 +21479,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc m_taxi.ClearTaxiDestinations(); ModifyMoney(-(int32)totalcost); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost); - TeleportTo(lastPathNode->map_id, lastPathNode->x, lastPathNode->y, lastPathNode->z, GetOrientation()); + TeleportTo(lastPathNode->ContinentID, lastPathNode->Pos.X, lastPathNode->Pos.Y, lastPathNode->Pos.Z, GetOrientation()); return false; } else @@ -21491,8 +21501,8 @@ bool Player::ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid /*= 0*/) std::vector<uint32> nodes; nodes.resize(2); - nodes[0] = entry->from; - nodes[1] = entry->to; + nodes[0] = entry->FromTaxiNode; + nodes[1] = entry->ToTaxiNode; return ActivateTaxiPathTo(nodes, nullptr, spellid); } @@ -21533,7 +21543,7 @@ void Player::ContinueTaxiFlight() const TaxiPathNodeList const& nodeList = sTaxiPathNodesByPath[path]; float distPrev; - float distNext = GetExactDistSq(nodeList[0]->LocX, nodeList[0]->LocY, nodeList[0]->LocZ); + float distNext = GetExactDistSq(nodeList[0]->Loc.X, nodeList[0]->Loc.Y, nodeList[0]->Loc.Z); for (uint32 i = 1; i < nodeList.size(); ++i) { @@ -21541,17 +21551,17 @@ void Player::ContinueTaxiFlight() const TaxiPathNodeEntry const* prevNode = nodeList[i-1]; // skip nodes at another map - if (node->MapID != GetMapId()) + if (node->ContinentID != GetMapId()) continue; distPrev = distNext; - distNext = GetExactDistSq(node->LocX, node->LocY, node->LocZ); + distNext = GetExactDistSq(node->Loc.X, node->Loc.Y, node->Loc.Z); float distNodes = - (node->LocX - prevNode->LocX)*(node->LocX - prevNode->LocX) + - (node->LocY - prevNode->LocY)*(node->LocY - prevNode->LocY) + - (node->LocZ - prevNode->LocZ)*(node->LocZ - prevNode->LocZ); + (node->Loc.X - prevNode->Loc.X)*(node->Loc.X - prevNode->Loc.X) + + (node->Loc.Y - prevNode->Loc.Y)*(node->Loc.Y - prevNode->Loc.Y) + + (node->Loc.Z - prevNode->Loc.Z)*(node->Loc.Z - prevNode->Loc.Z); if (distNext + distPrev < distNodes) { @@ -21588,11 +21598,11 @@ void Player::InitDataForForm(bool reapplyMods) { ShapeshiftForm form = GetShapeshiftForm(); - SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form); - if (ssEntry && ssEntry->attackSpeed) + SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form); + if (ssEntry && ssEntry->CombatRoundTime) { - SetAttackTime(BASE_ATTACK, ssEntry->attackSpeed); - SetAttackTime(OFF_ATTACK, ssEntry->attackSpeed); + SetAttackTime(BASE_ATTACK, ssEntry->CombatRoundTime); + SetAttackTime(OFF_ATTACK, ssEntry->CombatRoundTime); SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME); } else @@ -21652,16 +21662,16 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c { ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(crItem->ExtendedCost); ASSERT(iece); - if (iece->reqhonorpoints) - ModifyHonorPoints(-int32(iece->reqhonorpoints * count)); + if (iece->HonorPoints) + ModifyHonorPoints(-int32(iece->HonorPoints * count)); - if (iece->reqarenapoints) - ModifyArenaPoints(-int32(iece->reqarenapoints * count)); + if (iece->ArenaPoints) + ModifyArenaPoints(-int32(iece->ArenaPoints * count)); for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) { - if (iece->reqitem[i]) - DestroyItemCount(iece->reqitem[i], (iece->reqitemcount[i] * count), true); + if (iece->ItemID[i]) + DestroyItemCount(iece->ItemID[i], (iece->ItemCount[i] * count), true); } } @@ -21789,14 +21799,14 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin } // honor points price - if (GetHonorPoints() < (iece->reqhonorpoints * count)) + if (GetHonorPoints() < (iece->HonorPoints * count)) { SendEquipError(EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS, nullptr, nullptr); return false; } // arena points price - if (GetArenaPoints() < (iece->reqarenapoints * count)) + if (GetArenaPoints() < (iece->ArenaPoints * count)) { SendEquipError(EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS, nullptr, nullptr); return false; @@ -21805,7 +21815,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin // item base price for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) { - if (iece->reqitem[i] && !HasItemCount(iece->reqitem[i], (iece->reqitemcount[i] * count))) + if (iece->ItemID[i] && !HasItemCount(iece->ItemID[i], (iece->ItemCount[i] * count))) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr); return false; @@ -21813,7 +21823,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin } // check for personal arena rating requirement - if (GetMaxPersonalArenaRatingRequirement(iece->reqarenaslot) < iece->reqpersonalarenarating) + if (GetMaxPersonalArenaRatingRequirement(iece->ArenaBracket) < iece->RequiredArenaRating) { // probably not the proper equip err SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK, nullptr, nullptr); @@ -22061,7 +22071,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) if (!enchantEntry) continue; - uint32 gemid = enchantEntry->GemID; + uint32 gemid = enchantEntry->SrcItemID; if (!gemid) continue; @@ -22073,7 +22083,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) if (!gemProperty) continue; - uint8 GemColor = gemProperty->color; + uint8 GemColor = gemProperty->Type; for (uint8 b = 0, tmpcolormask = 1; b < 4; b++, tmpcolormask <<= 1) { @@ -22088,15 +22098,15 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) for (uint8 i = 0; i < 5; i++) { - if (!Condition->Color[i]) + if (!Condition->LtOperandType[i]) continue; - uint32 _cur_gem = curcount[Condition->Color[i] - 1]; + uint32 _cur_gem = curcount[Condition->LtOperandType[i] - 1]; // if have <CompareColor> use them as count, else use <value> from Condition - uint32 _cmp_gem = Condition->CompareColor[i] ? curcount[Condition->CompareColor[i] - 1]: Condition->Value[i]; + uint32 _cmp_gem = Condition->RtOperandType[i] ? curcount[Condition->RtOperandType[i] - 1]: Condition->RtOperand[i]; - switch (Condition->Comparator[i]) + switch (Condition->Operator[i]) { case 2: // requires less <color> than (<value> || <comparecolor>) gems activate &= (_cur_gem < _cmp_gem) ? true : false; @@ -22140,7 +22150,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) if (!enchantEntry) continue; - uint32 condition = enchantEntry->EnchantmentCondition; + uint32 condition = enchantEntry->ConditionID; if (condition) { //was enchant active with/without item? @@ -22184,7 +22194,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) continue; //only metagems to be (de)activated, so only enchants with condition - uint32 condition = enchantEntry->EnchantmentCondition; + uint32 condition = enchantEntry->ConditionID; if (condition) ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply); } @@ -22221,7 +22231,7 @@ void Player::SetBattlegroundEntryPoint() if (GetMap()->IsDungeon()) { if (WorldSafeLocsEntry const* entry = sObjectMgr->GetClosestGraveyard(GetPositionX(), GetPositionY(), GetPositionZ(), GetMapId(), GetTeam())) - m_bgData.joinPos = WorldLocation(entry->map_id, entry->x, entry->y, entry->z, 0.0f); + m_bgData.joinPos = WorldLocation(entry->Continent, entry->Loc.X, entry->Loc.Y, entry->Loc.Z, 0.0f); else TC_LOG_ERROR("entities.player", "Player::SetBattlegroundEntryPoint: Dungeon (MapID: %u) has no linked graveyard, setting home location as entry point.", GetMapId()); } @@ -22950,7 +22960,7 @@ void Player::ResetSpells(bool myClassOnly) ChrClassesEntry const* clsEntry = sChrClassesStore.LookupEntry(GetClass()); if (!clsEntry) return; - family = clsEntry->spellfamily; + family = clsEntry->SpellClassSet; for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) { @@ -23062,8 +23072,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank) if (!rank) break; - SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTier); - uint16 maxValue = tier->MaxSkill[std::max<int32>(rank - 1, 0)]; + SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTierID); + uint16 maxValue = tier->Value[std::max<int32>(rank - 1, 0)]; uint16 skillValue = 1; if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE) skillValue = maxValue; @@ -23148,37 +23158,37 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { SkillLineAbilityEntry const* ability = sSkillLineAbilityStore.LookupEntry(j); - if (!ability || ability->skillId != skillId) + if (!ability || ability->SkillLine != skillId) continue; - if (!sSpellMgr->GetSpellInfo(ability->spellId)) + if (!sSpellMgr->GetSpellInfo(ability->Spell)) continue; - if (ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (ability->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; // Check race if set - if (ability->racemask && !(ability->racemask & raceMask)) + if (ability->RaceMask && !(ability->RaceMask & raceMask)) continue; // Check class if set - if (ability->classmask && !(ability->classmask & classMask)) + if (ability->ClassMask && !(ability->ClassMask & classMask)) continue; // need unlearn spell - if (skillValue < ability->req_skill_value && ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) - RemoveSpell(ability->spellId); + if (skillValue < ability->MinSkillLineRank && ability->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) + RemoveSpell(ability->Spell); // need learn else { // used to avoid double Seal of Righteousness on paladins, it's the only player spell which has both spell and forward spell in auto learn - if (ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && ability->forward_spellid) + if (ability->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && ability->SupercededBySpell) { bool skipCurrent = false; - auto bounds = sSpellMgr->GetSkillLineAbilityMapBounds(ability->forward_spellid); + auto bounds = sSpellMgr->GetSkillLineAbilityMapBounds(ability->SupercededBySpell); for (auto itr = bounds.first; itr != bounds.second; ++itr) { - if (itr->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && skillValue >= itr->second->req_skill_value) + if (itr->second->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && skillValue >= itr->second->MinSkillLineRank) { skipCurrent = true; break; @@ -23190,9 +23200,9 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) } if (!IsInWorld()) - AddSpell(ability->spellId, true, true, true, false, false, ability->skillId); + AddSpell(ability->Spell, true, true, true, false, false, ability->SkillLine); else - LearnSpell(ability->spellId, true, ability->skillId); + LearnSpell(ability->Spell, true, ability->SkillLine); } } } @@ -23457,10 +23467,10 @@ float Player::GetReputationPriceDiscount(Creature const* creature) const float Player::GetReputationPriceDiscount(FactionTemplateEntry const* factionTemplate) const { - if (!factionTemplate || !factionTemplate->faction) + if (!factionTemplate || !factionTemplate->Faction) return 1.0f; - ReputationRank rank = GetReputationRank(factionTemplate->faction); + ReputationRank rank = GetReputationRank(factionTemplate->Faction); if (rank <= REP_NEUTRAL) return 1.0f; @@ -23484,15 +23494,15 @@ bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { // skip wrong race skills - if (_spell_idx->second->racemask && (_spell_idx->second->racemask & racemask) == 0) + if (_spell_idx->second->RaceMask && (_spell_idx->second->RaceMask & racemask) == 0) continue; // skip wrong class skills - if (_spell_idx->second->classmask && (_spell_idx->second->classmask & classmask) == 0) + if (_spell_idx->second->ClassMask && (_spell_idx->second->ClassMask & classmask) == 0) continue; // skip wrong class and race skill saved in SkillRaceClassInfo.dbc - if (!GetSkillRaceClassInfo(_spell_idx->second->skillId, GetRace(), GetClass())) + if (!GetSkillRaceClassInfo(_spell_idx->second->SkillLine, GetRace(), GetClass())) continue; return true; @@ -24500,7 +24510,7 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n uint8 facialhair = GetFacialStyle(); uint8 skincolor = GetSkinId(); - if ((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair) && (!newSkin || (newSkin->hair_id == skincolor))) + if ((hairstyle == newhairstyle) && (haircolor == newhaircolor) && (facialhair == newfacialhair) && (!newSkin || (newSkin->Data == skincolor))) return 0; GtBarberShopCostBaseEntry const* bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1); @@ -24511,16 +24521,16 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n float cost = 0; if (hairstyle != newhairstyle) - cost += bsc->cost; // full price + cost += bsc->Data; // full price if ((haircolor != newhaircolor) && (hairstyle == newhairstyle)) - cost += bsc->cost * 0.5f; // +1/2 of price + cost += bsc->Data * 0.5f; // +1/2 of price if (facialhair != newfacialhair) - cost += bsc->cost * 0.75f; // +3/4 of price + cost += bsc->Data * 0.75f; // +3/4 of price - if (newSkin && skincolor != newSkin->hair_id) - cost += bsc->cost * 0.75f; // +5/6 of price + if (newSkin && skincolor != newSkin->Data) + cost += bsc->Data * 0.75f; // +5/6 of price return uint32(cost); } @@ -24529,8 +24539,8 @@ void Player::InitGlyphsForLevel() { for (uint32 i = 0; i < sGlyphSlotStore.GetNumRows(); ++i) if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(i)) - if (gs->Order) - SetGlyphSlot(gs->Order - 1, gs->Id); + if (gs->Tooltip) + SetGlyphSlot(gs->Tooltip - 1, gs->ID); uint8 level = GetLevel(); uint32 value = 0; @@ -24582,13 +24592,13 @@ bool Player::HasTitle(uint32 bitIndex) const bool Player::HasTitle(CharTitlesEntry const* title) const { - return HasTitle(title->bit_index); + return HasTitle(title->MaskID); } void Player::SetTitle(CharTitlesEntry const* title, bool lost) { - uint32 fieldIndexOffset = title->bit_index / 32; - uint32 flag = 1 << (title->bit_index % 32); + uint32 fieldIndexOffset = title->MaskID / 32; + uint32 flag = 1 << (title->MaskID % 32); if (lost) { @@ -24606,7 +24616,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost) } WorldPacket data(SMSG_TITLE_EARNED, 4 + 4); - data << uint32(title->bit_index); + data << uint32(title->MaskID); data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost SendDirectMessage(&data); } @@ -25007,11 +25017,11 @@ void Player::_LoadSkills(PreparedQueryResult result) } uint16 skillStep = 0; - if (SkillTiersEntry const* skillTier = sSkillTiersStore.LookupEntry(rcEntry->SkillTier)) + if (SkillTiersEntry const* skillTier = sSkillTiersStore.LookupEntry(rcEntry->SkillTierID)) { for (uint32 i = 0; i < MAX_SKILL_STEP; ++i) { - if (skillTier->MaxSkill[skillStep] == max) + if (skillTier->Value[skillStep] == max) { skillStep = i + 1; break; @@ -25091,7 +25101,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi if (!enchantEntry) continue; - ItemTemplate const* pGem = sObjectMgr->GetItemTemplate(enchantEntry->GemID); + ItemTemplate const* pGem = sObjectMgr->GetItemTemplate(enchantEntry->SrcItemID); if (!pGem) continue; @@ -25125,13 +25135,13 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 // NOTE: limitEntry->mode not checked because if item have have-limit then it applied and to equip case - if (limit_count > limitEntry->maxCount) + if (limit_count > limitEntry->Quantity) return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED; // there is an equip limit on this item - if (HasItemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot)) + if (HasItemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->Quantity - limit_count + 1, except_slot)) return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED; - else if (HasGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot)) + else if (HasGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->Quantity - limit_count + 1, except_slot)) return EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED; } @@ -25250,7 +25260,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) if (!talentInfo) return; - TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); + TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID); if (!talentTabInfo) return; @@ -25263,7 +25273,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) uint8 curtalent_maxrank = 0; // 0 = not learned any rank for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { - if (talentInfo->RankID[rank] && HasSpell(talentInfo->RankID[rank])) + if (talentInfo->SpellRank[rank] && HasSpell(talentInfo->SpellRank[rank])) { curtalent_maxrank = (rank + 1); break; @@ -25279,15 +25289,15 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) return; // Check if it requires another talent - if (talentInfo->DependsOn > 0) + if (talentInfo->PrereqTalent > 0) { - if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->DependsOn)) + if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->PrereqTalent)) { bool hasEnoughRank = false; - for (uint8 rank = talentInfo->DependsOnRank; rank < MAX_TALENT_RANK; rank++) + for (uint8 rank = talentInfo->PrereqRank; rank < MAX_TALENT_RANK; rank++) { - if (depTalentInfo->RankID[rank] != 0) - if (HasSpell(depTalentInfo->RankID[rank])) + if (depTalentInfo->SpellRank[rank] != 0) + if (HasSpell(depTalentInfo->SpellRank[rank])) hasEnoughRank = true; } if (!hasEnoughRank) @@ -25298,22 +25308,22 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) // Find out how many points we have in this field uint32 spentPoints = 0; - uint32 tTab = talentInfo->TalentTab; - if (talentInfo->Row > 0) + uint32 tTab = talentInfo->TabID; + if (talentInfo->TierID > 0) for (uint32 i = 0; i < sTalentStore.GetNumRows(); i++) // Loop through all talents. if (TalentEntry const* tmpTalent = sTalentStore.LookupEntry(i)) // the way talents are tracked - if (tmpTalent->TalentTab == tTab) + if (tmpTalent->TabID == tTab) for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++) - if (tmpTalent->RankID[rank] != 0) - if (HasSpell(tmpTalent->RankID[rank])) + if (tmpTalent->SpellRank[rank] != 0) + if (HasSpell(tmpTalent->SpellRank[rank])) spentPoints += (rank + 1); // not have required min points spent in talent tree - if (spentPoints < (talentInfo->Row * MAX_TALENT_RANK)) + if (spentPoints < (talentInfo->TierID * MAX_TALENT_RANK)) return; // spell not set in talent.dbc - uint32 spellid = talentInfo->RankID[talentRank]; + uint32 spellid = talentInfo->SpellRank[talentRank]; if (spellid == 0) { TC_LOG_ERROR("entities.player", "Player::LearnTalent: Talent.dbc has no spellInfo for talent: %u (spell id = 0)", talentId); @@ -25357,7 +25367,7 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa if (!talentInfo) return; - TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); + TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID); if (!talentTabInfo) return; @@ -25372,18 +25382,18 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa if (!pet_family) return; - if (pet_family->petTalentType < 0) // not hunter pet + if (pet_family->PetTalentType < 0) // not hunter pet return; // prevent learn talent for different family (cheating) - if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)) + if (!((1 << pet_family->PetTalentType) & talentTabInfo->CategoryEnumID)) return; // find current max talent rank (0~5) uint8 curtalent_maxrank = 0; // 0 = not learned any rank for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { - if (talentInfo->RankID[rank] && pet->HasSpell(talentInfo->RankID[rank])) + if (talentInfo->SpellRank[rank] && pet->HasSpell(talentInfo->SpellRank[rank])) { curtalent_maxrank = (rank + 1); break; @@ -25399,15 +25409,15 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa return; // Check if it requires another talent - if (talentInfo->DependsOn > 0) + if (talentInfo->PrereqTalent > 0) { - if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->DependsOn)) + if (TalentEntry const* depTalentInfo = sTalentStore.LookupEntry(talentInfo->PrereqTalent)) { bool hasEnoughRank = false; - for (uint8 rank = talentInfo->DependsOnRank; rank < MAX_TALENT_RANK; rank++) + for (uint8 rank = talentInfo->PrereqRank; rank < MAX_TALENT_RANK; rank++) { - if (depTalentInfo->RankID[rank] != 0) - if (pet->HasSpell(depTalentInfo->RankID[rank])) + if (depTalentInfo->SpellRank[rank] != 0) + if (pet->HasSpell(depTalentInfo->SpellRank[rank])) hasEnoughRank = true; } if (!hasEnoughRank) @@ -25418,8 +25428,8 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa // Find out how many points we have in this field uint32 spentPoints = 0; - uint32 tTab = talentInfo->TalentTab; - if (talentInfo->Row > 0) + uint32 tTab = talentInfo->TabID; + if (talentInfo->TierID > 0) { uint32 numRows = sTalentStore.GetNumRows(); for (uint32 i = 0; i < numRows; ++i) // Loop through all talents. @@ -25428,13 +25438,13 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa TalentEntry const* tmpTalent = sTalentStore.LookupEntry(i); if (tmpTalent) // the way talents are tracked { - if (tmpTalent->TalentTab == tTab) + if (tmpTalent->TabID == tTab) { for (uint8 rank = 0; rank < MAX_TALENT_RANK; rank++) { - if (tmpTalent->RankID[rank] != 0) + if (tmpTalent->SpellRank[rank] != 0) { - if (pet->HasSpell(tmpTalent->RankID[rank])) + if (pet->HasSpell(tmpTalent->SpellRank[rank])) { spentPoints += (rank + 1); } @@ -25446,11 +25456,11 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa } // not have required min points spent in talent tree - if (spentPoints < (talentInfo->Row * MAX_PET_TALENT_RANK)) + if (spentPoints < (talentInfo->TierID * MAX_PET_TALENT_RANK)) return; // spell not set in talent.dbc - uint32 spellid = talentInfo->RankID[talentRank]; + uint32 spellid = talentInfo->SpellRank[talentRank]; if (spellid == 0) { TC_LOG_ERROR("entities.player", "Talent.dbc contains talent: %u Rank: %u spell id = 0", talentId, talentRank); @@ -25573,14 +25583,14 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) continue; // skip another tab talents - if (talentInfo->TalentTab != talentTabId) + if (talentInfo->TabID != talentTabId) continue; // find max talent rank (0~4) int8 curtalent_maxrank = -1; for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { - if (talentInfo->RankID[rank] && HasTalent(talentInfo->RankID[rank], specIdx)) + if (talentInfo->SpellRank[rank] && HasTalent(talentInfo->SpellRank[rank], specIdx)) { curtalent_maxrank = rank; break; @@ -25591,7 +25601,7 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) if (curtalent_maxrank < 0) continue; - *data << uint32(talentInfo->TalentID); // Talent.dbc + *data << uint32(talentInfo->ID); // Talent.dbc *data << uint8(curtalent_maxrank); // talentMaxRank (0-4) ++talentIdCount; @@ -25631,7 +25641,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) return; CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family); - if (!pet_family || pet_family->petTalentType < 0) + if (!pet_family || pet_family->PetTalentType < 0) return; for (uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId) @@ -25640,7 +25650,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) if (!talentTabInfo) continue; - if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)) + if (!((1 << pet_family->PetTalentType) & talentTabInfo->CategoryEnumID)) continue; for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId) @@ -25650,14 +25660,14 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) continue; // skip another tab talents - if (talentInfo->TalentTab != talentTabId) + if (talentInfo->TabID != talentTabId) continue; // find max talent rank (0~4) int8 curtalent_maxrank = -1; for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { - if (talentInfo->RankID[rank] && pet->HasSpell(talentInfo->RankID[rank])) + if (talentInfo->SpellRank[rank] && pet->HasSpell(talentInfo->SpellRank[rank])) { curtalent_maxrank = rank; break; @@ -25668,7 +25678,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) if (curtalent_maxrank < 0) continue; - *data << uint32(talentInfo->TalentID); // Talent.dbc + *data << uint32(talentInfo->ID); // Talent.dbc *data << uint8(curtalent_maxrank); // talentMaxRank (0-4) ++talentIdCount; @@ -26117,7 +26127,7 @@ void Player::ActivateSpec(uint8 spec) if (!talentInfo) continue; - TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); + TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID); if (!talentTabInfo) continue; @@ -26131,10 +26141,10 @@ void Player::ActivateSpec(uint8 spec) for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { // skip non-existing talent ranks - if (talentInfo->RankID[rank] == 0) + if (talentInfo->SpellRank[rank] == 0) continue; - RemoveSpell(talentInfo->RankID[rank], true); // removes the talent, and all dependant, learned, and chained spells.. - if (SpellInfo const* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank])) + RemoveSpell(talentInfo->SpellRank[rank], true); // removes the talent, and all dependant, learned, and chained spells.. + if (SpellInfo const* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->SpellRank[rank])) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellInfo for valid trigger spells if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL) RemoveSpell(_spellEntry->Effects[i].TriggerSpell, true); // and remove any spells that the talent teaches @@ -26150,7 +26160,7 @@ void Player::ActivateSpec(uint8 spec) // remove secondary glyph if (uint32 oldglyph = m_Glyphs[m_activeSpec][slot]) if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) - RemoveAurasDueToSpell(old_gp->SpellId); + RemoveAurasDueToSpell(old_gp->SpellID); SetActiveSpec(spec); uint32 spentTalents = 0; @@ -26162,7 +26172,7 @@ void Player::ActivateSpec(uint8 spec) if (!talentInfo) continue; - TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); + TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID); if (!talentTabInfo) continue; @@ -26175,12 +26185,12 @@ void Player::ActivateSpec(uint8 spec) for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { // skip non-existing talent ranks - if (talentInfo->RankID[rank] == 0) + if (talentInfo->SpellRank[rank] == 0) continue; // if the talent can be found in the newly activated PlayerTalentMap - if (HasTalent(talentInfo->RankID[rank], m_activeSpec)) + if (HasTalent(talentInfo->SpellRank[rank], m_activeSpec)) { - LearnSpell(talentInfo->RankID[rank], false); // add the talent to the PlayerSpellMap + LearnSpell(talentInfo->SpellRank[rank], false); // add the talent to the PlayerSpellMap spentTalents += (rank + 1); // increment the spentTalents count } } @@ -26194,7 +26204,7 @@ void Player::ActivateSpec(uint8 spec) // apply primary glyph if (glyph) if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph)) - CastSpell(this, gp->SpellId, true); + CastSpell(this, gp->SpellID, true); SetGlyph(slot, glyph); } @@ -26302,12 +26312,12 @@ void Player::SendRefundInfo(Item* item) WorldPacket data(SMSG_ITEM_REFUND_INFO_RESPONSE, 8+4+4+4+4*4+4*4+4+4); data << uint64(item->GetGUID()); // item guid data << uint32(item->GetPaidMoney()); // money cost - data << uint32(iece->reqhonorpoints); // honor point cost - data << uint32(iece->reqarenapoints); // arena point cost + data << uint32(iece->HonorPoints); // honor point cost + data << uint32(iece->ArenaPoints); // arena point cost for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data { - data << uint32(iece->reqitem[i]); - data << uint32(iece->reqitemcount[i]); + data << uint32(iece->ItemID[i]); + data << uint32(iece->ItemCount[i]); } data << uint32(0); data << uint32(GetTotalPlayedTime() - item->GetPlayedTime()); @@ -26372,8 +26382,8 @@ void Player::RefundItem(Item* item) bool store_error = false; for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) { - uint32 count = iece->reqitemcount[i]; - uint32 itemid = iece->reqitem[i]; + uint32 count = iece->ItemCount[i]; + uint32 itemid = iece->ItemID[i]; if (count && itemid) { @@ -26400,12 +26410,12 @@ void Player::RefundItem(Item* item) data << uint64(item->GetGUID()); // item guid data << uint32(0); // 0, or error code data << uint32(item->GetPaidMoney()); // money cost - data << uint32(iece->reqhonorpoints); // honor point cost - data << uint32(iece->reqarenapoints); // arena point cost + data << uint32(iece->HonorPoints); // honor point cost + data << uint32(iece->ArenaPoints); // arena point cost for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) // item cost data { - data << uint32(iece->reqitem[i]); - data << uint32(iece->reqitemcount[i]); + data << uint32(iece->ItemID[i]); + data << uint32(iece->ItemCount[i]); } SendDirectMessage(&data); @@ -26423,8 +26433,8 @@ void Player::RefundItem(Item* item) // Grant back extendedcost items for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) { - uint32 count = iece->reqitemcount[i]; - uint32 itemid = iece->reqitem[i]; + uint32 count = iece->ItemCount[i]; + uint32 itemid = iece->ItemID[i]; if (count && itemid) { ItemPosCountVec dest; @@ -26440,11 +26450,11 @@ void Player::RefundItem(Item* item) ModifyMoney(moneyRefund); // Saved in SaveInventoryAndGoldToDB // Grant back Honor points - if (uint32 honorRefund = iece->reqhonorpoints) + if (uint32 honorRefund = iece->HonorPoints) ModifyHonorPoints(honorRefund, trans); // Grant back Arena points - if (uint32 arenaRefund = iece->reqarenapoints) + if (uint32 arenaRefund = iece->ArenaPoints) ModifyArenaPoints(arenaRefund, trans); SaveInventoryAndGoldToDB(trans); @@ -26647,9 +26657,9 @@ std::string Player::GetMapAreaAndZoneString() const if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId)) { int locale = GetSession()->GetSessionDbcLocale(); - areaName = area->area_name[locale]; - if (AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->zone)) - zoneName = zone->area_name[locale]; + areaName = area->AreaName[locale]; + if (AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->ParentAreaID)) + zoneName = zone->AreaName[locale]; } std::ostringstream str; diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index ff0df23dab1..9364d71e2a6 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -183,13 +183,13 @@ void Transport::Update(uint32 diff) MoveToNextWaypoint(); - sScriptMgr->OnRelocate(this, _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ); + sScriptMgr->OnRelocate(this, _currentFrame->Node->NodeIndex, _currentFrame->Node->ContinentID, _currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z); - TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ); + TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->NodeIndex, _currentFrame->Node->ContinentID, _currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z); // Departure event if (_currentFrame->IsTeleportFrame()) - if (TeleportTransport(_nextFrame->Node->MapID, _nextFrame->Node->LocX, _nextFrame->Node->LocY, _nextFrame->Node->LocZ, _nextFrame->InitialOrientation)) + if (TeleportTransport(_nextFrame->Node->ContinentID, _nextFrame->Node->Loc.X, _nextFrame->Node->Loc.Y, _nextFrame->Node->Loc.Z, _nextFrame->InitialOrientation)) return; // Update more in new map thread } @@ -215,7 +215,7 @@ void Transport::Update(uint32 diff) UpdatePosition(pos.x, pos.y, pos.z, std::atan2(dir.y, dir.x) + float(M_PI)); } else if (justStopped) - UpdatePosition(_currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ, _currentFrame->InitialOrientation); + UpdatePosition(_currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z, _currentFrame->InitialOrientation); else { /* There are four possible scenarios that trigger loading/unloading passengers: @@ -396,7 +396,7 @@ TempSummon* Transport::SummonPassenger(uint32 entry, Position const& pos, TempSu uint32 mask = UNIT_MASK_SUMMON; if (properties) { - switch (properties->Category) + switch (properties->Control) { case SUMMON_CATEGORY_PET: mask = UNIT_MASK_GUARDIAN; @@ -411,7 +411,7 @@ TempSummon* Transport::SummonPassenger(uint32 entry, Position const& pos, TempSu case SUMMON_CATEGORY_ALLY: case SUMMON_CATEGORY_UNK: { - switch (properties->Type) + switch (properties->Title) { case SUMMON_TYPE_MINION: case SUMMON_TYPE_GUARDIAN: @@ -653,13 +653,13 @@ void Transport::DelayedTeleportTransport() return; _delayedTeleport = false; - Map* newMap = sMapMgr->CreateBaseMap(_nextFrame->Node->MapID); + Map* newMap = sMapMgr->CreateBaseMap(_nextFrame->Node->ContinentID); GetMap()->RemoveFromMap<Transport>(this, false); SetMap(newMap); - float x = _nextFrame->Node->LocX, - y = _nextFrame->Node->LocY, - z = _nextFrame->Node->LocZ, + float x = _nextFrame->Node->Loc.X, + y = _nextFrame->Node->Loc.Y, + z = _nextFrame->Node->Loc.Z, o =_nextFrame->InitialOrientation; for (_passengerTeleportItr = _passengers.begin(); _passengerTeleportItr != _passengers.end();) @@ -673,7 +673,7 @@ void Transport::DelayedTeleportTransport() switch (obj->GetTypeId()) { case TYPEID_PLAYER: - if (!obj->ToPlayer()->TeleportTo(_nextFrame->Node->MapID, destX, destY, destZ, destO, TELE_TO_NOT_LEAVE_TRANSPORT)) + if (!obj->ToPlayer()->TeleportTo(_nextFrame->Node->ContinentID, destX, destY, destZ, destO, TELE_TO_NOT_LEAVE_TRANSPORT)) RemovePassenger(obj); break; case TYPEID_DYNAMICOBJECT: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a7495b4e9e6..5ee821ed284 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3160,15 +3160,15 @@ void Unit::ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidData> curLiquid = sLiquidTypeStore.LookupEntry(liquidData->entry); if (curLiquid != _lastLiquid) { - if (_lastLiquid && _lastLiquid->SpellId) - RemoveAurasDueToSpell(_lastLiquid->SpellId); + if (_lastLiquid && _lastLiquid->SpellID) + RemoveAurasDueToSpell(_lastLiquid->SpellID); Player* player = GetCharmerOrOwnerPlayerOrPlayerItself(); // Set _lastLiquid before casting liquid spell to avoid infinite loops _lastLiquid = curLiquid; - if (curLiquid && curLiquid->SpellId && (!player || !player->IsGameMaster())) - CastSpell(this, curLiquid->SpellId, true); + if (curLiquid && curLiquid->SpellID && (!player || !player->IsGameMaster())) + CastSpell(this, curLiquid->SpellID, true); } } @@ -5436,15 +5436,15 @@ void Unit::UpdateDisplayPower() if (GetTypeId() == TYPEID_PLAYER) { ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(GetClass()); - if (cEntry && cEntry->powerType < MAX_POWERS) - displayPower = Powers(cEntry->powerType); + if (cEntry && cEntry->DisplayPower < MAX_POWERS) + displayPower = Powers(cEntry->DisplayPower); } else if (GetTypeId() == TYPEID_UNIT) { if (Vehicle* vehicle = GetVehicleKit()) { - if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(vehicle->GetVehicleInfo()->m_powerDisplayId)) - displayPower = Powers(powerDisplay->PowerType); + if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(vehicle->GetVehicleInfo()->PowerDisplayID)) + displayPower = Powers(powerDisplay->ActualType); else if (GetClass() == CLASS_ROGUE) displayPower = POWER_ENERGY; } @@ -5916,7 +5916,7 @@ void Unit::SetMinion(Minion *minion, bool apply) if (minion->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN)) AddGuidValue(UNIT_FIELD_SUMMON, minion->GetGUID()); - if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET) + if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET) SetCritterGUID(minion->GetGUID()); // PvP, FFAPvP @@ -5942,7 +5942,7 @@ void Unit::SetMinion(Minion *minion, bool apply) m_Controlled.erase(minion); - if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET) + if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET) if (GetCritterGUID() == minion->GetGUID()) SetCritterGUID(ObjectGuid::Empty); @@ -8871,9 +8871,9 @@ uint32 Unit::GetCreatureType() const if (GetTypeId() == TYPEID_PLAYER) { ShapeshiftForm form = GetShapeshiftForm(); - SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form); - if (ssEntry && ssEntry->creatureType > 0) - return ssEntry->creatureType; + SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form); + if (ssEntry && ssEntry->CreatureType > 0) + return ssEntry->CreatureType; else { ChrRacesEntry const* raceEntry = sChrRacesStore.AssertEntry(GetRace()); @@ -8909,11 +8909,11 @@ bool Unit::IsInDisallowedMountForm() const if (ShapeshiftForm form = GetShapeshiftForm()) { - SpellShapeshiftEntry const* shapeshift = sSpellShapeshiftStore.LookupEntry(form); + SpellShapeshiftFormEntry const* shapeshift = sSpellShapeshiftFormStore.LookupEntry(form); if (!shapeshift) return true; - if (!(shapeshift->flags1 & 0x1)) + if (!(shapeshift->Flags & 0x1)) return true; } @@ -8924,12 +8924,12 @@ bool Unit::IsInDisallowedMountForm() const if (!display) return true; - CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtraId); + CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtendedDisplayInfoID); if (!displayExtra) return true; - CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelId); - ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->Race); + CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelID); + ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->DisplayRaceID); if (model && !(model->HasFlag(CREATURE_MODEL_DATA_FLAGS_CAN_MOUNT))) if (race && !(race->HasFlag(CHRRACES_FLAGS_CAN_MOUNT))) @@ -12326,22 +12326,22 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const } uint32 modelid = 0; - SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form); - if (formEntry && formEntry->modelID_A) + SpellShapeshiftFormEntry const* formEntry = sSpellShapeshiftFormStore.LookupEntry(form); + if (formEntry && formEntry->CreatureDisplayID[0]) { // Take the alliance modelid as default if (GetTypeId() != TYPEID_PLAYER) - return formEntry->modelID_A; + return formEntry->CreatureDisplayID[0]; else { if (Player::TeamForRace(GetRace()) == ALLIANCE) - modelid = formEntry->modelID_A; + modelid = formEntry->CreatureDisplayID[0]; else - modelid = formEntry->modelID_H; + modelid = formEntry->CreatureDisplayID[1]; // If the player is horde but there are no values for the horde modelid - take the alliance modelid if (!modelid && Player::TeamForRace(GetRace()) == HORDE) - modelid = formEntry->modelID_A; + modelid = formEntry->CreatureDisplayID[0]; } } @@ -12524,7 +12524,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a // If vehicle flag for fixed position set (cannons), or if the following hardcoded units, then set state rooted // 30236 | Argent Cannon // 39759 | Tankbuster Cannon - if ((vehicle->GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION) || vehicle->GetBase()->GetEntry() == 30236 || vehicle->GetBase()->GetEntry() == 39759) + if ((vehicle->GetVehicleInfo()->Flags & VEHICLE_FLAG_FIXED_POSITION) || vehicle->GetBase()->GetEntry() == 30236 || vehicle->GetBase()->GetEntry() == 39759) SetControlled(true, UNIT_STATE_ROOT); ASSERT(!m_vehicle); @@ -12882,7 +12882,7 @@ void Unit::StopAttackFaction(uint32 faction_id) { if (Unit* victim = GetVictim()) { - if (victim->GetFactionTemplateEntry()->faction == faction_id) + if (victim->GetFactionTemplateEntry()->Faction == faction_id) { AttackStop(); if (IsNonMeleeSpellCast(false)) @@ -12897,7 +12897,7 @@ void Unit::StopAttackFaction(uint32 faction_id) AttackerSet const& attackers = getAttackers(); for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();) { - if ((*itr)->GetFactionTemplateEntry()->faction == faction_id) + if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id) { (*itr)->AttackStop(); itr = attackers.begin(); @@ -12908,7 +12908,7 @@ void Unit::StopAttackFaction(uint32 faction_id) std::vector<CombatReference*> refsToEnd; for (auto const& pair : m_combatManager.GetPvECombatRefs()) - if (pair.second->GetOther(this)->GetFactionTemplateEntry()->faction == faction_id) + if (pair.second->GetOther(this)->GetFactionTemplateEntry()->Faction == faction_id) refsToEnd.push_back(pair.second); for (CombatReference* ref : refsToEnd) ref->EndCombat(); @@ -13514,11 +13514,11 @@ float Unit::GetCollisionHeight() const { if (CreatureDisplayInfoEntry const* mountDisplayInfo = sCreatureDisplayInfoStore.LookupEntry(GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID))) { - if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId)) + if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelID)) { CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId()); - CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId); - float const collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * modelData->Scale * displayInfo->scale * 0.5f); + CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelID); + float const collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * modelData->ModelScale * displayInfo->CreatureModelScale * 0.5f); return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight; } } @@ -13526,9 +13526,9 @@ float Unit::GetCollisionHeight() const //! Dismounting case - use basic default model data CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId()); - CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId); + CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelID); - float const collisionHeight = scaleMod * modelData->CollisionHeight * modelData->Scale * displayInfo->scale; + float const collisionHeight = scaleMod * modelData->CollisionHeight * modelData->ModelScale * displayInfo->CreatureModelScale; return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight; } diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index e3457dac50f..ec9245543e2 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -38,7 +38,7 @@ UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry { for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i) { - if (uint32 seatId = _vehicleInfo->m_seatID[i]) + if (uint32 seatId = _vehicleInfo->SeatID[i]) if (VehicleSeatEntry const* veSeat = sVehicleSeatStore.LookupEntry(seatId)) { VehicleSeatAddon const* addon = sObjectMgr->GetVehicleSeatAddon(seatId); @@ -193,11 +193,11 @@ void Vehicle::ApplyAllImmunities() // If vehicle flag for fixed position set (cannons), or if the following hardcoded units, then set state rooted // 30236 | Argent Cannon // 39759 | Tankbuster Cannon - if ((GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION) || GetBase()->GetEntry() == 30236 || GetBase()->GetEntry() == 39759) + if ((GetVehicleInfo()->Flags & VEHICLE_FLAG_FIXED_POSITION) || GetBase()->GetEntry() == 30236 || GetBase()->GetEntry() == 39759) _me->SetControlled(true, UNIT_STATE_ROOT); // Different immunities for vehicles goes below - switch (GetVehicleInfo()->m_ID) + switch (GetVehicleInfo()->ID) { // code below prevents a bug with movable cannons case 160: // Strand of the Ancients @@ -434,7 +434,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) } TC_LOG_DEBUG("entities.vehicle", "Unit %s scheduling enter vehicle (entry: %u, vehicleId: %u, guid: %s on seat %d", - unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().ToString().c_str(), (int32)seatId); + unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->ID, _me->GetGUID().ToString().c_str(), (int32)seatId); // The seat selection code may kick other passengers off the vehicle. // While the validity of the following may be arguable, it is possible that when such a passenger @@ -503,18 +503,18 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit) ASSERT(seat != Seats.end()); TC_LOG_DEBUG("entities.vehicle", "Unit %s exit vehicle entry %u id %u guid %s seat %d", - unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().ToString().c_str(), (int32)seat->first); + unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->ID, _me->GetGUID().ToString().c_str(), (int32)seat->first); if (seat->second.SeatInfo->CanEnterOrExit() && ++UsableSeatNum) _me->SetFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK)); // Remove UNIT_FLAG_NOT_SELECTABLE if passenger did not have it before entering vehicle - if (seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE && !seat->second.Passenger.IsUnselectable) + if (seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE && !seat->second.Passenger.IsUnselectable) unit->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); seat->second.Passenger.Reset(); - if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) + if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) _me->RemoveCharmedBy(unit); if (_me->IsInWorld()) @@ -616,7 +616,7 @@ bool Vehicle::IsControllableVehicle() const void Vehicle::InitMovementInfoForBase() { - uint32 vehicleFlags = GetVehicleInfo()->m_flags; + uint32 vehicleFlags = GetVehicleInfo()->Flags; if (vehicleFlags & VEHICLE_FLAG_NO_STRAFE) _me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_NO_STRAFE); @@ -858,9 +858,9 @@ bool VehicleJoinEvent::Execute(uint64, uint32) float o = veSeatAddon ? veSeatAddon->SeatOrientationOffset : 0.f; - float x = veSeat->m_attachmentOffsetX; - float y = veSeat->m_attachmentOffsetY; - float z = veSeat->m_attachmentOffsetZ; + float x = veSeat->AttachmentOffset.X; + float y = veSeat->AttachmentOffset.Y; + float z = veSeat->AttachmentOffset.Z; Passenger->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); Passenger->m_movementInfo.transport.pos.Relocate(x, y, z, o); diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 3f52804fab5..88a47de0c40 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -983,9 +983,9 @@ void GameEventMgr::LoadHolidayDates() if (uint32 duration = fields[3].GetUInt32()) entry->Duration[0] = duration; - auto itr = std::lower_bound(modifiedHolidays.begin(), modifiedHolidays.end(), entry->Id); - if (itr == modifiedHolidays.end() || *itr != entry->Id) - modifiedHolidays.insert(itr, entry->Id); + auto itr = std::lower_bound(modifiedHolidays.begin(), modifiedHolidays.end(), entry->ID); + if (itr == modifiedHolidays.end() || *itr != entry->ID) + modifiedHolidays.insert(itr, entry->ID); ++count; } while (result->NextRow()); @@ -1585,10 +1585,10 @@ void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate) if (bgTypeId != BATTLEGROUND_TYPE_NONE) { BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId); - if (bl && bl->HolidayWorldStateId) + if (bl && bl->HolidayWorldState) { WorldPackets::WorldState::UpdateWorldState worldstate; - worldstate.VariableID = bl->HolidayWorldStateId; + worldstate.VariableID = bl->HolidayWorldState; worldstate.Value = Activate ? 1 : 0; sWorld->SendGlobalMessage(worldstate.Write()); } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index c44b56b62e2..f0faf63c4ff 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1172,7 +1172,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) if (cInfo->scale <= 0.0f) { if (displayScaleEntry) - const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->scale; + const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->CreatureModelScale; else const_cast<CreatureTemplate*>(cInfo)->scale = 1.0f; } @@ -1676,8 +1676,8 @@ void ObjectMgr::LoadCreatureModelInfo() if (modelInfo.combat_reach < 0.1f) modelInfo.combat_reach = DEFAULT_PLAYER_COMBAT_REACH; - if (CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(creatureDisplay->ModelId)) - modelInfo.is_trigger = strstr(modelData->ModelPath, "InvisibleStalker") != nullptr; + if (CreatureModelDataEntry const* modelData = sCreatureModelDataStore.LookupEntry(creatureDisplay->ModelID)) + modelInfo.is_trigger = strstr(modelData->ModelName, "InvisibleStalker") != nullptr; ++count; } @@ -2967,18 +2967,18 @@ void ObjectMgr::LoadItemTemplates() if (dbcitem) { - if (itemTemplate.Class != dbcitem->Class) + if (itemTemplate.Class != dbcitem->ClassID) { - TC_LOG_ERROR("sql.sql", "Item (Entry: %u) does not have a correct class %u, must be %u .", entry, itemTemplate.Class, dbcitem->Class); + TC_LOG_ERROR("sql.sql", "Item (Entry: %u) does not have a correct class %u, must be %u .", entry, itemTemplate.Class, dbcitem->ClassID); if (enforceDBCAttributes) - itemTemplate.Class = dbcitem->Class; + itemTemplate.Class = dbcitem->ClassID; } - if (itemTemplate.SoundOverrideSubclass != dbcitem->SoundOverrideSubclass) + if (itemTemplate.SoundOverrideSubclass != dbcitem->SoundOverrideSubclassID) { - TC_LOG_ERROR("sql.sql", "Item (Entry: %u) does not have a correct SoundOverrideSubclass (%i), must be %i .", entry, itemTemplate.SoundOverrideSubclass, dbcitem->SoundOverrideSubclass); + TC_LOG_ERROR("sql.sql", "Item (Entry: %u) does not have a correct SoundOverrideSubclass (%i), must be %i .", entry, itemTemplate.SoundOverrideSubclass, dbcitem->SoundOverrideSubclassID); if (enforceDBCAttributes) - itemTemplate.SoundOverrideSubclass = dbcitem->SoundOverrideSubclass; + itemTemplate.SoundOverrideSubclass = dbcitem->SoundOverrideSubclassID; } if (itemTemplate.Material != dbcitem->Material) { @@ -2992,17 +2992,17 @@ void ObjectMgr::LoadItemTemplates() if (enforceDBCAttributes) itemTemplate.InventoryType = dbcitem->InventoryType; } - if (itemTemplate.DisplayInfoID != dbcitem->DisplayId) + if (itemTemplate.DisplayInfoID != dbcitem->DisplayInfoID) { - TC_LOG_ERROR("sql.sql", "Item (Entry: %u) does not have a correct display id (%u), must be %u .", entry, itemTemplate.DisplayInfoID, dbcitem->DisplayId); + TC_LOG_ERROR("sql.sql", "Item (Entry: %u) does not have a correct display id (%u), must be %u .", entry, itemTemplate.DisplayInfoID, dbcitem->DisplayInfoID); if (enforceDBCAttributes) - itemTemplate.DisplayInfoID = dbcitem->DisplayId; + itemTemplate.DisplayInfoID = dbcitem->DisplayInfoID; } - if (itemTemplate.Sheath != dbcitem->Sheath) + if (itemTemplate.Sheath != dbcitem->SheatheType) { - TC_LOG_ERROR("sql.sql", "Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", entry, itemTemplate.Sheath, dbcitem->Sheath); + TC_LOG_ERROR("sql.sql", "Item (Entry: %u) does not have a correct sheathid (%u), must be %u .", entry, itemTemplate.Sheath, dbcitem->SheatheType); if (enforceDBCAttributes) - itemTemplate.Sheath = dbcitem->Sheath; + itemTemplate.Sheath = dbcitem->SheatheType; } } @@ -3030,7 +3030,7 @@ void ObjectMgr::LoadItemTemplates() if (itemTemplate.Flags2 & ITEM_FLAG2_FACTION_HORDE) { if (FactionEntry const* faction = sFactionStore.LookupEntry(HORDE)) - if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0) + if ((itemTemplate.AllowableRace & faction->ReputationRaceMask[0]) == 0) TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAG2_FACTION_HORDE (%u) in Flags field, item cannot be equipped or used by these races.", entry, itemTemplate.AllowableRace, ITEM_FLAG2_FACTION_HORDE); @@ -3041,7 +3041,7 @@ void ObjectMgr::LoadItemTemplates() else if (itemTemplate.Flags2 & ITEM_FLAG2_FACTION_ALLIANCE) { if (FactionEntry const* faction = sFactionStore.LookupEntry(ALLIANCE)) - if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0) + if ((itemTemplate.AllowableRace & faction->ReputationRaceMask[0]) == 0) TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAG2_FACTION_ALLIANCE (%u) in Flags field, item cannot be equipped or used by these races.", entry, itemTemplate.AllowableRace, ITEM_FLAG2_FACTION_ALLIANCE); } @@ -3381,10 +3381,10 @@ void ObjectMgr::LoadItemTemplates() for (uint8 j = 0; j < MAX_OUTFIT_ITEMS; ++j) { - if (entry->ItemId[j] <= 0) + if (entry->ItemID[j] <= 0) continue; - uint32 item_id = entry->ItemId[j]; + uint32 item_id = entry->ItemID[j]; if (!GetItemTemplate(item_id)) notFoundOutfit.insert(item_id); @@ -3447,8 +3447,8 @@ void ObjectMgr::LoadItemSetNames() continue; for (uint32 i = 0; i < MAX_ITEM_SET_ITEMS; ++i) - if (setEntry->itemId[i]) - itemSetItems.insert(setEntry->itemId[i]); + if (setEntry->ItemID[i]) + itemSetItems.insert(setEntry->ItemID[i]); } // 0 1 2 @@ -3788,10 +3788,10 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3 bool found = false; for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x) { - if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId) + if (entry->ItemID[x] > 0 && uint32(entry->ItemID[x]) == itemId) { found = true; - const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0; + const_cast<CharStartOutfitEntry*>(entry)->ItemID[x] = 0; break; } } @@ -3878,8 +3878,8 @@ void ObjectMgr::LoadPlayerInfo() info->positionY = positionY; info->positionZ = positionZ; info->orientation = orientation; - info->displayId_m = rEntry->model_m; - info->displayId_f = rEntry->model_f; + info->displayId_m = rEntry->MaleDisplayID; + info->displayId_f = rEntry->FemaleDisplayID; _playerInfo[current_race][current_class] = std::move(info); ++count; @@ -6041,7 +6041,7 @@ void ObjectMgr::LoadInstanceEncounters() if (lastEncounterDungeon && !sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon)) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName[0], lastEncounterDungeon); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->Name[0], lastEncounterDungeon); continue; } @@ -6050,7 +6050,7 @@ void ObjectMgr::LoadInstanceEncounters() { if (itr != dungeonLastBosses.end()) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName[0], itr->second->id, itr->second->encounterName[0]); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->Name[0], itr->second->ID, itr->second->Name[0]); continue; } @@ -6064,7 +6064,7 @@ void ObjectMgr::LoadInstanceEncounters() CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry); if (!creatureInfo) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name[0]); continue; } const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS; @@ -6081,16 +6081,16 @@ void ObjectMgr::LoadInstanceEncounters() case ENCOUNTER_CREDIT_CAST_SPELL: if (!sSpellMgr->GetSpellInfo(creditEntry)) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name[0]); continue; } break; default: - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName[0]); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->Name[0]); continue; } - DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, dungeonEncounter->difficulty)]; + DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, dungeonEncounter->Difficulty)]; encounters.emplace_back(std::make_unique<DungeonEncounter>(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon)); ++count; } while (result->NextRow()); @@ -6679,7 +6679,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui { TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i); - if (!node || node->map_id != mapid || (!node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981)) // dk flight + if (!node || node->ContinentID != mapid || (!node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981)) // dk flight continue; uint8 field = (uint8)((i - 1) / 32); @@ -6689,7 +6689,7 @@ uint32 ObjectMgr::GetNearestTaxiNode(float x, float y, float z, uint32 mapid, ui if ((sTaxiNodesMask[field] & submask) == 0) continue; - float dist2 = (node->x - x)*(node->x - x)+(node->y - y)*(node->y - y)+(node->z - z)*(node->z - z); + float dist2 = (node->Pos.X - x)*(node->Pos.X - x)+(node->Pos.Y - y)*(node->Pos.Y - y)+(node->Pos.Z - z)*(node->Pos.Z - z); if (found) { if (dist2 < dist) @@ -6819,7 +6819,7 @@ void ObjectMgr::LoadGraveyardZones() continue; } - if (areaEntry->zone != 0) + if (areaEntry->ParentAreaID != 0) { TC_LOG_ERROR("sql.sql", "Table `graveyard_zone` has a record for SubZone (ID: %u) instead of zone, skipped.", zoneId); continue; @@ -6917,13 +6917,13 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveyard(float x, float y, float continue; // find now nearest graveyard at other map - if (MapId != entry->map_id) + if (MapId != entry->Continent) { // if find graveyard at different map from where entrance placed (or no entrance data), use any first if (!mapEntry - || mapEntry->entrance_map < 0 - || uint32(mapEntry->entrance_map) != entry->map_id - || (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0)) + || mapEntry->CorpseMapID < 0 + || uint32(mapEntry->CorpseMapID) != entry->Continent + || (mapEntry->Corpse.X == 0 && mapEntry->Corpse.Y == 0)) { // not have any corrdinates for check distance anyway entryFar = entry; @@ -6931,8 +6931,8 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveyard(float x, float y, float } // at entrance map calculate distance (2D); - float dist2 = (entry->x - mapEntry->entrance_x)*(entry->x - mapEntry->entrance_x) - +(entry->y - mapEntry->entrance_y)*(entry->y - mapEntry->entrance_y); + float dist2 = (entry->Loc.X - mapEntry->Corpse.X)*(entry->Loc.X - mapEntry->Corpse.X) + +(entry->Loc.Y - mapEntry->Corpse.Y)*(entry->Loc.Y - mapEntry->Corpse.Y); if (foundEntr) { if (dist2 < distEntr) @@ -6951,7 +6951,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveyard(float x, float y, float // find now nearest graveyard at same map else { - float dist2 = (entry->x - x)*(entry->x - x)+(entry->y - y)*(entry->y - y)+(entry->z - z)*(entry->z - z); + float dist2 = (entry->Loc.X - x)*(entry->Loc.X - x)+(entry->Loc.Y - y)*(entry->Loc.Y - y)+(entry->Loc.Z - z)*(entry->Loc.Z - z); if (foundNear) { if (dist2 < distNear) @@ -7240,7 +7240,7 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const bool useParentDbValue = false; uint32 parentId = 0; MapEntry const* mapEntry = sMapStore.LookupEntry(Map); - if (!mapEntry || mapEntry->entrance_map < 0) + if (!mapEntry || mapEntry->CorpseMapID < 0) return nullptr; if (mapEntry->IsDungeon()) @@ -7254,12 +7254,12 @@ AreaTrigger const* ObjectMgr::GetGoBackTrigger(uint32 Map) const useParentDbValue = true; } - uint32 entrance_map = uint32(mapEntry->entrance_map); + uint32 entrance_map = uint32(mapEntry->CorpseMapID); for (AreaTriggerContainer::const_iterator itr = _areaTriggerStore.begin(); itr != _areaTriggerStore.end(); ++itr) if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId)) { AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first); - if (atEntry && atEntry->mapid == Map) + if (atEntry && atEntry->ContinentID == Map) return &itr->second; } return nullptr; @@ -8071,7 +8071,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() continue; } - if (factionEntry->team == 0) + if (factionEntry->ParentFactionID == 0) { TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId); continue; @@ -8091,7 +8091,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() break; } - if (factionSpillover->reputationListID < 0) + if (factionSpillover->ReputationIndex < 0) { TC_LOG_ERROR("sql.sql", "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId); invalidSpilloverFaction = true; @@ -8830,11 +8830,11 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac for (uint8 i = 0; i < 4; ++i) { - if ((!factionEntry->BaseRepClassMask[i] || - factionEntry->BaseRepClassMask[i] & classMask) && - (!factionEntry->BaseRepRaceMask[i] || - factionEntry->BaseRepRaceMask[i] & raceMask)) - return factionEntry->BaseRepValue[i]; + if ((!factionEntry->ReputationClassMask[i] || + factionEntry->ReputationClassMask[i] & classMask) && + (!factionEntry->ReputationRaceMask[i] || + factionEntry->ReputationRaceMask[i] & raceMask)) + return factionEntry->ReputationBase[i]; } return 0; @@ -8842,17 +8842,17 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry) { - SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillId); + SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID); if (!skill) return SKILL_RANGE_NONE; - if (sSkillTiersStore.LookupEntry(rcEntry->SkillTier)) + if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID)) return SKILL_RANGE_RANK; - if (rcEntry->SkillId == SKILL_RUNEFORGING) + if (rcEntry->SkillID == SKILL_RUNEFORGING) return SKILL_RANGE_MONO; - switch (skill->categoryId) + switch (skill->CategoryID) { case SKILL_CATEGORY_ARMOR: return SKILL_RANGE_MONO; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index a8f1e9ad6c2..017243afb7d 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1969,7 +1969,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* // check for min / max count uint32 memberscount = GetMembersCount(); - if (memberscount > bgEntry->maxGroupSize) // no MinPlayerCount for battlegrounds + if (memberscount > bgEntry->MaxGroupSize) // no MinPlayerCount for battlegrounds return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side // get a player as reference, to compare other players' stats to (arena team id, queue id based on level, etc.) @@ -2002,7 +2002,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (member->GetTeam() != team) return ERR_BATTLEGROUND_JOIN_TIMED_OUT; // not in the same battleground level braket, don't let join - PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId, member->GetLevel()); + PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->MapID, member->GetLevel()); if (memberBracketEntry != bracketEntry) return ERR_BATTLEGROUND_JOIN_RANGE_INDEX; // don't let join rated matches if the arena team id doesn't match @@ -2132,7 +2132,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) if (method == INSTANCE_RESET_ALL) { // the "reset all instances" method can only reset normal maps - if (entry->map_type == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC) + if (entry->InstanceType == MAP_RAID || diff == DUNGEON_DIFFICULTY_HEROIC) { ++itr; continue; @@ -2184,7 +2184,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) else { WorldSafeLocsEntry const * graveyardLocation = sObjectMgr->GetClosestGraveyard(instanceEntrance->target_X, instanceEntrance->target_Y, instanceEntrance->target_Z, instanceEntrance->target_mapId, SendMsgTo->GetTeam()); - uint32 const zoneId = sMapMgr->GetZoneId(PHASEMASK_NORMAL, graveyardLocation->map_id, graveyardLocation->x, graveyardLocation->y, graveyardLocation->z); + uint32 const zoneId = sMapMgr->GetZoneId(PHASEMASK_NORMAL, graveyardLocation->Continent, graveyardLocation->Loc.X, graveyardLocation->Loc.Y, graveyardLocation->Loc.Z); for (MemberSlot const& member : GetMemberSlots()) { @@ -2192,11 +2192,11 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) { CharacterDatabasePreparedStatement*stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_POSITION_BY_MAPID); - stmt->setFloat(0, graveyardLocation->x); - stmt->setFloat(1, graveyardLocation->y); - stmt->setFloat(2, graveyardLocation->z); + stmt->setFloat(0, graveyardLocation->Loc.X); + stmt->setFloat(1, graveyardLocation->Loc.Y); + stmt->setFloat(2, graveyardLocation->Loc.Z); stmt->setFloat(3, instanceEntrance->target_Orientation); - stmt->setUInt32(4, graveyardLocation->map_id); + stmt->setUInt32(4, graveyardLocation->Continent); stmt->setUInt32(5, zoneId); stmt->setUInt32(6, member.guid.GetCounter()); stmt->setUInt32(7, map->GetId()); @@ -2251,7 +2251,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) return nullptr; Difficulty difficulty = GetDifficulty(mapEntry->IsRaid()); - return GetBoundInstance(difficulty, mapEntry->MapID); + return GetBoundInstance(difficulty, mapEntry->ID); } InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId) diff --git a/src/server/game/Groups/GroupMgr.cpp b/src/server/game/Groups/GroupMgr.cpp index 1889b205dac..00065aba6aa 100644 --- a/src/server/game/Groups/GroupMgr.cpp +++ b/src/server/game/Groups/GroupMgr.cpp @@ -243,7 +243,7 @@ void GroupMgr::LoadGroups() diff = 0; // default for both difficaly types } - InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), fields[6].GetUInt64() == 0, true); + InstanceSave* save = sInstanceSaveMgr->AddInstanceSave(mapEntry->ID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt32()), fields[6].GetUInt64() == 0, true); group->BindToInstance(save, fields[3].GetBool(), true); ++count; } diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 7e0f5a0890f..bcd9091acfe 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -70,7 +70,7 @@ void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit) WorldPacket data(MSG_AUCTION_HELLO, 12); data << uint64(guid); - data << uint32(ahEntry->houseId); + data << uint32(ahEntry->ID); data << uint8(1); // 3.3.3: 1 - AH enabled, 0 - AH disabled SendPacket(&data); } @@ -286,7 +286,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) } AuctionHouseEntry const* AHEntry = sAuctionMgr->GetAuctionHouseEntry(auctioneerInfo->faction); - AH->houseId = AHEntry->houseId; + AH->houseId = AHEntry->ID; } // Required stack size of auction matches to current item stack size, just move item to auctionhouse diff --git a/src/server/game/Handlers/BankHandler.cpp b/src/server/game/Handlers/BankHandler.cpp index f1710f8131a..62f0b445f6c 100644 --- a/src/server/game/Handlers/BankHandler.cpp +++ b/src/server/game/Handlers/BankHandler.cpp @@ -162,7 +162,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPackets::Bank::BuyBankSlot& buyB return; } - uint32 price = slotEntry->price; + uint32 price = slotEntry->Cost; if (!_player->HasEnoughMoney(price)) { diff --git a/src/server/game/Handlers/CalendarHandler.cpp b/src/server/game/Handlers/CalendarHandler.cpp index 9e4fb8256c2..2b74c625338 100644 --- a/src/server/game/Handlers/CalendarHandler.cpp +++ b/src/server/game/Handlers/CalendarHandler.cpp @@ -157,7 +157,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/) { HolidaysEntry const* holiday = sHolidaysStore.LookupEntry(entry); - data << uint32(holiday->Id); // m_ID + data << uint32(holiday->ID); // m_ID data << uint32(holiday->Region); // m_region, might be looping data << uint32(holiday->Looping); // m_looping, might be region data << uint32(holiday->Priority); // m_priority diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 81e107f2db3..e935fb8847e 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -324,17 +324,17 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData) } // prevent character creating Expansion race without Expansion account - if (raceEntry->expansion > Expansion()) + if (raceEntry->RequiredExpansion > Expansion()) { - TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, createInfo->Race); + TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->RequiredExpansion, createInfo->Race); SendCharCreate(CHAR_CREATE_EXPANSION); return; } // prevent character creating Expansion class without Expansion account - if (classEntry->expansion > Expansion()) + if (classEntry->RequiredExpansion > Expansion()) { - TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, createInfo->Class); + TC_LOG_ERROR("entities.player.cheat", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->RequiredExpansion, createInfo->Class); SendCharCreate(CHAR_CREATE_EXPANSION_CLASS); return; } @@ -813,10 +813,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) if (ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->GetClass())) { - if (cEntry->CinematicSequence) - pCurrChar->SendCinematicStart(cEntry->CinematicSequence); + if (cEntry->CinematicSequenceID) + pCurrChar->SendCinematicStart(cEntry->CinematicSequenceID); else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->GetRace())) - pCurrChar->SendCinematicStart(rEntry->CinematicSequence); + pCurrChar->SendCinematicStart(rEntry->CinematicSequenceID); // send new char string if not empty if (!sWorld->GetNewCharString().empty()) @@ -1279,22 +1279,22 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(Hair); - if (!bs_hair || bs_hair->type != 0 || bs_hair->race != _player->GetRace() || bs_hair->gender != _player->GetNativeGender()) + if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->GetRace() || bs_hair->Sex != _player->GetNativeGender()) return; BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(FacialHair); - if (!bs_facialHair || bs_facialHair->type != 2 || bs_facialHair->race != _player->GetRace() || bs_facialHair->gender != _player->GetNativeGender()) + if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->GetRace() || bs_facialHair->Sex != _player->GetNativeGender()) return; BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(SkinColor); - if (bs_skinColor && (bs_skinColor->type != 3 || bs_skinColor->race != _player->GetRace() || bs_skinColor->gender != _player->GetNativeGender())) + if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->GetRace() || bs_skinColor->Sex != _player->GetNativeGender())) return; if (!Player::ValidateAppearance(_player->GetRace(), _player->GetClass(), _player->GetNativeGender(), - bs_hair->hair_id, Color, _player->GetFaceId(), bs_facialHair->hair_id, - bs_skinColor ? bs_skinColor->hair_id : _player->GetSkinId())) + bs_hair->Data, Color, _player->GetFaceId(), bs_facialHair->Data, + bs_skinColor ? bs_skinColor->Data : _player->GetSkinId())) return; GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f); @@ -1310,7 +1310,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) return; } - uint32 cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor); + uint32 cost = _player->GetBarberShopCost(bs_hair->Data, Color, bs_facialHair->Data, bs_skinColor); // 0 - ok // 1, 3 - not enough money @@ -1326,11 +1326,11 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) _player->ModifyMoney(-int32(cost)); // it isn't free _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost); - _player->SetHairStyleId(uint8(bs_hair->hair_id)); + _player->SetHairStyleId(uint8(bs_hair->Data)); _player->SetHairColorId(uint8(Color)); - _player->SetFacialStyle(uint8(bs_facialHair->hair_id)); + _player->SetFacialStyle(uint8(bs_facialHair->Data)); if (bs_skinColor) - _player->SetSkinId(uint8(bs_skinColor->hair_id)); + _player->SetSkinId(uint8(bs_skinColor->Data)); _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1); @@ -1352,7 +1352,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData) { if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph)) { - _player->RemoveAurasDueToSpell(gp->SpellId); + _player->RemoveAurasDueToSpell(gp->SpellID); _player->SetGlyph(slot, 0); _player->SendTalentsInfoData(false); } @@ -2085,28 +2085,28 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact // new team if (newTeam == ALLIANCE) { - uint32 bitIndex = htitleInfo->bit_index; + uint32 bitIndex = htitleInfo->MaskID; uint32 index = bitIndex / 32; uint32 old_flag = 1 << (bitIndex % 32); - uint32 new_flag = 1 << (atitleInfo->bit_index % 32); + uint32 new_flag = 1 << (atitleInfo->MaskID % 32); if (knownTitles[index] & old_flag) { knownTitles[index] &= ~old_flag; // use index of the new title - knownTitles[atitleInfo->bit_index / 32] |= new_flag; + knownTitles[atitleInfo->MaskID / 32] |= new_flag; } } else { - uint32 bitIndex = atitleInfo->bit_index; + uint32 bitIndex = atitleInfo->MaskID; uint32 index = bitIndex / 32; uint32 old_flag = 1 << (bitIndex % 32); - uint32 new_flag = 1 << (htitleInfo->bit_index % 32); + uint32 new_flag = 1 << (htitleInfo->MaskID % 32); if (knownTitles[index] & old_flag) { knownTitles[index] &= ~old_flag; // use index of the new title - knownTitles[htitleInfo->bit_index / 32] |= new_flag; + knownTitles[htitleInfo->MaskID / 32] |= new_flag; } } @@ -2221,9 +2221,9 @@ void WorldSession::HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic& if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->GetClass())) { - if (classEntry->CinematicSequence) - _player->SendCinematicStart(classEntry->CinematicSequence); + if (classEntry->CinematicSequenceID) + _player->SendCinematicStart(classEntry->CinematicSequenceID); else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->GetRace())) - _player->SendCinematicStart(raceEntry->CinematicSequence); + _player->SendCinematicStart(raceEntry->CinematicSequenceID); } } diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 91475ebbd70..56e4ed2066b 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -632,7 +632,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData) if (!em) return; - uint32 emote_anim = em->textid; + uint32 emote_anim = em->EmoteID; switch (emote_anim) { diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp index 4ed678e6e70..dc0890636fc 100644 --- a/src/server/game/Handlers/CombatHandler.cpp +++ b/src/server/game/Handlers/CombatHandler.cpp @@ -51,7 +51,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPackets::Combat::AttackSwing& pa { VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(_player); ASSERT(seat); - if (!(seat->m_flags & VEHICLE_SEAT_FLAG_CAN_ATTACK)) + if (!(seat->Flags & VEHICLE_SEAT_FLAG_CAN_ATTACK)) { SendAttackStop(enemy); return; diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 2597667afff..8bc95a3f899 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -909,7 +909,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke if (mask & GROUP_UPDATE_FLAG_VEHICLE_SEAT) { if (Vehicle* veh = player->GetVehicle()) - *data << uint32(veh->GetVehicleInfo()->m_seatID[player->m_movementInfo.transport.seat]); + *data << uint32(veh->GetVehicleInfo()->SeatID[player->m_movementInfo.transport.seat]); else *data << uint32(0); } @@ -1046,7 +1046,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData) data.put<uint64>(maskPos, petAuraMask); // GROUP_UPDATE_FLAG_PET_AURAS if (updateFlags & GROUP_UPDATE_FLAG_VEHICLE_SEAT) - data << uint32(player->GetVehicle()->GetVehicleInfo()->m_seatID[player->m_movementInfo.transport.seat]); + data << uint32(player->GetVehicle()->GetVehicleInfo()->SeatID[player->m_movementInfo.transport.seat]); SendPacket(&data); } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index f0b2c072a53..b813798b219 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -991,11 +991,11 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) } // tried to put normal gem in meta socket - if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->color != SOCKET_COLOR_META) + if (itemProto->Socket[i].Color == SOCKET_COLOR_META && GemProps[i]->Type != SOCKET_COLOR_META) return; // tried to put meta gem in normal socket - if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->color == SOCKET_COLOR_META) + if (itemProto->Socket[i].Color != SOCKET_COLOR_META && GemProps[i]->Type == SOCKET_COLOR_META) return; } @@ -1003,7 +1003,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) uint32 OldEnchants[MAX_GEM_SOCKETS]; for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments { - GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0; + GemEnchants[i] = (GemProps[i]) ? GemProps[i]->EnchantID : 0; OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i)); } @@ -1036,7 +1036,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j])) { - if (iGemProto->ItemId == enchantEntry->GemID) + if (iGemProto->ItemId == enchantEntry->SrcItemID) { _player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, nullptr); return; @@ -1052,7 +1052,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { if (ItemLimitCategoryEntry const* limitEntry = sItemLimitCategoryStore.LookupEntry(iGemProto->ItemLimitCategory)) { - // NOTE: limitEntry->mode is not checked because if item has limit then it is applied in equip case + // NOTE: limitEntry->Flags is not checked because if item has limit then it is applied in equip case for (int j = 0; j < MAX_GEM_SOCKETS; ++j) { if (Gems[j]) @@ -1065,13 +1065,13 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { // existing gem if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j])) - if (ItemTemplate const* jProto = sObjectMgr->GetItemTemplate(enchantEntry->GemID)) + if (ItemTemplate const* jProto = sObjectMgr->GetItemTemplate(enchantEntry->SrcItemID)) if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory) ++limit_newcount; } } - if (limit_newcount > 0 && uint32(limit_newcount) > limitEntry->maxCount) + if (limit_newcount > 0 && uint32(limit_newcount) > limitEntry->Quantity) { _player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, nullptr); return; diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 7daa8d78584..7e2963a93fa 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -746,7 +746,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket& recvData) { MailTemplateEntry const* mailTemplateEntry = sMailTemplateStore.LookupEntry(m->mailTemplateId); ASSERT(mailTemplateEntry); - bodyItem->SetText(mailTemplateEntry->content[GetSessionDbcLocale()]); + bodyItem->SetText(mailTemplateEntry->Body[GetSessionDbcLocale()]); } else bodyItem->SetText(m->body); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 2ca5646a813..324d5701939 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -310,7 +310,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData) std::string aname; if (AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(playerZoneId)) - aname = areaEntry->area_name[GetSessionDbcLocale()]; + aname = areaEntry->AreaName[GetSessionDbcLocale()]; bool s_show = true; for (uint32 i = 0; i < strCount; ++i) @@ -642,7 +642,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) if (sObjectMgr->IsTavernAreaTrigger(triggerId)) { // set resting flag we are in the inn - player->SetRestFlag(REST_FLAG_IN_TAVERN, atEntry->id); + player->SetRestFlag(REST_FLAG_IN_TAVERN, atEntry->ID); if (sWorld->IsFFAPvPRealm()) player->RemoveByteFlag(UNIT_FIELD_BYTES_2, UNIT_BYTES_2_OFFSET_PVP_FLAG, UNIT_BYTE2_FLAG_FFA_PVP); @@ -679,7 +679,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) case Map::CANNOT_ENTER_DIFFICULTY_UNAVAILABLE: TC_LOG_DEBUG("maps", "MAP: Player '%s' attempted to enter instance map %d but the requested difficulty was not found", player->GetName().c_str(), at->target_mapId); if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId)) - player->SendTransferAborted(entry->MapID, TRANSFER_ABORT_DIFFICULTY, player->GetDifficulty(entry->IsRaid())); + player->SendTransferAborted(entry->ID, TRANSFER_ABORT_DIFFICULTY, player->GetDifficulty(entry->IsRaid())); break; case Map::CANNOT_ENTER_NOT_IN_RAID: { @@ -701,7 +701,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) case Map::CANNOT_ENTER_INSTANCE_BIND_MISMATCH: if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId)) { - char const* mapName = entry->name[player->GetSession()->GetSessionDbcLocale()]; + char const* mapName = entry->MapName[player->GetSession()->GetSessionDbcLocale()]; TC_LOG_DEBUG("maps", "MAP: Player '%s' cannot enter instance map '%s' because their permanent bind is incompatible with their group's", player->GetName().c_str(), mapName); // is there a special opcode for this? // @todo figure out how to get player localized difficulty string (e.g. "10 player", "Heroic" etc) @@ -1470,7 +1470,7 @@ void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recvData*/) } AreaTableEntry const* atEntry = sAreaTableStore.LookupEntry(_player->GetAreaId()); - if (!atEntry || !(atEntry->flags & AREA_FLAG_WINTERGRASP_2)) + if (!atEntry || !(atEntry->Flags & AREA_FLAG_WINTERGRASP_2)) return; _player->BuildPlayerRepop(); diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 9314fb82449..5570958551e 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -149,7 +149,7 @@ void WorldSession::HandleMoveWorldportAck() // resurrect character at enter into instance where his corpse exist after add to map if (mEntry->IsDungeon() && !player->IsAlive()) { - if (player->GetCorpseLocation().GetMapId() == mEntry->MapID) + if (player->GetCorpseLocation().GetMapId() == mEntry->ID) { player->ResurrectPlayer(0.5f); player->SpawnCorpseBones(); @@ -161,14 +161,14 @@ void WorldSession::HandleMoveWorldportAck() { // check if this instance has a reset time and send it to player if so Difficulty diff = player->GetDifficulty(mEntry->IsRaid()); - if (MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->MapID, diff)) + if (MapDifficulty const* mapDiff = GetMapDifficultyData(mEntry->ID, diff)) { if (mapDiff->resetTime) { - if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->MapID, diff)) + if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(mEntry->ID, diff)) { uint32 timeleft = uint32(timeReset - GameTime::GetGameTime()); - player->SendInstanceResetWarning(mEntry->MapID, diff, timeleft, true); + player->SendInstanceResetWarning(mEntry->ID, diff, timeleft, true); } } } @@ -393,7 +393,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData) { if (VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(mover)) { - if (seat->m_flags & VEHICLE_SEAT_FLAG_ALLOW_TURNING) + if (seat->Flags & VEHICLE_SEAT_FLAG_ALLOW_TURNING) { if (movementInfo.pos.GetOrientation() != mover->GetOrientation()) { diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index f25efb18b70..dc9581b7dc2 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -234,7 +234,7 @@ void WorldSession::SendSpiritResurrect() _player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeam()); if (corpseGrave != ghostGrave) - _player->TeleportTo(corpseGrave->map_id, corpseGrave->x, corpseGrave->y, corpseGrave->z, _player->GetOrientation()); + _player->TeleportTo(corpseGrave->Continent, corpseGrave->Loc.X, corpseGrave->Loc.Y, corpseGrave->Loc.Z, _player->GetOrientation()); } } @@ -546,10 +546,10 @@ void WorldSession::HandleBuyStableSlot(WorldPacket& recvData) if (GetPlayer()->m_stableSlots < MAX_PET_STABLES) { StableSlotPricesEntry const* SlotPrice = sStableSlotPricesStore.LookupEntry(GetPlayer()->m_stableSlots+1); - if (_player->HasEnoughMoney(SlotPrice->Price)) + if (_player->HasEnoughMoney(SlotPrice->Cost)) { ++GetPlayer()->m_stableSlots; - _player->ModifyMoney(-int32(SlotPrice->Price)); + _player->ModifyMoney(-int32(SlotPrice->Cost)); SendPetStableResult(STABLE_SUCCESS_BUY_SLOT); } else diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index 4f9dbd3c0ef..bfa7119f8e5 100644 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -164,14 +164,14 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recvData*/) // search entrance map for proper show entrance if (MapEntry const* corpseMapEntry = sMapStore.LookupEntry(mapID)) { - if (corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0) + if (corpseMapEntry->IsDungeon() && corpseMapEntry->CorpseMapID >= 0) { // if corpse map have entrance - if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->entrance_map)) + if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->CorpseMapID)) { - mapID = corpseMapEntry->entrance_map; - x = corpseMapEntry->entrance_x; - y = corpseMapEntry->entrance_y; + mapID = corpseMapEntry->CorpseMapID; + x = corpseMapEntry->Corpse.X; + y = corpseMapEntry->Corpse.Y; z = entranceMap->GetHeight(GetPlayer()->GetPhaseMask(), x, y, MAX_HEIGHT); } } diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 2160a73c6b2..2d077ed1527 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -221,7 +221,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) TaxiNodesEntry const* curDestNode = sTaxiNodesStore.LookupEntry(curDest); // far teleport case - if (curDestNode && curDestNode->map_id != GetPlayer()->GetMapId() && GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) + if (curDestNode && curDestNode->ContinentID != GetPlayer()->GetMapId() && GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) { if (FlightPathMovementGenerator* flight = dynamic_cast<FlightPathMovementGenerator*>(GetPlayer()->GetMotionMaster()->GetCurrentMovementGenerator())) { @@ -230,7 +230,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) TaxiPathNodeEntry const* node = flight->GetPath()[flight->GetCurrentNode()]; flight->SkipCurrentNode(); - GetPlayer()->TeleportTo(curDestNode->map_id, node->LocX, node->LocY, node->LocZ, GetPlayer()->GetOrientation()); + GetPlayer()->TeleportTo(curDestNode->ContinentID, node->Loc.X, node->Loc.Y, node->Loc.Z, GetPlayer()->GetOrientation()); } } diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index 220cab6d6c3..ba3a2605d00 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -65,7 +65,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recvData) { recvData.rfinish(); // prevent warnings spam TC_LOG_ERROR("network", "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %s tried to switch seats but current seatflags %u don't permit that.", - recvData.GetOpcode(), GetPlayer()->GetGUID().ToString().c_str(), seat->m_flags); + recvData.GetOpcode(), GetPlayer()->GetGUID().ToString().c_str(), seat->Flags); return; } @@ -199,7 +199,7 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/) GetPlayer()->ExitVehicle(); else TC_LOG_ERROR("network", "Player %s tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.", - GetPlayer()->GetGUID().ToString().c_str(), seat->m_ID, seat->m_flags); + GetPlayer()->GetGUID().ToString().c_str(), seat->ID, seat->Flags); } } } diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 6fc7f499ccf..542085c3bf5 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -101,7 +101,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance { // initialize reset time // for normal instances if no creatures are killed the instance will reset in two hours - if (entry->map_type == MAP_RAID || difficulty > DUNGEON_DIFFICULTY_NORMAL) + if (entry->InstanceType == MAP_RAID || difficulty > DUNGEON_DIFFICULTY_NORMAL) resetTime = GetResetTimeFor(mapId, difficulty); else { @@ -222,7 +222,7 @@ time_t InstanceSave::GetResetTimeForDB() { // only save the reset time for normal instances MapEntry const* entry = sMapStore.LookupEntry(GetMapId()); - if (!entry || entry->map_type == MAP_RAID || GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC) + if (!entry || entry->InstanceType == MAP_RAID || GetDifficulty() == DUNGEON_DIFFICULTY_HEROIC) return 0; else return GetResetTime(); @@ -630,7 +630,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, b MapEntry const* mapEntry = sMapStore.LookupEntry(mapid); if (!mapEntry->Instanceable()) return; - TC_LOG_DEBUG("misc", "InstanceSaveManager::ResetOrWarnAll: Processing map %s (%u) on difficulty %u (warn? %u)", mapEntry->name[0], mapid, uint8(difficulty), warn); + TC_LOG_DEBUG("misc", "InstanceSaveManager::ResetOrWarnAll: Processing map %s (%u) on difficulty %u (warn? %u)", mapEntry->MapName[0], mapid, uint8(difficulty), warn); time_t now = GameTime::GetGameTime(); diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 34b1c3a1221..1302028313c 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -742,11 +742,11 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi { if (encounter->creditType == type && encounter->creditEntry == creditEntry) { - completedEncounters |= 1 << encounter->dbcEntry->encounterIndex; + completedEncounters |= 1 << encounter->dbcEntry->Bit; if (encounter->lastEncounterDungeon) { dungeonId = encounter->lastEncounterDungeon; - TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->encounterName[0], dungeonId); + TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->Name[0], dungeonId); break; } } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index bc23cc3ec5f..3b5d31af057 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2352,23 +2352,23 @@ inline ZLiquidStatus GridMap::GetLiquidStatus(float x, float y, float z, uint8 R if (LiquidTypeEntry const* liquidEntry = sLiquidTypeStore.LookupEntry(entry)) { type &= MAP_LIQUID_TYPE_DARK_WATER; - uint32 liqTypeIdx = liquidEntry->Type; + uint32 liqTypeIdx = liquidEntry->SoundBank; if (entry < 21) { if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(getArea(x, y))) { - uint32 overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; - if (!overrideLiquid && area->zone) + uint32 overrideLiquid = area->LiquidTypeID[liquidEntry->SoundBank]; + if (!overrideLiquid && area->ParentAreaID) { - area = sAreaTableStore.LookupEntry(area->zone); + area = sAreaTableStore.LookupEntry(area->ParentAreaID); if (area) - overrideLiquid = area->LiquidTypeOverride[liquidEntry->Type]; + overrideLiquid = area->LiquidTypeID[liquidEntry->SoundBank]; } if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid)) { entry = overrideLiquid; - liqTypeIdx = liq->Type; + liqTypeIdx = liq->SoundBank; } } } @@ -2589,7 +2589,7 @@ uint32 Map::GetAreaId(uint32 phaseMask, float x, float y, float z) const { // wmo found if (WMOAreaTableEntry const* wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId)) - areaId = wmoEntry->areaId; + areaId = wmoEntry->AreaTableID; if (!areaId) areaId = gridAreaId; @@ -2598,7 +2598,7 @@ uint32 Map::GetAreaId(uint32 phaseMask, float x, float y, float z) const areaId = gridAreaId; if (!areaId) - areaId = i_mapEntry->linked_zone; + areaId = i_mapEntry->AreaTableID; return areaId; } @@ -2607,8 +2607,8 @@ uint32 Map::GetZoneId(uint32 phaseMask, float x, float y, float z) const { uint32 areaId = GetAreaId(phaseMask, x, y, z); if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId)) - if (area->zone) - return area->zone; + if (area->ParentAreaID) + return area->ParentAreaID; return areaId; } @@ -2617,8 +2617,8 @@ void Map::GetZoneAndAreaId(uint32 phaseMask, uint32& zoneid, uint32& areaid, flo { areaid = zoneid = GetAreaId(phaseMask, x, y, z); if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaid)) - if (area->zone) - zoneid = area->zone; + if (area->ParentAreaID) + zoneid = area->ParentAreaID; } ZLiquidStatus Map::GetLiquidStatus(uint32 phaseMask, float x, float y, float z, uint8 ReqLiquidType, LiquidData* data, float collisionHeight) const @@ -2646,24 +2646,24 @@ ZLiquidStatus Map::GetLiquidStatus(uint32 phaseMask, float x, float y, float z, uint32 liquidFlagType = 0; if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquid_type)) - liquidFlagType = liq->Type; + liquidFlagType = liq->SoundBank; if (liquid_type && liquid_type < 21) { if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(GetAreaId(phaseMask, x, y, z))) { - uint32 overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; - if (!overrideLiquid && area->zone) + uint32 overrideLiquid = area->LiquidTypeID[liquidFlagType]; + if (!overrideLiquid && area->ParentAreaID) { - area = sAreaTableStore.LookupEntry(area->zone); + area = sAreaTableStore.LookupEntry(area->ParentAreaID); if (area) - overrideLiquid = area->LiquidTypeOverride[liquidFlagType]; + overrideLiquid = area->LiquidTypeID[liquidFlagType]; } if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(overrideLiquid)) { liquid_type = overrideLiquid; - liquidFlagType = liq->Type; + liquidFlagType = liq->SoundBank; } } } @@ -2765,7 +2765,7 @@ void Map::GetFullTerrainStatusForPosition(uint32 phaseMask, float x, float y, fl data.outdoors = (wmoData->areaInfo->mogpFlags & 0x8) != 0; if (wmoEntry) { - data.areaId = wmoEntry->areaId; + data.areaId = wmoEntry->AreaTableID; if (wmoEntry->Flags & 4) data.outdoors = true; else if (wmoEntry->Flags & 2) @@ -2783,11 +2783,11 @@ void Map::GetFullTerrainStatusForPosition(uint32 phaseMask, float x, float y, fl data.outdoors = true; data.areaId = gridAreaId; if (AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(data.areaId)) - data.outdoors = (areaEntry->flags & (AREA_FLAG_INSIDE | AREA_FLAG_OUTSIDE)) != AREA_FLAG_INSIDE; + data.outdoors = (areaEntry->Flags & (AREA_FLAG_INSIDE | AREA_FLAG_OUTSIDE)) != AREA_FLAG_INSIDE; } if (!data.areaId) - data.areaId = i_mapEntry->linked_zone; + data.areaId = i_mapEntry->AreaTableID; AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(data.areaId); @@ -2801,22 +2801,22 @@ void Map::GetFullTerrainStatusForPosition(uint32 phaseMask, float x, float y, fl uint32 liquidFlagType = 0; if (LiquidTypeEntry const* liquidData = sLiquidTypeStore.LookupEntry(liquidType)) - liquidFlagType = liquidData->Type; + liquidFlagType = liquidData->SoundBank; if (liquidType && liquidType < 21 && areaEntry) { - uint32 overrideLiquid = areaEntry->LiquidTypeOverride[liquidFlagType]; - if (!overrideLiquid && areaEntry->zone) + uint32 overrideLiquid = areaEntry->LiquidTypeID[liquidFlagType]; + if (!overrideLiquid && areaEntry->ParentAreaID) { - AreaTableEntry const* zoneEntry = sAreaTableStore.LookupEntry(areaEntry->zone); + AreaTableEntry const* zoneEntry = sAreaTableStore.LookupEntry(areaEntry->ParentAreaID); if (zoneEntry) - overrideLiquid = zoneEntry->LiquidTypeOverride[liquidFlagType]; + overrideLiquid = zoneEntry->LiquidTypeID[liquidFlagType]; } if (LiquidTypeEntry const* overrideData = sLiquidTypeStore.LookupEntry(overrideLiquid)) { liquidType = overrideLiquid; - liquidFlagType = overrideData->Type; + liquidFlagType = overrideData->SoundBank; } } @@ -2915,7 +2915,7 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const char const* Map::GetMapName() const { - return i_mapEntry ? i_mapEntry->name[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; + return i_mapEntry ? i_mapEntry->MapName[sWorld->GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; } void Map::SendInitSelf(Player* player) @@ -4140,7 +4140,7 @@ MapDifficulty const* Map::GetMapDifficulty() const uint32 Map::GetId() const { - return i_mapEntry->MapID; + return i_mapEntry->ID; } bool Map::IsRegularDifficulty() const @@ -4219,7 +4219,7 @@ uint32 InstanceMap::GetMaxPlayers() const if (mapDiff && mapDiff->maxPlayers) return mapDiff->maxPlayers; - return GetEntry()->maxPlayers; + return GetEntry()->MaxPlayers; } uint32 InstanceMap::GetMaxResetDelay() const diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 49166dc44b5..ae023f153bb 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -252,7 +252,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun uint8 spawnMode; if (bracketEntry) - spawnMode = bracketEntry->difficulty; + spawnMode = bracketEntry->Difficulty; else spawnMode = REGULAR_DIFFICULTY; diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 81fe7e32bb2..f3330d0a3db 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -139,7 +139,7 @@ Map::EnterState MapManager::PlayerCannotEnter(uint32 mapid, Player* player, bool Difficulty targetDifficulty, requestedDifficulty; targetDifficulty = requestedDifficulty = player->GetDifficulty(entry->IsRaid()); // Get the highest available difficulty if current setting is higher than the instance allows - MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(entry->MapID, targetDifficulty); + MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(entry->ID, targetDifficulty); if (!mapDiff) return Map::CANNOT_ENTER_DIFFICULTY_UNAVAILABLE; @@ -151,7 +151,7 @@ Map::EnterState MapManager::PlayerCannotEnter(uint32 mapid, Player* player, bool if (!player->Satisfy(sObjectMgr->GetAccessRequirement(mapid, targetDifficulty), mapid, true)) return Map::CANNOT_ENTER_UNSPECIFIED_REASON; - char const* mapName = entry->name[player->GetSession()->GetSessionDbcLocale()]; + char const* mapName = entry->MapName[player->GetSession()->GetSessionDbcLocale()]; Group* group = player->GetGroup(); if (entry->IsRaid()) // can only enter in a raid group diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp index 56a23a5c9bb..37ca7fcd7c0 100644 --- a/src/server/game/Maps/TransportMgr.cpp +++ b/src/server/game/Maps/TransportMgr.cpp @@ -95,11 +95,11 @@ void TransportMgr::LoadTransportAnimationAndRotation() { for (uint32 i = 0; i < sTransportAnimationStore.GetNumRows(); ++i) if (TransportAnimationEntry const* anim = sTransportAnimationStore.LookupEntry(i)) - AddPathNodeToTransport(anim->TransportEntry, anim->TimeSeg, anim); + AddPathNodeToTransport(anim->TransportID, anim->TimeIndex, anim); for (uint32 i = 0; i < sTransportRotationStore.GetNumRows(); ++i) if (TransportRotationEntry const* rot = sTransportRotationStore.LookupEntry(i)) - AddPathRotationToTransport(rot->TransportEntry, rot->TimeSeg, rot); + AddPathRotationToTransport(rot->GameObjectsID, rot->TimeIndex, rot); } class SplineRawInitializer @@ -127,7 +127,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl Movement::PointsArray splinePath, allPoints; bool mapChange = false; for (size_t i = 0; i < path.size(); ++i) - allPoints.push_back(G3D::Vector3(path[i]->LocX, path[i]->LocY, path[i]->LocZ)); + allPoints.push_back(G3D::Vector3(path[i]->Loc.X, path[i]->Loc.Y, path[i]->Loc.Z)); // Add extra points to allow derivative calculations for all path nodes allPoints.insert(allPoints.begin(), allPoints.front().lerp(allPoints[1], -0.2f)); @@ -144,7 +144,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl if (!mapChange) { TaxiPathNodeEntry const* node_i = path[i]; - if (i != path.size() - 1 && (node_i->Flags & 1 || node_i->MapID != path[i + 1]->MapID)) + if (i != path.size() - 1 && (node_i->Flags & 1 || node_i->ContinentID != path[i + 1]->ContinentID)) { keyFrames.back().Teleport = true; mapChange = true; @@ -157,8 +157,8 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl k.InitialOrientation = Position::NormalizeOrientation(std::atan2(h.y, h.x) + float(M_PI)); keyFrames.push_back(k); - splinePath.push_back(G3D::Vector3(node_i->LocX, node_i->LocY, node_i->LocZ)); - transport->mapsUsed.insert(k.Node->MapID); + splinePath.push_back(G3D::Vector3(node_i->Loc.X, node_i->Loc.Y, node_i->Loc.Z)); + transport->mapsUsed.insert(k.Node->ContinentID); } } else @@ -389,10 +389,10 @@ Transport* TransportMgr::CreateTransport(uint32 entry, ObjectGuid::LowType guid // ...at first waypoint TaxiPathNodeEntry const* startNode = tInfo->keyFrames.begin()->Node; - uint32 mapId = startNode->MapID; - float x = startNode->LocX; - float y = startNode->LocY; - float z = startNode->LocZ; + uint32 mapId = startNode->ContinentID; + float x = startNode->Loc.X; + float y = startNode->Loc.Y; + float z = startNode->Loc.Z; float o = tInfo->keyFrames.begin()->InitialOrientation; // initialize the gameobject base diff --git a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp index 21ae1a4abd7..218454f1c29 100644 --- a/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FlightPathMovementGenerator.cpp @@ -52,9 +52,9 @@ MovementGeneratorType FlightPathMovementGenerator::GetMovementGeneratorType() co bool FlightPathMovementGenerator::GetResetPosition(Unit* /*owner*/, float& x, float& y, float& z) { TaxiPathNodeEntry const* node = _path[_currentNode]; - x = node->LocX; - y = node->LocY; - z = node->LocZ; + x = node->Loc.X; + y = node->Loc.Y; + z = node->Loc.Z; return true; } @@ -88,7 +88,7 @@ void FlightPathMovementGenerator::DoReset(Player* owner) init.Path().push_back(G3D::Vector3(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ())); for (uint32 i = currentNodeId; i != end; ++i) { - G3D::Vector3 vertice(_path[i]->LocX, _path[i]->LocY, _path[i]->LocZ); + G3D::Vector3 vertice(_path[i]->Loc.X, _path[i]->Loc.Y, _path[i]->Loc.Z); init.Path().push_back(vertice); } init.SetFirstPointId(GetCurrentNode()); @@ -168,8 +168,8 @@ void FlightPathMovementGenerator::DoFinalize(Player* owner, bool active, bool/* // When the player reaches the last flight point, teleport to destination taxi node location if (TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(taxiNodeId)) { - owner->SetFallInformation(0, node->z); - owner->TeleportTo(node->map_id, node->x, node->y, node->z, owner->GetOrientation()); + owner->SetFallInformation(0, node->Pos.Z); + owner->TeleportTo(node->ContinentID, node->Pos.X, node->Pos.Y, node->Pos.Z, owner->GetOrientation()); } } @@ -181,10 +181,10 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const if (_currentNode >= _path.size()) return _path.size(); - uint32 curMapId = _path[_currentNode]->MapID; + uint32 curMapId = _path[_currentNode]->ContinentID; for (uint32 itr = _currentNode; itr < _path.size(); ++itr) { - if (_path[itr]->MapID != curMapId) + if (_path[itr]->ContinentID != curMapId) return itr; } @@ -193,7 +193,7 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const bool IsNodeIncludedInShortenedPath(TaxiPathNodeEntry const* p1, TaxiPathNodeEntry const* p2) { - return p1->MapID != p2->MapID || std::pow(p1->LocX - p2->LocX, 2) + std::pow(p1->LocY - p2->LocY, 2) > SKIP_SPLINE_POINT_DISTANCE_SQ; + return p1->ContinentID != p2->ContinentID || std::pow(p1->Loc.X - p2->Loc.X, 2) + std::pow(p1->Loc.Y - p2->Loc.Y, 2) > SKIP_SPLINE_POINT_DISTANCE_SQ; } void FlightPathMovementGenerator::LoadPath(Player* owner) @@ -242,10 +242,10 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() if (_path.empty() || _currentNode >= _path.size()) return; - uint32 map0 = _path[_currentNode]->MapID; + uint32 map0 = _path[_currentNode]->ContinentID; for (size_t i = _currentNode + 1; i < _path.size(); ++i) { - if (_path[i]->MapID != map0) + if (_path[i]->ContinentID != map0) { _currentNode = i; return; @@ -272,13 +272,13 @@ void FlightPathMovementGenerator::InitEndGridInfo() */ uint32 nodeCount = _path.size(); //! Number of nodes in path. ASSERT(nodeCount, "FlightPathMovementGenerator::InitEndGridInfo() called with empty _path"); - _endMapId = _path[nodeCount - 1]->MapID; //! MapId of last node + _endMapId = _path[nodeCount - 1]->ContinentID; //! MapId of last node if (nodeCount < 3) _preloadTargetNode = 0; else _preloadTargetNode = nodeCount - 3; - _endGridX = _path[nodeCount - 1]->LocX; - _endGridY = _path[nodeCount - 1]->LocY; + _endGridX = _path[nodeCount - 1]->Loc.X; + _endGridY = _path[nodeCount - 1]->Loc.Y; } void FlightPathMovementGenerator::PreloadEndGrid() diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index aa2a8346e4f..cc7e30c1213 100644 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -658,7 +658,7 @@ void OutdoorPvP::BroadcastWorker(Worker& _worker, uint32 zoneId) void OutdoorPvP::SetMapFromZone(uint32 zone) { AreaTableEntry const* areaTable = sAreaTableStore.AssertEntry(zone); - Map* map = sMapMgr->CreateBaseMap(areaTable->mapid); + Map* map = sMapMgr->CreateBaseMap(areaTable->ContinentID); ASSERT(!map->Instanceable()); m_map = map; } diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 7170597cfa8..1e0d30a6fe8 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -214,10 +214,10 @@ uint32 Quest::GetXPReward(Player const* player) const else if (diffFactor > 10) diffFactor = 10; - uint32 xp = RoundXPValue(diffFactor * xpentry->Exp[_rewardXPDifficulty] / 10); + uint32 xp = RoundXPValue(diffFactor * xpentry->Difficulty[_rewardXPDifficulty] / 10); if (sWorld->getIntConfig(CONFIG_MIN_QUEST_SCALED_XP_RATIO)) { - uint32 minScaledXP = RoundXPValue(xpentry->Exp[_rewardXPDifficulty]) * sWorld->getIntConfig(CONFIG_MIN_QUEST_SCALED_XP_RATIO) / 100; + uint32 minScaledXP = RoundXPValue(xpentry->Difficulty[_rewardXPDifficulty]) * sWorld->getIntConfig(CONFIG_MIN_QUEST_SCALED_XP_RATIO) / 100; xp = std::max(minScaledXP, xp); } @@ -310,7 +310,7 @@ uint32 Quest::CalculateHonorGain(uint8 level) const if (!tc) return 0; - honor = uint32(tc->value * GetRewHonorMultiplier() * 0.1f); + honor = uint32(tc->Data * GetRewHonorMultiplier() * 0.1f); honor += GetRewHonorAddition(); } diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 32be8bfc6c9..bd371fb5111 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -103,16 +103,16 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const uint32 classMask = _player->GetClassMask(); for (int i=0; i < 4; i++) { - if ((factionEntry->BaseRepRaceMask[i] & raceMask || - (factionEntry->BaseRepRaceMask[i] == 0 && - factionEntry->BaseRepClassMask[i] != 0)) && - (factionEntry->BaseRepClassMask[i] & classMask || - factionEntry->BaseRepClassMask[i] == 0)) + if ((factionEntry->ReputationRaceMask[i] & raceMask || + (factionEntry->ReputationRaceMask[i] == 0 && + factionEntry->ReputationClassMask[i] != 0)) && + (factionEntry->ReputationClassMask[i] & classMask || + factionEntry->ReputationClassMask[i] == 0)) - return factionEntry->BaseRepValue[i]; + return factionEntry->ReputationBase[i]; } - // in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i] == 0 + // in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all ReputationRaceMask[i] == 0 return 0; } @@ -157,11 +157,11 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con uint32 classMask = _player->GetClassMask(); for (int i=0; i < 4; i++) { - if ((factionEntry->BaseRepRaceMask[i] & raceMask || - (factionEntry->BaseRepRaceMask[i] == 0 && - factionEntry->BaseRepClassMask[i] != 0)) && - (factionEntry->BaseRepClassMask[i] & classMask || - factionEntry->BaseRepClassMask[i] == 0)) + if ((factionEntry->ReputationRaceMask[i] & raceMask || + (factionEntry->ReputationRaceMask[i] == 0 && + factionEntry->ReputationClassMask[i] != 0)) && + (factionEntry->ReputationClassMask[i] & classMask || + factionEntry->ReputationClassMask[i] == 0)) return factionEntry->ReputationFlags[i]; } @@ -277,11 +277,11 @@ void ReputationMgr::Initialize() { FactionEntry const* factionEntry = sFactionStore.LookupEntry(i); - if (factionEntry && (factionEntry->reputationListID >= 0)) + if (factionEntry && (factionEntry->ReputationIndex >= 0)) { FactionState newFaction; newFaction.ID = factionEntry->ID; - newFaction.ReputationListID = factionEntry->reputationListID; + newFaction.ReputationListID = factionEntry->ReputationIndex; newFaction.Standing = 0; newFaction.Flags = GetDefaultStateFlags(factionEntry); newFaction.needSend = true; @@ -323,12 +323,12 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi // check for sub-factions that receive spillover SimpleFactionsList const* flist = GetFactionTeamList(factionEntry->ID); // if has no sub-factions, check for factions with same parent - if (!flist && factionEntry->team && factionEntry->spilloverRateOut != 0.0f) + if (!flist && factionEntry->ParentFactionID && factionEntry->ParentFactionMod[1] != 0.0f) { - spillOverRepOut *= factionEntry->spilloverRateOut; - if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->team)) + spillOverRepOut *= factionEntry->ParentFactionMod[1]; + if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->ParentFactionID)) { - FactionStateList::iterator parentState = _factions.find(parent->reputationListID); + FactionStateList::iterator parentState = _factions.find(parent->ReputationIndex); // some team factions have own reputation standing, in this case do not spill to other sub-factions if (parentState != _factions.end() && (parentState->second.Flags & FACTION_FLAG_SPECIAL)) { @@ -336,7 +336,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi } else // spill to "sister" factions { - flist = GetFactionTeamList(factionEntry->team); + flist = GetFactionTeamList(factionEntry->ParentFactionID); } } } @@ -347,9 +347,9 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi { if (FactionEntry const* factionEntryCalc = sFactionStore.LookupEntry(*itr)) { - if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->spilloverMaxRankIn)) + if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->ParentFactionCap[0])) continue; - int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn); + int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->ParentFactionMod[0]); if (spilloverRep != 0 || !incremental) res = SetOneFactionReputation(factionEntryCalc, spilloverRep, incremental); } @@ -358,7 +358,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi } // spillover done, update faction itself - FactionStateList::iterator faction = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator faction = _factions.find(factionEntry->ReputationIndex); if (faction != _factions.end()) { // if we update spillover only, do not update main reputation (rank exceeds creature reward rate) @@ -373,7 +373,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental) { - FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex); if (itr != _factions.end()) { int32 BaseRep = GetBaseReputation(factionEntry); @@ -421,21 +421,21 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry) { - if (!factionTemplateEntry->faction) + if (!factionTemplateEntry->Faction) return; - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction)) // Never show factions of the opposing team - if (!(factionEntry->BaseRepRaceMask[1] & _player->GetRaceMask() && factionEntry->BaseRepValue[1] == Reputation_Bottom)) + if (!(factionEntry->ReputationRaceMask[1] & _player->GetRaceMask() && factionEntry->ReputationBase[1] == Reputation_Bottom)) SetVisible(factionEntry); } void ReputationMgr::SetVisible(FactionEntry const* factionEntry) { - if (factionEntry->reputationListID < 0) + if (factionEntry->ReputationIndex < 0) return; - FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex); if (itr == _factions.end()) return; @@ -536,9 +536,9 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result) Field* fields = result->Fetch(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt16()); - if (factionEntry && (factionEntry->reputationListID >= 0)) + if (factionEntry && (factionEntry->ReputationIndex >= 0)) { - FactionState* faction = &_factions[factionEntry->reputationListID]; + FactionState* faction = &_factions[factionEntry->ReputationIndex]; // update standing to current faction->Standing = fields[1].GetInt32(); diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index f64706f66b2..d73ee7c7fe1 100644 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -85,7 +85,7 @@ class TC_GAME_API ReputationMgr FactionState const* GetState(FactionEntry const* factionEntry) const { - return factionEntry->CanHaveReputation() ? GetState(factionEntry->reputationListID) : nullptr; + return factionEntry->CanHaveReputation() ? GetState(factionEntry->ReputationIndex) : nullptr; } FactionState const* GetState(RepListID id) const @@ -111,7 +111,7 @@ class TC_GAME_API ReputationMgr ReputationRank const* GetForcedRankIfAny(FactionTemplateEntry const* factionTemplateEntry) const { - ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->faction); + ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->Faction); return forceItr != _forcedReactions.end() ? &forceItr->second : nullptr; } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 972f9cedbba..438befef440 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1381,7 +1381,7 @@ void ScriptMgr::OnGroupRateCalculation(float& rate, uint32 count, bool isRaid) MapEntry const* C = I->second->GetEntry(); \ if (!C) \ continue; \ - if (C->MapID == V->GetId()) \ + if (C->ID == V->GetId()) \ { #define SCR_MAP_END \ @@ -1596,7 +1596,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger) ASSERT(player); ASSERT(trigger); - GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->id), tmpscript, false); + GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->ID), tmpscript, false); return tmpscript->OnTrigger(player, trigger); } @@ -2228,7 +2228,7 @@ AreaTriggerScript::AreaTriggerScript(char const* name) bool OnlyOnceAreaTriggerScript::OnTrigger(Player* player, AreaTriggerEntry const* trigger) { - uint32 const triggerId = trigger->id; + uint32 const triggerId = trigger->ID; if (InstanceScript* instance = player->GetInstanceScript()) { if (instance->IsAreaTriggerDone(triggerId)) @@ -2239,7 +2239,7 @@ bool OnlyOnceAreaTriggerScript::OnTrigger(Player* player, AreaTriggerEntry const return _OnTrigger(player, trigger); } void OnlyOnceAreaTriggerScript::ResetAreaTriggerDone(InstanceScript* script, uint32 triggerId) { script->ResetAreaTriggerDone(triggerId); } -void OnlyOnceAreaTriggerScript::ResetAreaTriggerDone(Player const* player, AreaTriggerEntry const* trigger) { if (InstanceScript* instance = player->GetInstanceScript()) ResetAreaTriggerDone(instance, trigger->id); } +void OnlyOnceAreaTriggerScript::ResetAreaTriggerDone(Player const* player, AreaTriggerEntry const* trigger) { if (InstanceScript* instance = player->GetInstanceScript()) ResetAreaTriggerDone(instance, trigger->ID); } BattlefieldScript::BattlefieldScript(char const* name) : ScriptObject(name) diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 256e818de5f..6c3cf1b43ff 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -920,7 +920,7 @@ void WorldSession::ReadMovementInfo(WorldPacket &data, MovementInfo* mi) mi->RemoveMovementFlag((maskToRemove)); #endif - if (!GetPlayer()->GetVehicleBase() || !(GetPlayer()->GetVehicle()->GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION)) + if (!GetPlayer()->GetVehicleBase() || !(GetPlayer()->GetVehicle()->GetVehicleInfo()->Flags & VEHICLE_FLAG_FIXED_POSITION)) REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_ROOT), MOVEMENTFLAG_ROOT); /*! This must be a packet spoofing attempt. MOVEMENTFLAG_ROOT sent from the client is not valid diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index f1a13fac9a8..42010144859 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -122,7 +122,7 @@ void LoadSkillDiscoveryTable() } for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - SkillDiscoveryStore[-int32(_spell_idx->second->skillId)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance)); + SkillDiscoveryStore[-int32(_spell_idx->second->SkillLine)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance)); } else { @@ -164,7 +164,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) return 0; SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); - uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : uint32(0); + uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->SkillLine) : uint32(0); float full_chance = 0; for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3b0d337f52a..6079fec3948 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -439,13 +439,13 @@ int32 AuraEffect::CalculateAmount(Unit* caster) { for (uint8 k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) { - if (SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k])) + if (SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k])) { for (uint8 t = 0; t < MAX_ITEM_ENCHANTMENT_EFFECTS; ++t) { - if (pEnchant->spellid[t] == m_spellInfo->Id) + if (pEnchant->EffectArg[t] == m_spellInfo->Id) { - amount = uint32((item_rand_suffix->prefix[k] * castItem->GetItemSuffixFactor()) / 10000); + amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000); break; } } @@ -1168,12 +1168,12 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const { if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId)) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellID); if (!spellInfo || !(spellInfo->HasAttribute(SPELL_ATTR0_PASSIVE) || spellInfo->HasAttribute(SPELL_ATTR0_HIDDEN_CLIENTSIDE))) continue; if (spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1))) - target->CastSpell(target, glyph->SpellId, this); + target->CastSpell(target, glyph->SpellID, this); } } } @@ -1887,17 +1887,17 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo if (target->GetTypeId() == TYPEID_PLAYER) { - SpellShapeshiftEntry const* shapeInfo = sSpellShapeshiftStore.LookupEntry(form); + SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form); ASSERT(shapeInfo); // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook for (uint8 i = 0; i<MAX_SHAPESHIFT_SPELLS; ++i) { - if (!shapeInfo->stanceSpell[i]) + if (!shapeInfo->PresetSpellID[i]) continue; if (apply) - target->ToPlayer()->AddTemporarySpell(shapeInfo->stanceSpell[i]); + target->ToPlayer()->AddTemporarySpell(shapeInfo->PresetSpellID[i]); else - target->ToPlayer()->RemoveTemporarySpell(shapeInfo->stanceSpell[i]); + target->ToPlayer()->RemoveTemporarySpell(shapeInfo->PresetSpellID[i]); } } } @@ -4973,7 +4973,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m target->SetUInt16Value(PLAYER_FIELD_BYTES2, PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET, overrideId); if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId)) for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i) - if (uint32 spellId = overrideSpells->spellId[i]) + if (uint32 spellId = overrideSpells->Spells[i]) target->AddTemporarySpell(spellId); } else @@ -4981,7 +4981,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m target->SetUInt16Value(PLAYER_FIELD_BYTES2, PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET, 0); if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId)) for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i) - if (uint32 spellId = overrideSpells->spellId[i]) + if (uint32 spellId = overrideSpells->Spells[i]) target->RemoveTemporarySpell(spellId); } } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c63299f2c81..bf749102080 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4387,12 +4387,12 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo) { if (ItemEntry const* itemEntry = sItemStore.LookupEntry(item_id)) { - if (itemEntry->Class == ITEM_CLASS_WEAPON) + if (itemEntry->ClassID == ITEM_CLASS_WEAPON) { - switch (itemEntry->SubClass) + switch (itemEntry->SubclassID) { case ITEM_SUBCLASS_WEAPON_THROWN: - ammoDisplayID = itemEntry->DisplayId; + ammoDisplayID = itemEntry->DisplayInfoID; ammoInventoryType = itemEntry->InventoryType; break; case ITEM_SUBCLASS_WEAPON_BOW: @@ -4405,7 +4405,7 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo) ammoInventoryType = INVTYPE_AMMO; break; default: - nonRangedAmmoDisplayID = itemEntry->DisplayId; + nonRangedAmmoDisplayID = itemEntry->DisplayInfoID; nonRangedAmmoInventoryType = itemEntry->InventoryType; break; } @@ -4960,7 +4960,7 @@ void Spell::TakeRunePower(bool didHit) // you can gain some runic power when use runes if (didHit) - if (int32 rp = int32(runeCostData->runePowerGain * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME))) + if (int32 rp = int32(runeCostData->RunicPower * sWorld->getRate(RATE_POWER_RUNICPOWER_INCOME))) player->ModifyPower(POWER_RUNIC_POWER, int32(rp)); } @@ -5523,7 +5523,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint uint32 glyphId = m_spellInfo->Effects[i].MiscValue; if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyphId)) - if (m_caster->ToPlayer()->HasAura(gp->SpellId)) + if (m_caster->ToPlayer()->HasAura(gp->SpellID)) return SPELL_FAILED_UNIQUE_GLYPH; break; } @@ -5714,7 +5714,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint if (!SummonProperties) break; - switch (SummonProperties->Category) + switch (SummonProperties->Control) { case SUMMON_CATEGORY_PET: if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && unitCaster->GetPetGUID()) @@ -5995,7 +5995,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint { Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId()); if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(m_originalCaster->GetAreaId())) - if (area->flags & AREA_FLAG_NO_FLY_ZONE || (Bf && !Bf->CanFlyIn())) + if (area->Flags & AREA_FLAG_NO_FLY_ZONE || (Bf && !Bf->CanFlyIn())) return SPELL_FAILED_NOT_HERE; } break; @@ -6395,7 +6395,7 @@ SpellCastResult Spell::CheckRange(bool strict) const std::tie(minRange, maxRange) = GetMinMaxRange(strict); // dont check max_range to strictly after cast - if (m_spellInfo->RangeEntry && m_spellInfo->RangeEntry->type != SPELL_RANGE_MELEE && !strict) + if (m_spellInfo->RangeEntry && m_spellInfo->RangeEntry->Flags != SPELL_RANGE_MELEE && !strict) maxRange += std::min(MAX_SPELL_RANGE_TOLERANCE, maxRange*0.1f); // 10% but no more than MAX_SPELL_RANGE_TOLERANCE // get square values for sqr distance checks @@ -6446,7 +6446,7 @@ std::pair<float, float> Spell::GetMinMaxRange(bool strict) const if (m_spellInfo->RangeEntry) { Unit* target = m_targets.GetUnitTarget(); - if (m_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE) + if (m_spellInfo->RangeEntry->Flags & SPELL_RANGE_MELEE) { // when the target is not a unit, take the caster's combat reach as the target's combat reach. if (unitCaster) @@ -6455,7 +6455,7 @@ std::pair<float, float> Spell::GetMinMaxRange(bool strict) const else { float meleeRange = 0.0f; - if (m_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED) + if (m_spellInfo->RangeEntry->Flags & SPELL_RANGE_RANGED) { // when the target is not a unit, take the caster's combat reach as the target's combat reach. if (unitCaster) @@ -6469,13 +6469,13 @@ std::pair<float, float> Spell::GetMinMaxRange(bool strict) const { rangeMod = m_caster->GetCombatReach() + (target ? target->GetCombatReach() : m_caster->GetCombatReach()); - if (minRange > 0.0f && !(m_spellInfo->RangeEntry->type & SPELL_RANGE_RANGED)) + if (minRange > 0.0f && !(m_spellInfo->RangeEntry->Flags & SPELL_RANGE_RANGED)) minRange += rangeMod; } } if (target && unitCaster && unitCaster->isMoving() && target->isMoving() && !unitCaster->IsWalking() && !target->IsWalking() && - ((m_spellInfo->RangeEntry->type & SPELL_RANGE_MELEE) || target->GetTypeId() == TYPEID_PLAYER)) + ((m_spellInfo->RangeEntry->Flags & SPELL_RANGE_MELEE) || target->GetTypeId() == TYPEID_PLAYER)) rangeMod += 8.0f / 3.0f; } @@ -6816,7 +6816,7 @@ SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 / { for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s) { - switch (enchantEntry->type[s]) + switch (enchantEntry->Effect[s]) { case ITEM_ENCHANTMENT_TYPE_USE_SPELL: if (isItemUsable) @@ -6842,7 +6842,7 @@ SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 / { if (!enchantEntry) return SPELL_FAILED_ERROR; - if (enchantEntry->slot & ENCHANTMENT_CAN_SOULBOUND) + if (enchantEntry->Flags & ENCHANTMENT_CAN_SOULBOUND) return SPELL_FAILED_NOT_TRADEABLE; } break; @@ -6859,7 +6859,7 @@ SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 / SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if (!pEnchant) return SPELL_FAILED_ERROR; - if (pEnchant->slot & ENCHANTMENT_CAN_SOULBOUND) + if (pEnchant->Flags & ENCHANTMENT_CAN_SOULBOUND) return SPELL_FAILED_NOT_TRADEABLE; } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e8defc90144..dc3b265297c 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2040,7 +2040,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) // however so far noone found a generic check to find all of those (there's no related data in summonproperties.dbc // and in spell attributes, possibly we need to add a table for those) // so here's a list of MiscValueB values, which is currently most generic check - switch (properties->Id) + switch (properties->ID) { case 64: case 61: @@ -2064,7 +2064,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) break; } - switch (properties->Category) + switch (properties->Control) { case SUMMON_CATEGORY_WILD: case SUMMON_CATEGORY_ALLY: @@ -2076,7 +2076,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) break; } - switch (properties->Type) + switch (properties->Title) { case SUMMON_TYPE_PET: case SUMMON_TYPE_GUARDIAN: @@ -2148,7 +2148,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) if (!summon) continue; - if (properties->Category == SUMMON_CATEGORY_ALLY) + if (properties->Control == SUMMON_CATEGORY_ALLY) { summon->SetOwnerGUID(caster->GetGUID()); summon->SetFaction(caster->GetFaction()); @@ -2464,12 +2464,12 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) if (!rcEntry) return; - SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTier); + SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTierID); if (!tier) return; uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid); - unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max<uint16>(skillval, 1), tier->MaxSkill[damage - 1]); + unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max<uint16>(skillval, 1), tier->Value[damage - 1]); } void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) @@ -2604,7 +2604,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) bool add_socket = false; for (uint8 i = 0; i < MAX_ITEM_ENCHANTMENT_EFFECTS; ++i) { - if (enchant->type[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET) + if (enchant->Effect[i] == ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET) { add_socket = true; break; @@ -3608,14 +3608,14 @@ void Spell::EffectDuel(SpellEffIndex effIndex) // Players can only fight a duel in zones with this flag AreaTableEntry const* casterAreaEntry = sAreaTableStore.LookupEntry(caster->GetAreaId()); - if (casterAreaEntry && !(casterAreaEntry->flags & AREA_FLAG_ALLOW_DUELS)) + if (casterAreaEntry && !(casterAreaEntry->Flags & AREA_FLAG_ALLOW_DUELS)) { SendCastResult(SPELL_FAILED_NO_DUELING); // Dueling isn't allowed here return; } AreaTableEntry const* targetAreaEntry = sAreaTableStore.LookupEntry(target->GetAreaId()); - if (targetAreaEntry && !(targetAreaEntry->flags & AREA_FLAG_ALLOW_DUELS)) + if (targetAreaEntry && !(targetAreaEntry->Flags & AREA_FLAG_ALLOW_DUELS)) { SendCastResult(SPELL_FAILED_NO_DUELING); // Dueling isn't allowed here return; @@ -3785,7 +3785,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) { if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex))) { - if (gp->TypeFlags != gs->TypeFlags) + if (gp->GlyphSlotFlags != gs->Type) { SendCastResult(SPELL_FAILED_INVALID_GLYPH); return; // glyph slot mismatch @@ -3797,12 +3797,12 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex) { if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) { - player->RemoveAurasDueToSpell(old_gp->SpellId); + player->RemoveAurasDueToSpell(old_gp->SpellID); player->SetGlyph(m_glyphIndex, 0); } } - player->CastSpell(player, gp->SpellId, true); + player->CastSpell(player, gp->SpellID, true); player->SetGlyph(m_glyphIndex, glyph); player->SendTalentsInfoData(false); } @@ -5226,7 +5226,7 @@ void Spell::SummonGuardian(uint32 i, uint32 entry, SummonPropertiesEntry const* if (summon->HasUnitTypeMask(UNIT_MASK_GUARDIAN)) ((Guardian*)summon)->InitStatsForLevel(level); - if (properties && properties->Category == SUMMON_CATEGORY_ALLY) + if (properties && properties->Control == SUMMON_CATEGORY_ALLY) summon->SetFaction(unitCaster->GetFaction()); if (summon->HasUnitTypeMask(UNIT_MASK_MINION) && m_targets.HasDst()) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 5e227bca7cc..d88e3755a32 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -331,22 +331,22 @@ SpellEffectInfo::SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* _spellInfo = spellInfo; _effIndex = effIndex; Effect = spellEntry->Effect[effIndex]; - ApplyAuraName = spellEntry->EffectApplyAuraName[effIndex]; + ApplyAuraName = spellEntry->EffectAura[effIndex]; Amplitude = spellEntry->EffectAmplitude[effIndex]; DieSides = spellEntry->EffectDieSides[effIndex]; RealPointsPerLevel = spellEntry->EffectRealPointsPerLevel[effIndex]; BasePoints = spellEntry->EffectBasePoints[effIndex]; - PointsPerComboPoint = spellEntry->EffectPointsPerComboPoint[effIndex]; - ValueMultiplier = spellEntry->EffectValueMultiplier[effIndex]; - DamageMultiplier = spellEntry->EffectDamageMultiplier[effIndex]; - BonusMultiplier = spellEntry->EffectBonusMultiplier[effIndex]; + PointsPerComboPoint = spellEntry->EffectPointsPerCombo[effIndex]; + ValueMultiplier = spellEntry->EffectAmplitude[effIndex]; + DamageMultiplier = spellEntry->EffectChainAmplitude[effIndex]; + BonusMultiplier = spellEntry->EffectBonusCoefficient[effIndex]; MiscValue = spellEntry->EffectMiscValue[effIndex]; MiscValueB = spellEntry->EffectMiscValueB[effIndex]; Mechanic = Mechanics(spellEntry->EffectMechanic[effIndex]); TargetA = SpellImplicitTargetInfo(spellEntry->EffectImplicitTargetA[effIndex]); TargetB = SpellImplicitTargetInfo(spellEntry->EffectImplicitTargetB[effIndex]); RadiusEntry = spellEntry->EffectRadiusIndex[effIndex] ? sSpellRadiusStore.LookupEntry(spellEntry->EffectRadiusIndex[effIndex]) : nullptr; - ChainTarget = spellEntry->EffectChainTarget[effIndex]; + ChainTarget = spellEntry->EffectChainTargets[effIndex]; ItemType = spellEntry->EffectItemType[effIndex]; TriggerSpell = spellEntry->EffectTriggerSpell[effIndex]; SpellClassMask = spellEntry->EffectSpellClassMask[effIndex]; @@ -497,7 +497,7 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32 GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.LookupEntry(_spellInfo->SpellLevel - 1); GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(casterUnit->GetLevel() - 1); if (spellScaler && casterScaler) - value *= casterScaler->ratio / spellScaler->ratio; + value *= casterScaler->Data / spellScaler->Data; } } } @@ -541,7 +541,7 @@ float SpellEffectInfo::CalcRadius(WorldObject* caster /*= nullptr*/, Spell* spel if (!HasRadius()) return 0.0f; - float radius = RadiusEntry->RadiusMin; + float radius = RadiusEntry->Radius; if (caster) { if (Unit* casterUnit = caster->ToUnit()) @@ -767,33 +767,33 @@ SpellEffectInfo::StaticData SpellEffectInfo::_data[TOTAL_SPELL_EFFECTS] = SpellInfo::SpellInfo(SpellEntry const* spellEntry) { - Id = spellEntry->Id; + Id = spellEntry->ID; CategoryEntry = spellEntry->Category ? sSpellCategoryStore.LookupEntry(spellEntry->Category) : nullptr; - Dispel = spellEntry->Dispel; + Dispel = spellEntry->DispelType; Mechanic = spellEntry->Mechanic; Attributes = spellEntry->Attributes; AttributesEx = spellEntry->AttributesEx; - AttributesEx2 = spellEntry->AttributesEx2; - AttributesEx3 = spellEntry->AttributesEx3; - AttributesEx4 = spellEntry->AttributesEx4; - AttributesEx5 = spellEntry->AttributesEx5; - AttributesEx6 = spellEntry->AttributesEx6; - AttributesEx7 = spellEntry->AttributesEx7; + AttributesEx2 = spellEntry->AttributesExB; + AttributesEx3 = spellEntry->AttributesExC; + AttributesEx4 = spellEntry->AttributesExD; + AttributesEx5 = spellEntry->AttributesExE; + AttributesEx6 = spellEntry->AttributesExF; + AttributesEx7 = spellEntry->AttributesExG; AttributesCu = 0; - Stances = MAKE_PAIR64(spellEntry->Stances[0], spellEntry->Stances[1]); - StancesNot = MAKE_PAIR64(spellEntry->StancesNot[0], spellEntry->StancesNot[1]); + Stances = MAKE_PAIR64(spellEntry->ShapeshiftMask[0], spellEntry->ShapeshiftMask[1]); + StancesNot = MAKE_PAIR64(spellEntry->ShapeshiftExclude[0], spellEntry->ShapeshiftExclude[1]); Targets = spellEntry->Targets; TargetCreatureType = spellEntry->TargetCreatureType; RequiresSpellFocus = spellEntry->RequiresSpellFocus; FacingCasterFlags = spellEntry->FacingCasterFlags; CasterAuraState = spellEntry->CasterAuraState; TargetAuraState = spellEntry->TargetAuraState; - CasterAuraStateNot = spellEntry->CasterAuraStateNot; - TargetAuraStateNot = spellEntry->TargetAuraStateNot; - CasterAuraSpell = spellEntry->casterAuraSpell; - TargetAuraSpell = spellEntry->targetAuraSpell; - ExcludeCasterAuraSpell = spellEntry->excludeCasterAuraSpell; - ExcludeTargetAuraSpell = spellEntry->excludeTargetAuraSpell; + CasterAuraStateNot = spellEntry->ExcludeCasterAuraState; + TargetAuraStateNot = spellEntry->ExcludeTargetAuraState; + CasterAuraSpell = spellEntry->CasterAuraSpell; + TargetAuraSpell = spellEntry->TargetAuraSpell; + ExcludeCasterAuraSpell = spellEntry->ExcludeCasterAuraSpell; + ExcludeTargetAuraSpell = spellEntry->ExcludeTargetAuraSpell; CastTimeEntry = spellEntry->CastingTimeIndex ? sSpellCastTimesStore.LookupEntry(spellEntry->CastingTimeIndex) : nullptr; RecoveryTime = spellEntry->RecoveryTime; CategoryRecoveryTime = spellEntry->CategoryRecoveryTime; @@ -802,23 +802,23 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) InterruptFlags = spellEntry->InterruptFlags; AuraInterruptFlags = spellEntry->AuraInterruptFlags; ChannelInterruptFlags = spellEntry->ChannelInterruptFlags; - ProcFlags = spellEntry->procFlags; - ProcChance = spellEntry->procChance; - ProcCharges = spellEntry->procCharges; - MaxLevel = spellEntry->maxLevel; - BaseLevel = spellEntry->baseLevel; - SpellLevel = spellEntry->spellLevel; + ProcFlags = spellEntry->ProcTypeMask; + ProcChance = spellEntry->ProcChance; + ProcCharges = spellEntry->ProcCharges; + MaxLevel = spellEntry->MaxLevel; + BaseLevel = spellEntry->BaseLevel; + SpellLevel = spellEntry->SpellLevel; DurationEntry = spellEntry->DurationIndex ? sSpellDurationStore.LookupEntry(spellEntry->DurationIndex) : nullptr; - PowerType = static_cast<Powers>(spellEntry->powerType); - ManaCost = spellEntry->manaCost; - ManaCostPerlevel = spellEntry->manaCostPerlevel; - ManaPerSecond = spellEntry->manaPerSecond; - ManaPerSecondPerLevel = spellEntry->manaPerSecondPerLevel; - ManaCostPercentage = spellEntry->ManaCostPercentage; - RuneCostID = spellEntry->runeCostID; - RangeEntry = spellEntry->rangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->rangeIndex) : nullptr; - Speed = spellEntry->speed; - StackAmount = spellEntry->StackAmount; + PowerType = static_cast<Powers>(spellEntry->PowerType); + ManaCost = spellEntry->ManaCost; + ManaCostPerlevel = spellEntry->ManaCostPerLevel; + ManaPerSecond = spellEntry->ManaPerSecond; + ManaPerSecondPerLevel = spellEntry->ManaPerSecondPerLevel; + ManaCostPercentage = spellEntry->ManaCostPct; + RuneCostID = spellEntry->RuneCostID; + RangeEntry = spellEntry->RangeIndex ? sSpellRangeStore.LookupEntry(spellEntry->RangeIndex) : nullptr; + Speed = spellEntry->Speed; + StackAmount = spellEntry->CumulativeAura; for (uint8 i = 0; i < 2; ++i) Totem[i] = spellEntry->Totem[i]; @@ -829,30 +829,30 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) ReagentCount[i] = spellEntry->ReagentCount[i]; EquippedItemClass = spellEntry->EquippedItemClass; - EquippedItemSubClassMask = spellEntry->EquippedItemSubClassMask; - EquippedItemInventoryTypeMask = spellEntry->EquippedItemInventoryTypeMask; + EquippedItemSubClassMask = spellEntry->EquippedItemSubclass; + EquippedItemInventoryTypeMask = spellEntry->EquippedItemInvTypes; for (uint8 i = 0; i < 2; ++i) - TotemCategory[i] = spellEntry->TotemCategory[i]; + TotemCategory[i] = spellEntry->RequiredTotemCategoryID[i]; for (uint8 i = 0; i < 2; ++i) - SpellVisual[i] = spellEntry->SpellVisual[i]; + SpellVisual[i] = spellEntry->SpellVisualID[i]; SpellIconID = spellEntry->SpellIconID; - ActiveIconID = spellEntry->activeIconID; + ActiveIconID = spellEntry->ActiveIconID; Priority = spellEntry->SpellPriority; for (uint8 i = 0; i < 16; ++i) - SpellName[i] = spellEntry->SpellName[i]; + SpellName[i] = spellEntry->Name[i]; for (uint8 i = 0; i < 16; ++i) - Rank[i] = spellEntry->Rank[i]; + Rank[i] = spellEntry->NameSubtext[i]; MaxTargetLevel = spellEntry->MaxTargetLevel; - MaxAffectedTargets = spellEntry->MaxAffectedTargets; - SpellFamilyName = spellEntry->SpellFamilyName; - SpellFamilyFlags = spellEntry->SpellFamilyFlags; - DmgClass = spellEntry->DmgClass; + MaxAffectedTargets = spellEntry->MaxTargets; + SpellFamilyName = spellEntry->SpellClassSet; + SpellFamilyFlags = spellEntry->SpellClassMask; + DmgClass = spellEntry->DefenseType; PreventionType = spellEntry->PreventionType; - AreaGroupId = spellEntry->AreaGroupId; + AreaGroupId = spellEntry->RequiredAreasID; SchoolMask = spellEntry->SchoolMask; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) Effects[i] = SpellEffectInfo(spellEntry, this, i); @@ -873,7 +873,7 @@ SpellInfo::~SpellInfo() uint32 SpellInfo::GetCategory() const { - return CategoryEntry ? CategoryEntry->Id : 0; + return CategoryEntry ? CategoryEntry->ID : 0; } bool SpellInfo::HasEffect(SpellEffects effect) const @@ -1003,10 +1003,10 @@ bool SpellInfo::IsAbilityLearnedWithProfession() const for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { SkillLineAbilityEntry const* pAbility = _spell_idx->second; - if (!pAbility || pAbility->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) + if (!pAbility || pAbility->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) continue; - if (pAbility->req_skill_value > 0) + if (pAbility->MinSkillLineRank > 0) return true; } @@ -1018,7 +1018,7 @@ bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - if (_spell_idx->second->skillId == uint32(skillType)) + if (_spell_idx->second->SkillLine == uint32(skillType)) return true; return false; @@ -1461,16 +1461,16 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const return SPELL_CAST_OK; bool actAsShifted = false; - SpellShapeshiftEntry const* shapeInfo = nullptr; + SpellShapeshiftFormEntry const* shapeInfo = nullptr; if (form > 0) { - shapeInfo = sSpellShapeshiftStore.LookupEntry(form); + shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form); if (!shapeInfo) { TC_LOG_ERROR("spells", "GetErrorAtShapeshiftedCast: unknown shapeshift %u", form); return SPELL_CAST_OK; } - actAsShifted = !(shapeInfo->flags1 & 1); // shapeshift acts as normal form for spells + actAsShifted = !(shapeInfo->Flags & 1); // shapeshift acts as normal form for spells } if (actAsShifted) @@ -1490,7 +1490,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const // Check if stance disables cast of not-stance spells // Example: cannot cast any other spells in zombie or ghoul form /// @todo Find a way to disable use of these spells clientside - if (shapeInfo && shapeInfo->flags1 & 0x400) + if (shapeInfo && shapeInfo->Flags & 0x400) { if (!(stanceMask & Stances)) return SPELL_FAILED_ONLY_SHAPESHIFT; @@ -1509,12 +1509,12 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a while (groupEntry) { for (uint8 i = 0; i < MAX_GROUP_AREA_IDS; ++i) - if (groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id) + if (groupEntry->AreaID[i] == zone_id || groupEntry->AreaID[i] == area_id) found = true; - if (found || !groupEntry->nextGroup) + if (found || !groupEntry->NextAreaID) break; // Try search in next group - groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup); + groupEntry = sAreaGroupStore.LookupEntry(groupEntry->NextAreaID); } if (!found) @@ -1826,8 +1826,8 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const { if (Effects[effIndex].ApplyAuraName == SPELL_AURA_MOD_SHAPESHIFT) { - SpellShapeshiftEntry const* shapeShiftEntry = sSpellShapeshiftStore.LookupEntry(Effects[effIndex].MiscValue); - if (shapeShiftEntry && (shapeShiftEntry->flags1 & 1) == 0) // unk flag + SpellShapeshiftFormEntry const* shapeShiftEntry = sSpellShapeshiftFormStore.LookupEntry(Effects[effIndex].MiscValue); + if (shapeShiftEntry && (shapeShiftEntry->Flags & 1) == 0) // unk flag checkMask |= VEHICLE_SEAT_FLAG_UNCONTROLLED; break; } @@ -1841,11 +1841,11 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const VehicleSeatEntry const* vehicleSeat = vehicle->GetSeatForPassenger(caster); if (!HasAttribute(SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_MOUNTED) - && (vehicleSeat->m_flags & checkMask) != checkMask) + && (vehicleSeat->Flags & checkMask) != checkMask) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // Can only summon uncontrolled minions/guardians when on controlled vehicle - if (vehicleSeat->m_flags & (VEHICLE_SEAT_FLAG_CAN_CONTROL | VEHICLE_SEAT_FLAG_UNK2)) + if (vehicleSeat->Flags & (VEHICLE_SEAT_FLAG_CAN_CONTROL | VEHICLE_SEAT_FLAG_UNK2)) { for (uint32 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i) { @@ -1853,7 +1853,7 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const continue; SummonPropertiesEntry const* props = sSummonPropertiesStore.LookupEntry(Effects[i].MiscValueB); - if (props && props->Category != SUMMON_CATEGORY_WILD) + if (props && props->Control != SUMMON_CATEGORY_WILD) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; } } @@ -3053,8 +3053,8 @@ float SpellInfo::GetMinRange(bool positive /*= false*/) const if (!RangeEntry) return 0.0f; if (positive) - return RangeEntry->minRangeFriend; - return RangeEntry->minRangeHostile; + return RangeEntry->RangeMin[1]; + return RangeEntry->RangeMin[0]; } float SpellInfo::GetMaxRange(bool positive /*= false*/, WorldObject* caster /*= nullptr*/, Spell* spell /*= nullptr*/) const @@ -3063,9 +3063,9 @@ float SpellInfo::GetMaxRange(bool positive /*= false*/, WorldObject* caster /*= return 0.0f; float range; if (positive) - range = RangeEntry->maxRangeFriend; + range = RangeEntry->RangeMax[1]; else - range = RangeEntry->maxRangeHostile; + range = RangeEntry->RangeMax[0]; if (caster) if (Player* modOwner = caster->GetSpellModOwner()) modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell); @@ -3077,14 +3077,14 @@ int32 SpellInfo::GetDuration() const { if (!DurationEntry) return IsPassive() ? -1 : 0; - return (DurationEntry->Duration[0] == -1) ? -1 : abs(DurationEntry->Duration[0]); + return (DurationEntry->Duration == -1) ? -1 : abs(DurationEntry->Duration); } int32 SpellInfo::GetMaxDuration() const { if (!DurationEntry) return IsPassive() ? -1 : 0; - return (DurationEntry->Duration[2] == -1) ? -1 : abs(DurationEntry->Duration[2]); + return (DurationEntry->MaxDuration == -1) ? -1 : abs(DurationEntry->MaxDuration); } uint32 SpellInfo::CalcCastTime(Spell* spell /*= nullptr*/) const @@ -3093,7 +3093,7 @@ uint32 SpellInfo::CalcCastTime(Spell* spell /*= nullptr*/) const if (!CastTimeEntry) return 0; - int32 castTime = CastTimeEntry->CastTime; + int32 castTime = CastTimeEntry->Base; if (spell) spell->GetCaster()->ModSpellCastTime(this, castTime, spell); @@ -3207,8 +3207,8 @@ int32 SpellInfo::CalcPowerCost(WorldObject const* caster, SpellSchoolMask school if (HasAttribute(SPELL_ATTR4_SPELL_VS_EXTEND_COST)) { uint32 speed = 0; - if (SpellShapeshiftEntry const* ss = sSpellShapeshiftStore.LookupEntry(unitCaster->GetShapeshiftForm())) - speed = ss->attackSpeed; + if (SpellShapeshiftFormEntry const* ss = sSpellShapeshiftFormStore.LookupEntry(unitCaster->GetShapeshiftForm())) + speed = ss->CombatRoundTime; else speed = unitCaster->GetAttackTime(GetAttackType()); @@ -3226,7 +3226,7 @@ int32 SpellInfo::CalcPowerCost(WorldObject const* caster, SpellSchoolMask school GtNPCManaCostScalerEntry const* spellScaler = sGtNPCManaCostScalerStore.LookupEntry(SpellLevel - 1); GtNPCManaCostScalerEntry const* casterScaler = sGtNPCManaCostScalerStore.LookupEntry(unitCaster->GetLevel() - 1); if (spellScaler && casterScaler) - powerCost *= casterScaler->ratio / spellScaler->ratio; + powerCost *= casterScaler->Data / spellScaler->Data; } } 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; diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index 559bb84fce2..89f6b5a87b2 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -142,7 +142,7 @@ bool CharacterDatabaseCleaner::TalentCheck(uint32 talent_id) if (!talentInfo) return false; - return sTalentTabStore.LookupEntry(talentInfo->TalentTab) != nullptr; + return sTalentTabStore.LookupEntry(talentInfo->TabID) != nullptr; } void CharacterDatabaseCleaner::CleanCharacterTalent() diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 34864e46779..b39b2a84d87 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2221,7 +2221,7 @@ void World::DetectDBCLang() uint8 default_locale = TOTAL_LOCALES; for (uint8 i = default_locale-1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8 { - if (race->name[i][0] != '\0') // check by race names + if (race->Name[i][0] != '\0') // check by race names { default_locale = i; m_availableDbcLocaleMask |= (1 << i); |