diff options
Diffstat (limited to 'src/server')
105 files changed, 2260 insertions, 2238 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); diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 350dbf5169c..cda80c50713 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -281,11 +281,11 @@ public: if (titleInfo && target->HasTitle(titleInfo)) { - std::string name = target->GetNativeGender() == GENDER_MALE ? titleInfo->nameMale[loc] : titleInfo->nameFemale[loc]; + std::string name = target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[loc] : titleInfo->Name1[loc]; if (name.empty()) continue; - char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->MaskID ? handler->GetTrinityString(LANG_ACTIVE) : ""; @@ -294,9 +294,9 @@ public: // send title in "id (idx:idx) - [namedlink locale]" format if (handler->GetSession()) - handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->MaskID, id, titleNameStr, localeNames[loc], knownStr, activeStr); else - handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->MaskID, name.c_str(), localeNames[loc], knownStr, activeStr); } } @@ -650,7 +650,7 @@ public: { FactionState const& faction = itr->second; FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); - char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#"; + char const* factionName = factionEntry ? factionEntry->Name[loc] : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]); std::ostringstream ss; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 4eeae6a9075..177589c6965 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -154,9 +154,9 @@ public: // Dump camera locations - if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->cinematicCamera)) + if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->Camera[0])) { - handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera); + handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->Camera[0]); uint32 count = 1; for (FlyByCamera const& cam : *flyByCameras) { @@ -1665,7 +1665,7 @@ public: } if (!mEntry->IsDungeon()) { - handler->PSendSysMessage("'%s' is not a dungeon map.", mEntry->name[LOCALE_enUS]); + handler->PSendSysMessage("'%s' is not a dungeon map.", mEntry->MapName[LOCALE_enUS]); return true; } int32 difficulty = difficulty_str ? atoi(difficulty_str) : -1; @@ -1674,32 +1674,32 @@ public: handler->PSendSysMessage("Invalid difficulty %d - specify in range [0,%d).", difficulty, MAX_RAID_DIFFICULTY); return false; } - if (difficulty >= 0 && !GetMapDifficultyData(mEntry->MapID, Difficulty(difficulty))) + if (difficulty >= 0 && !GetMapDifficultyData(mEntry->ID, Difficulty(difficulty))) { - handler->PSendSysMessage("Difficulty %d is not valid for '%s'.", difficulty, mEntry->name[LOCALE_enUS]); + handler->PSendSysMessage("Difficulty %d is not valid for '%s'.", difficulty, mEntry->MapName[LOCALE_enUS]); return true; } if (difficulty == -1) { - handler->PSendSysMessage("Resetting all difficulties for '%s'.", mEntry->name[LOCALE_enUS]); + handler->PSendSysMessage("Resetting all difficulties for '%s'.", mEntry->MapName[LOCALE_enUS]); for (uint8 diff = (mEntry->IsRaid() ? 0 : 1); diff < (mEntry->IsRaid() ? MAX_RAID_DIFFICULTY : MAX_DUNGEON_DIFFICULTY); ++diff) { - if (GetMapDifficultyData(mEntry->MapID, Difficulty(diff))) + if (GetMapDifficultyData(mEntry->ID, Difficulty(diff))) { - handler->PSendSysMessage("Resetting difficulty %d for '%s'.", diff, mEntry->name[LOCALE_enUS]); - sInstanceSaveMgr->ForceGlobalReset(mEntry->MapID, Difficulty(diff)); + handler->PSendSysMessage("Resetting difficulty %d for '%s'.", diff, mEntry->MapName[LOCALE_enUS]); + sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(diff)); } } } else if (mEntry->IsNonRaidDungeon() && difficulty == DUNGEON_DIFFICULTY_NORMAL) { - handler->PSendSysMessage("'%s' does not have any permanent saves for difficulty %d.", mEntry->name[LOCALE_enUS], difficulty); + handler->PSendSysMessage("'%s' does not have any permanent saves for difficulty %d.", mEntry->MapName[LOCALE_enUS], difficulty); } else { - handler->PSendSysMessage("Resetting difficulty %d for '%s'.", difficulty, mEntry->name[LOCALE_enUS]); - sInstanceSaveMgr->ForceGlobalReset(mEntry->MapID, Difficulty(difficulty)); + handler->PSendSysMessage("Resetting difficulty %d for '%s'.", difficulty, mEntry->MapName[LOCALE_enUS]); + sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(difficulty)); } return true; } @@ -1767,9 +1767,9 @@ public: for (uint32 i = 0; i < sWorldSafeLocsStore.GetNumRows(); ++i) { WorldSafeLocsEntry const* loc = sWorldSafeLocsStore.LookupEntry(i); - if (loc && loc->map_id == player->GetMapId()) + if (loc && loc->Continent == player->GetMapId()) { - float dist = (loc->x - x) * (loc->x - x) + (loc->y - y) * (loc->y - y) + (loc->z - z) * (loc->z - z); + float dist = (loc->Loc.X - x) * (loc->Loc.X - x) + (loc->Loc.Y - y) * (loc->Loc.Y - y) + (loc->Loc.Z - z) * (loc->Loc.Z - z); if (dist < distNearest) { distNearest = dist; @@ -1780,7 +1780,7 @@ public: } if (nearestLoc) - handler->PSendSysMessage(LANG_COMMAND_NEARGRAVEYARD, nearestLoc->ID, nearestLoc->x, nearestLoc->y, nearestLoc->z); + handler->PSendSysMessage(LANG_COMMAND_NEARGRAVEYARD, nearestLoc->ID, nearestLoc->Loc.X, nearestLoc->Loc.Y, nearestLoc->Loc.Z); else handler->PSendSysMessage(LANG_COMMAND_NEARGRAVEYARD_NOTFOUND); diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 171185428cb..4813f6a91fa 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -192,9 +192,9 @@ public: return false; } - if (!MapManager::IsValidMapCoord(gy->map_id, gy->x, gy->y, gy->z)) + if (!MapManager::IsValidMapCoord(gy->Continent, gy->Loc.X, gy->Loc.Y, gy->Loc.Z)) { - handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->x, gy->y, gy->map_id); + handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->Loc.X, gy->Loc.Y, gy->Continent); handler->SetSentErrorMessage(true); return false; } @@ -206,7 +206,7 @@ public: else player->SaveRecallPosition(); // save only in non-flight case - player->TeleportTo(gy->map_id, gy->x, gy->y, gy->z, player->GetOrientation()); + player->TeleportTo(gy->Continent, gy->Loc.X, gy->Loc.Y, gy->Loc.Z, player->GetOrientation()); return true; } @@ -249,7 +249,7 @@ public: handler->SetSentErrorMessage(true); return false; } - return DoTeleport(handler, { node->x, node->y, node->z }, node->map_id); + return DoTeleport(handler, { node->Pos.X, node->Pos.Y, node->Pos.Z }, node->ContinentID); } static bool HandleGoAreaTriggerCommand(ChatHandler* handler, Variant<Hyperlink<areatrigger>, uint32> areaTriggerId) @@ -261,7 +261,7 @@ public: handler->SetSentErrorMessage(true); return false; } - return DoTeleport(handler, { at->x, at->y, at->z }, at->mapid); + return DoTeleport(handler, { at->Pos.X, at->Pos.Y, at->Pos.Z }, at->ContinentID); } //teleport at coordinates @@ -300,23 +300,23 @@ public: } // update to parent zone if exist (client map show only zones without parents) - AreaTableEntry const* zoneEntry = areaEntry->zone ? sAreaTableStore.LookupEntry(areaEntry->zone) : areaEntry; + AreaTableEntry const* zoneEntry = areaEntry->ParentAreaID ? sAreaTableStore.LookupEntry(areaEntry->ParentAreaID) : areaEntry; ASSERT(zoneEntry); - Map const* map = sMapMgr->CreateBaseMap(zoneEntry->mapid); + Map const* map = sMapMgr->CreateBaseMap(zoneEntry->ContinentID); if (map->Instanceable()) { - handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->area_name[handler->GetSessionDbcLocale()], map->GetId(), map->GetMapName()); + handler->PSendSysMessage(LANG_INVALID_ZONE_MAP, areaEntry->ID, areaEntry->AreaName[handler->GetSessionDbcLocale()], map->GetId(), map->GetMapName()); handler->SetSentErrorMessage(true); return false; } Zone2MapCoordinates(x, y, zoneEntry->ID); - if (!MapManager::IsValidMapCoord(zoneEntry->mapid, x, y)) + if (!MapManager::IsValidMapCoord(zoneEntry->ContinentID, x, y)) { - handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, zoneEntry->mapid); + handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, x, y, zoneEntry->ContinentID); handler->SetSentErrorMessage(true); return false; } @@ -329,7 +329,7 @@ public: float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); - player->TeleportTo(zoneEntry->mapid, x, y, z, player->GetOrientation()); + player->TeleportTo(zoneEntry->ContinentID, x, y, z, player->GetOrientation()); return true; } @@ -402,7 +402,7 @@ public: { uint32 count = 0; std::string const& scriptName = sObjectMgr->GetScriptName(pair.second.ScriptId); - char const* mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(pair.first))->name[handler->GetSessionDbcLocale()]; + char const* mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(pair.first))->MapName[handler->GetSessionDbcLocale()]; for (auto const& label : labels) if (StringContainsStringI(scriptName, label)) ++count; @@ -451,7 +451,7 @@ public: else { uint32 const parentMapId = exit->target_mapId; - char const* const parentMapName = ASSERT_NOTNULL(sMapStore.LookupEntry(parentMapId))->name[handler->GetSessionDbcLocale()]; + char const* const parentMapName = ASSERT_NOTNULL(sMapStore.LookupEntry(parentMapId))->MapName[handler->GetSessionDbcLocale()]; handler->PSendSysMessage(LANG_COMMAND_GO_INSTANCE_GATE_FAILED, mapName, mapId, parentMapName, parentMapId); } } @@ -552,7 +552,7 @@ public: { uint32 const mapId = spawn->mapId; MapEntry const* const map = ASSERT_NOTNULL(sMapStore.LookupEntry(mapId)); - handler->PSendSysMessage(LANG_COMMAND_BOSS_MULTIPLE_SPAWN_ETY, spawn->spawnId, mapId, map->name[handler->GetSessionDbcLocale()], spawn->spawnPoint.ToString().c_str()); + handler->PSendSysMessage(LANG_COMMAND_BOSS_MULTIPLE_SPAWN_ETY, spawn->spawnId, mapId, map->MapName[handler->GetSessionDbcLocale()], spawn->spawnPoint.ToString().c_str()); } handler->SetSentErrorMessage(true); return false; @@ -568,7 +568,7 @@ public: uint32 const mapId = spawn->mapId; if (!player->TeleportTo({ mapId, spawn->spawnPoint })) { - char const* const mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(mapId))->name[handler->GetSessionDbcLocale()]; + char const* const mapName = ASSERT_NOTNULL(sMapStore.LookupEntry(mapId))->MapName[handler->GetSessionDbcLocale()]; handler->PSendSysMessage(LANG_COMMAND_GO_BOSS_FAILED, spawn->spawnId, boss->Name.c_str(), boss->Entry, mapName); handler->SetSentErrorMessage(true); return false; diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 87ec9f2a840..77951531a4b 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -689,7 +689,7 @@ public: handler->PSendSysMessage(LANG_OBJECTINFO_AITYPE, boost::core::demangle(typeid(*ai).name()).c_str()); if (GameObjectDisplayInfoEntry const* modelInfo = sGameObjectDisplayInfoStore.LookupEntry(displayId)) - handler->PSendSysMessage(LANG_GOINFO_MODEL, modelInfo->maxX, modelInfo->maxY, modelInfo->maxZ, modelInfo->minX, modelInfo->minY, modelInfo->minZ); + handler->PSendSysMessage(LANG_GOINFO_MODEL, modelInfo->GeoBoxMax.X, modelInfo->GeoBoxMax.Y, modelInfo->GeoBoxMax.Z, modelInfo->GeoBoxMin.X, modelInfo->GeoBoxMin.Y, modelInfo->GeoBoxMin.Z); return true; } diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp index 4c76a2664f2..ae0c2d302e8 100644 --- a/src/server/scripts/Commands/cs_group.cpp +++ b/src/server/scripts/Commands/cs_group.cpp @@ -423,9 +423,9 @@ public: AreaTableEntry const* area = sAreaTableStore.LookupEntry(p->GetAreaId()); if (area) { - AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->zone); + AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->ParentAreaID); if (zone) - zoneName = zone->area_name[locale]; + zoneName = zone->AreaName[locale]; } } else diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 26759423d26..77c2c4841d9 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -151,7 +151,7 @@ public: ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->GetClass()); if (!classEntry) return true; - uint32 family = classEntry->spellfamily; + uint32 family = classEntry->SpellClassSet; for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i) { @@ -159,7 +159,7 @@ public: if (!entry) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->Spell); if (!spellInfo) continue; @@ -201,7 +201,7 @@ public: if (!talentInfo) continue; - TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); + TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID); if (!talentTabInfo) continue; @@ -212,9 +212,9 @@ public: uint32 spellId = 0; for (int8 rank = MAX_TALENT_RANK - 1; rank >= 0; --rank) { - if (talentInfo->RankID[rank] != 0) + if (talentInfo->SpellRank[rank] != 0) { - spellId = talentInfo->RankID[rank]; + spellId = talentInfo->SpellRank[rank]; break; } } @@ -265,7 +265,7 @@ public: return false; } - if (petFamily->petTalentType < 0) // not hunter pet + if (petFamily->PetTalentType < 0) // not hunter pet { handler->SendSysMessage(LANG_WRONG_PET_TYPE); handler->SetSentErrorMessage(true); @@ -278,12 +278,12 @@ public: if (!talentInfo) continue; - TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab); + TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TabID); if (!talentTabInfo) continue; // prevent learn talent for different family (cheating) - if (((1 << petFamily->petTalentType) & talentTabInfo->petTalentMask) == 0) + if (((1 << petFamily->PetTalentType) & talentTabInfo->CategoryEnumID) == 0) continue; // search highest talent rank @@ -291,9 +291,9 @@ public: for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { - if (talentInfo->RankID[rank] != 0) + if (talentInfo->SpellRank[rank] != 0) { - spellId = talentInfo->RankID[rank]; + spellId = talentInfo->SpellRank[rank]; break; } } @@ -351,10 +351,10 @@ public: if (!skillInfo) continue; - if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) && - skillInfo->canLink) // only prof. with recipes have + if ((skillInfo->CategoryID == SKILL_CATEGORY_PROFESSION || skillInfo->CategoryID == SKILL_CATEGORY_SECONDARY) && + skillInfo->CanLink) // only prof. with recipes have { - HandleLearnSkillRecipesHelper(target, skillInfo->id); + HandleLearnSkillRecipesHelper(target, skillInfo->ID); } } @@ -394,13 +394,13 @@ public: if (!skillInfo) continue; - if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION && - skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) || - !skillInfo->canLink) // only prof with recipes have set + if ((skillInfo->CategoryID != SKILL_CATEGORY_PROFESSION && + skillInfo->CategoryID != SKILL_CATEGORY_SECONDARY) || + !skillInfo->CanLink) // only prof with recipes have set continue; int locale = handler->GetSessionDbcLocale(); - name = skillInfo->name[locale]; + name = skillInfo->DisplayName[locale]; if (name.empty()) continue; @@ -412,7 +412,7 @@ public: if (locale == handler->GetSessionDbcLocale()) continue; - name = skillInfo->name[locale]; + name = skillInfo->DisplayName[locale]; if (name.empty()) continue; @@ -431,10 +431,10 @@ public: if (!targetSkillInfo) return false; - HandleLearnSkillRecipesHelper(target, targetSkillInfo->id); + HandleLearnSkillRecipesHelper(target, targetSkillInfo->ID); - uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->id); - target->SetSkill(targetSkillInfo->id, target->GetSkillStep(targetSkillInfo->id), maxLevel, maxLevel); + uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->ID); + target->SetSkill(targetSkillInfo->ID, target->GetSkillStep(targetSkillInfo->ID), maxLevel, maxLevel); handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str()); return true; } @@ -450,26 +450,26 @@ public: continue; // wrong skill - if (skillLine->skillId != skillId) + if (skillLine->SkillLine != skillId) continue; // not high rank - if (skillLine->forward_spellid) + if (skillLine->SupercededBySpell) continue; // skip racial skills - if (skillLine->racemask != 0) + if (skillLine->RaceMask != 0) continue; // skip wrong class skills - if (skillLine->classmask && (skillLine->classmask & classmask) == 0) + if (skillLine->ClassMask && (skillLine->ClassMask & classmask) == 0) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->Spell); if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false)) continue; - player->LearnSpell(skillLine->spellId, false); + player->LearnSpell(skillLine->Spell, false); } } diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 855389ae868..6c5fb2f70c9 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -681,7 +681,7 @@ public: static char const* GetZoneName(uint32 zoneId, LocaleConstant locale) { AreaTableEntry const* zoneEntry = sAreaTableStore.LookupEntry(zoneId); - return zoneEntry ? zoneEntry->area_name[locale] : "<unknown zone>"; + return zoneEntry ? zoneEntry->AreaName[locale] : "<unknown zone>"; } static bool HandleListRespawnsCommand(ChatHandler* handler, char const* args) diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 76bf2d76e46..21894752ac7 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -126,7 +126,7 @@ public: if (areaEntry) { uint8 locale = handler->GetSessionDbcLocale(); - std::string name = areaEntry->area_name[locale]; + std::string name = areaEntry->AreaName[locale]; if (name.empty()) continue; @@ -138,7 +138,7 @@ public: if (locale == handler->GetSessionDbcLocale()) continue; - name = areaEntry->area_name[locale]; + name = areaEntry->AreaName[locale]; if (name.empty()) continue; @@ -338,7 +338,7 @@ public: FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : nullptr; uint8 locale = handler->GetSessionDbcLocale(); - std::string name = factionEntry->name[locale]; + std::string name = factionEntry->Name[locale]; if (name.empty()) continue; @@ -350,7 +350,7 @@ public: if (locale == handler->GetSessionDbcLocale()) continue; - name = factionEntry->name[locale]; + name = factionEntry->Name[locale]; if (name.empty()) continue; @@ -542,7 +542,7 @@ public: if (set) { uint8 locale = handler->GetSessionDbcLocale(); - std::string name = set->name[locale]; + std::string name = set->Name[locale]; if (name.empty()) continue; @@ -554,7 +554,7 @@ public: if (locale == handler->GetSessionDbcLocale()) continue; - name = set->name[locale]; + name = set->Name[locale]; if (name.empty()) continue; @@ -862,7 +862,7 @@ public: if (skillInfo) { uint8 locale = handler->GetSessionDbcLocale(); - std::string name = skillInfo->name[locale]; + std::string name = skillInfo->DisplayName[locale]; if (name.empty()) continue; @@ -874,7 +874,7 @@ public: if (locale == handler->GetSessionDbcLocale()) continue; - name = skillInfo->name[locale]; + name = skillInfo->DisplayName[locale]; if (name.empty()) continue; @@ -1129,7 +1129,7 @@ public: if (nodeEntry) { uint8 locale = handler->GetSessionDbcLocale(); - std::string name = nodeEntry->name[locale]; + std::string name = nodeEntry->Name[locale]; if (name.empty()) continue; @@ -1141,7 +1141,7 @@ public: if (locale == handler->GetSessionDbcLocale()) continue; - name = nodeEntry->name[locale]; + name = nodeEntry->Name[locale]; if (name.empty()) continue; @@ -1161,10 +1161,10 @@ public: // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format if (handler->GetSession()) handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[locale], - nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); + nodeEntry->ContinentID, nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z); else handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[locale], - nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); + nodeEntry->ContinentID, nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z); if (!found) found = true; @@ -1267,7 +1267,7 @@ public: { /// @todo: implement female support uint8 locale = handler->GetSessionDbcLocale(); - std::string name = titleInfo->nameMale[locale]; + std::string name = titleInfo->Name[locale]; if (name.empty()) continue; @@ -1279,7 +1279,7 @@ public: if (locale == handler->GetSessionDbcLocale()) continue; - name = titleInfo->nameMale[locale]; + name = titleInfo->Name[locale]; if (name.empty()) continue; @@ -1298,7 +1298,7 @@ public: char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : ""; - char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->MaskID ? handler->GetTrinityString(LANG_ACTIVE) : ""; @@ -1307,9 +1307,9 @@ public: // send title in "id (idx:idx) - [namedlink locale]" format if (handler->GetSession()) - handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[locale], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->MaskID, id, titleNameStr, localeNames[locale], knownStr, activeStr); else - handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[locale], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->MaskID, titleNameStr, localeNames[locale], knownStr, activeStr); ++counter; } @@ -1343,7 +1343,7 @@ public: { if (MapEntry const* mapInfo = sMapStore.LookupEntry(id)) { - std::string name = mapInfo->name[locale]; + std::string name = mapInfo->MapName[locale]; if (name.empty()) continue; @@ -1361,7 +1361,7 @@ public: if (mapInfo->IsContinent()) ss << handler->GetTrinityString(LANG_CONTINENT); - switch (mapInfo->map_type) + switch (mapInfo->InstanceType) { case MAP_INSTANCE: ss << handler->GetTrinityString(LANG_INSTANCE); @@ -1400,7 +1400,7 @@ public: if (MapEntry const* mapInfo = sMapStore.LookupEntry(id)) { uint8 locale = handler->GetSession() ? handler->GetSession()->GetSessionDbcLocale() : sWorld->GetDefaultDbcLocale(); - std::string name = mapInfo->name[locale]; + std::string name = mapInfo->MapName[locale]; if (name.empty()) { handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND); @@ -1413,7 +1413,7 @@ public: if (mapInfo->IsContinent()) ss << handler->GetTrinityString(LANG_CONTINENT); - switch (mapInfo->map_type) + switch (mapInfo->InstanceType) { case MAP_INSTANCE: ss << handler->GetTrinityString(LANG_INSTANCE); diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp index a9882f4c1df..b57cb5fcae0 100644 --- a/src/server/scripts/Commands/cs_message.cpp +++ b/src/server/scripts/Commands/cs_message.cpp @@ -82,7 +82,7 @@ public: if (!entry) continue; - if (strstr(entry->pattern[handler->GetSessionDbcLocale()], channelStr)) + if (strstr(entry->Name[handler->GetSessionDbcLocale()], channelStr)) { channelId = i; break; @@ -96,7 +96,7 @@ public: if (!entry) continue; - if (strstr(entry->area_name[handler->GetSessionDbcLocale()], channelStr)) + if (strstr(entry->AreaName[handler->GetSessionDbcLocale()], channelStr)) { zoneEntry = entry; break; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 2afbd4f367a..13df3bdcc2c 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -278,9 +278,9 @@ public: char const* unknown = handler->GetTrinityString(LANG_UNKNOWN); handler->PSendSysMessage(LANG_MAP_POSITION, - mapId, (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : unknown), - zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : unknown), - areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : unknown), + mapId, (mapEntry ? mapEntry->MapName[handler->GetSessionDbcLocale()] : unknown), + zoneId, (zoneEntry ? zoneEntry->AreaName[handler->GetSessionDbcLocale()] : unknown), + areaId, (areaEntry ? areaEntry->AreaName[handler->GetSessionDbcLocale()] : unknown), object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation()); if (Transport* transport = object->GetTransport()) @@ -1041,7 +1041,7 @@ public: uint32 zoneId = player->GetZoneId(); AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(zoneId); - if (!areaEntry || areaEntry->zone !=0) + if (!areaEntry || areaEntry->ParentAreaID !=0) { handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId); handler->SetSentErrorMessage(true); @@ -1139,7 +1139,7 @@ public: return false; } - int32 offset = area->exploreFlag / 32; + int32 offset = area->AreaBit / 32; if (offset >= PLAYER_EXPLORED_ZONES_SIZE) { handler->SendSysMessage(LANG_BAD_VALUE); @@ -1147,7 +1147,7 @@ public: return false; } - uint32 val = uint32((1 << (area->exploreFlag % 32))); + uint32 val = uint32((1 << (area->AreaBit % 32))); uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields | val))); @@ -1176,7 +1176,7 @@ public: return false; } - int32 offset = area->exploreFlag / 32; + int32 offset = area->AreaBit / 32; if (offset >= PLAYER_EXPLORED_ZONES_SIZE) { handler->SendSysMessage(LANG_BAD_VALUE); @@ -1184,7 +1184,7 @@ public: return false; } - uint32 val = uint32((1 << (area->exploreFlag % 32))); + uint32 val = uint32((1 << (area->AreaBit % 32))); uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset); playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields ^ val))); @@ -1498,7 +1498,7 @@ public: // add the skill to the player's book with step 1 (which is the first rank, in most cases something // like 'Apprentice <skill>'. target->SetSkill(skill, targetHasSkill ? target->GetSkillStep(skill) : 1, level, max); - handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], handler->GetNameLink(target).c_str(), level, max); + handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->DisplayName[handler->GetSessionDbcLocale()], handler->GetNameLink(target).c_str(), level, max); return true; } @@ -1840,13 +1840,13 @@ public: AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId); if (area) { - zoneName = area->area_name[locale]; + zoneName = area->AreaName[locale]; - AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->zone); + AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->ParentAreaID); if (zone) { areaName = zoneName; - zoneName = zone->area_name[locale]; + zoneName = zone->AreaName[locale]; } } @@ -1854,9 +1854,9 @@ public: zoneName = handler->GetTrinityString(LANG_UNKNOWN); if (areaName) - handler->PSendSysMessage(LANG_PINFO_CHR_MAP_WITH_AREA, map->name[locale], zoneName, areaName); + handler->PSendSysMessage(LANG_PINFO_CHR_MAP_WITH_AREA, map->MapName[locale], zoneName, areaName); else - handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name[locale], zoneName); + handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->MapName[locale], zoneName); // Output XVII. - XVIX. if they are not empty if (!guildName.empty()) diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 97a4777a339..e77d73bde9e 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -785,16 +785,16 @@ public: return false; } - if (factionEntry->reputationListID < 0) + if (factionEntry->ReputationIndex < 0) { - handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name[handler->GetSessionDbcLocale()], factionId); + handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name[handler->GetSessionDbcLocale()], factionId); handler->SetSentErrorMessage(true); return false; } target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false); target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry)); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId, + handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name[handler->GetSessionDbcLocale()], factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; } diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index d2550cc6aa7..38b56fc2e09 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -101,7 +101,7 @@ public: return false; } - uint8 powerType = classEntry->powerType; + uint8 powerType = classEntry->DisplayPower; // reset m_form if no aura if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 3a7fb943e65..d5ea0c3bb93 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -92,9 +92,9 @@ public: std::string tNameLink = handler->GetNameLink(target); target->SetTitle(titleInfo); // to be sure that title now known - target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index); + target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->MaskID); - handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->GetNativeGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], tNameLink.c_str()); + handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], tNameLink.c_str()); return true; } @@ -137,7 +137,7 @@ public: std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->GetNativeGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], target->GetName().c_str()); + snprintf(titleNameStr, 80, target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName().c_str()); target->SetTitle(titleInfo); handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str()); @@ -185,7 +185,7 @@ public: std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->GetNativeGender() == GENDER_MALE ? titleInfo->nameMale[handler->GetSessionDbcLocale()] : titleInfo->nameFemale[handler->GetSessionDbcLocale()], target->GetName().c_str()); + snprintf(titleNameStr, 80, target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName().c_str()); handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str()); @@ -224,7 +224,7 @@ public: for (uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i) if (CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i)) - titles2 &= ~(uint64(1) << tEntry->bit_index); + titles2 &= ~(uint64(1) << tEntry->MaskID); titles &= ~titles2; // remove non-existing titles diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index c571739574e..ead88e911b8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -196,7 +196,7 @@ public: if (Creature* hakkar = instance->GetCreature(DATA_HAKKAR)) { - switch (areaTrigger->id) + switch (areaTrigger->ID) { case AREA_TRIGGER_1: hakkar->AI()->Talk(SAY_ENTRANCE); diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 6197c8f53b8..48733f2b7cd 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -947,7 +947,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript uint32 questId = 0; uint32 orphanId = 0; - switch (trigger->id) + switch (trigger->ID) { case AT_DOWN_AT_THE_DOCKS: questId = QUEST_DOWN_AT_THE_DOCKS; diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index ebfa6528925..50b20366978 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -244,7 +244,7 @@ class npc_wg_spirit_guide : public CreatureScript for (uint8 i = 0; i < gy.size(); i++) if (action - GOSSIP_ACTION_INFO_DEF == i && gy[i]->GetControlTeamId() == player->GetTeamId()) if (WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(gy[i]->GetGraveyardId())) - player->TeleportTo(safeLoc->map_id, safeLoc->x, safeLoc->y, safeLoc->z, 0); + player->TeleportTo(safeLoc->Continent, safeLoc->Loc.X, safeLoc->Loc.Y, safeLoc->Loc.Z, 0); } return true; } @@ -480,7 +480,7 @@ class achievement_wg_didnt_stand_a_chance : public AchievementCriteriaScript return false; if (Vehicle* vehicle = source->GetVehicle()) - if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon + if (vehicle->GetVehicleInfo()->ID == 244) // Wintergrasp Tower Cannon return true; } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 0a569201f75..de3c530139f 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -167,7 +167,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) if (atEntry) { // 5.0f is safe-distance - if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius) + if (player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z) > 5.0f + atEntry->Radius) { // he dropped it further, summon mound GameObject* go = new GameObject; @@ -196,7 +196,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) if (atEntry) { // 5.0f is safe-distance - if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius) + if (player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z) > 5.0f + atEntry->Radius) { // he dropped it further, summon mound GameObject* go = new GameObject; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 2ba0f5b1a11..65c25a36302 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -3604,7 +3604,7 @@ class spell_item_toy_train_set_pulse : public SpellScript { target->HandleEmoteCommand(EMOTE_ONESHOT_TRAIN); if (EmotesTextSoundEntry const* soundEntry = FindTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->GetRace(), target->GetNativeGender())) - target->PlayDistanceSound(soundEntry->SoundId); + target->PlayDistanceSound(soundEntry->SoundID); } } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index a7391563e39..97c7f2fb405 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -293,13 +293,13 @@ class spell_rog_deadly_poison : public SpellScriptLoader for (uint8 s = 0; s < 3; ++s) { - if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) + if (enchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->spellid[s]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->EffectArg[s]); if (!spellInfo) { - TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->spellid[s]); + TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->EffectArg[s]); continue; } @@ -312,9 +312,9 @@ class spell_rog_deadly_poison : public SpellScriptLoader continue; if (spellInfo->IsPositive()) - player->CastSpell(player, enchant->spellid[s], item); + player->CastSpell(player, enchant->EffectArg[s], item); else - player->CastSpell(target, enchant->spellid[s], item); + player->CastSpell(target, enchant->EffectArg[s], item); } } } diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index 91356d39b4c..3ee8aed6240 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -187,7 +187,7 @@ class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript if (!player->isDead() && (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) != QUEST_STATUS_NONE || (player->GetQuestStatus(QUEST_THE_MAKERS_OVERLOOK) == QUEST_STATUS_REWARDED && player->GetQuestStatus(QUEST_THE_MAKERS_PERCH) == QUEST_STATUS_REWARDED))) { - switch (trigger->id) + switch (trigger->ID) { case AT_SHOLAZAR: player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, true); @@ -298,7 +298,7 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override { - uint32 triggerId = trigger->id; + uint32 triggerId = trigger->ID; // Second trigger happened too early after first, skip for now if (GameTime::GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN) return false; @@ -356,8 +356,8 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript if (!player->IsAlive()) return false; - uint32 triggerId = trigger->id; - if (GameTime::GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN) + uint32 triggerId = trigger->ID; + if (GameTime::GetGameTime() - _triggerTimes[trigger->ID] < SUMMON_COOLDOWN) return false; switch (triggerId) @@ -386,7 +386,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000); player->AddAura(SPELL_A52_NEURALYZER, player); - _triggerTimes[trigger->id] = GameTime::GetGameTime(); + _triggerTimes[trigger->ID] = GameTime::GetGameTime(); return false; } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index ad4c57d07b0..111abf889b4 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -166,7 +166,7 @@ public: { uint32 Spell = 0; - switch (pFaction->faction) + switch (pFaction->Faction) { case 1011: Spell = SPELL_REP_LC; break; case 935: Spell = SPELL_REP_SHAT; break; diff --git a/src/server/shared/DataStores/DBCEnums.h b/src/server/shared/DataStores/DBCEnums.h index 78dc2e842cf..fcd7bb560a5 100644 --- a/src/server/shared/DataStores/DBCEnums.h +++ b/src/server/shared/DataStores/DBCEnums.h @@ -264,7 +264,7 @@ enum AreaFlags AREA_FLAG_UNUSED2 = 0x00020000, // Unused in 3.3.5a AREA_FLAG_CONTESTED_AREA = 0x00040000, // On PvP servers these areas are considered contested, even though the zone it is contained in is a Horde/Alliance territory. AREA_FLAG_UNK4 = 0x00080000, // Valgarde and Acherus: The Ebon Hold - AREA_FLAG_LOWLEVEL = 0x00100000, // used for some starting areas with area_level <= 15 + AREA_FLAG_LOWLEVEL = 0x00100000, // used for some starting areas with ExplorationLevel <= 15 AREA_FLAG_TOWN = 0x00200000, // small towns with Inn AREA_FLAG_REST_ZONE_HORDE = 0x00400000, // Instead of using areatriggers, the zone will act as one for Horde players (Warsong Hold, Acherus: The Ebon Hold, New Agamand Inn, Vengeance Landing Inn, Sunreaver Pavilion, etc) AREA_FLAG_REST_ZONE_ALLIANCE = 0x00800000, // Instead of using areatriggers, the zone will act as one for Alliance players (Valgarde, Acherus: The Ebon Hold, Westguard Inn, Silver Covenant Pavilion, etc) diff --git a/src/server/shared/DataStores/DBCStructure.h b/src/server/shared/DataStores/DBCStructure.h index 5a5039b8312..4cf4be1ecf1 100644 --- a/src/server/shared/DataStores/DBCStructure.h +++ b/src/server/shared/DataStores/DBCStructure.h @@ -25,35 +25,35 @@ #include <set> #include <map> -// Structures using to access raw DBC data and required packing to portability +// Structures used to access raw DBC data require packing for portability #pragma pack(push, 1) struct AchievementEntry { - uint32 ID; - int32 Faction; // -1=all, 0=horde, 1=alliance - int32 MapID; // -1 = none - //uint32 Supercedes; // its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) - char* Title[16]; - //uint32 Title_flags; - //char* Description[16]; - //uint32 Description_flags; - uint32 Category; - uint32 Points; - //uint32 UIOrder; - uint32 Flags; - //uint32 IconID; - //char* Reward[16]; - //uint32 Reward_flags; - uint32 MinimumCriteria; // need this count of completed criterias (own or referenced achievement criterias) - uint32 SharesCriteria; // referenced achievement (counting of all completed criterias) + uint32 ID; // 0 + int32 Faction; // 1 -1=all, 0=horde, 1=alliance + int32 InstanceID; // 2 -1=none + //uint32 Supercedes; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) + char* Title[16]; // 4-19 + //uint32 Title_lang_mask; // 20 + //char* Description[16]; // 21-36 + //uint32 Description_lang_mask; // 37 + uint32 Category; // 38 + uint32 Points; // 39 reward points + //uint32 UiOrder; // 40 icon (from SpellIcon.dbc) + uint32 Flags; // 41 + //uint32 IconID; // 42 + //char* Reward[16]; // 43-58 + //uint32 Reward_lang_mask; // 59 + uint32 MinimumCriteria; // 60 - need this count of completed criterias (own or referenced achievement criterias) + uint32 SharesCriteria; // 61 - referenced achievement (counting of all completed criterias) }; struct AchievementCriteriaEntry { - uint32 ID; - uint32 ReferredAchievement; - uint32 Type; + uint32 ID; // 0 + uint32 AchievementID; // 1 + uint32 Type; // 2 union { uint32 ID; @@ -154,52 +154,59 @@ struct AchievementCriteriaEntry // ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE = 109 uint32 LootType; - } Asset; + } Asset; // 3 - uint32 Amount; + uint32 Quantity; // 4 struct { - uint32 Type; - uint32 Asset; - } AdditionalRequirements[MAX_CRITERIA_REQUIREMENTS]; + uint32 Type; + uint32 Asset; + } AdditionalRequirements[MAX_CRITERIA_REQUIREMENTS]; // 5-8 - //char* Description[16]; - //uint32 Description_flags; - uint32 Flags; - uint32 StartEvent; - uint32 StartAsset; - uint32 StartTimer; - //uint32 OrderIndex; + //char* Description[16]; // 9-24 + //uint32 Description_lang_mask; // 25 + uint32 Flags; // 26 + uint32 StartEvent; // 27 AchievementCriteriaTimedTypes + uint32 StartAsset; // 28 Always appears with timed events, used internally to start the achievement, store + uint32 StartTimer; // 29 time limit in seconds + //uint32 UiOrder; // 30 }; struct AreaTableEntry { - uint32 ID; // 0 - uint32 mapid; // 1 - uint32 zone; // 2 if 0 then it's zone, else it's zone id of this area - uint32 exploreFlag; // 3 - uint32 flags; // 4, unknown value but 312 for all cities - // 5-9 unused - int32 area_level; // 10 - char* area_name[16]; // 11-26 - // 27, string flags, unused - uint32 team; // 28 - uint32 LiquidTypeOverride[4]; // 29-32 liquid override by type + uint32 ID; // 0 + uint32 ContinentID; // 1 + uint32 ParentAreaID; // 2 if 0 then it's zone, else it's zone id of this area + uint32 AreaBit; // 3 + uint32 Flags; // 4 + //uint32 SoundProviderPref; // 5 + //uint32 SoundProviderPrefUnderwater; // 6 + //uint32 AmbienceID; // 7 + //uint32 ZoneMusic; // 8 + //uint32 IntroSound; // 9 + int32 ExplorationLevel; // 10 + char* AreaName[16]; // 11-26 + //uint32 AreaName_lang_mask; // 27 + uint32 FactionGroupMask; // 28 + uint32 LiquidTypeID[4]; // 29-32 liquid override by type + //float MinElevation; // 33 + //float AmbientMultiplier; // 34 + //uint32 LightID; // 35 // helpers bool IsSanctuary() const { - if (mapid == 609) + if (ContinentID == 609) return true; - return (flags & AREA_FLAG_SANCTUARY) != 0; + return (Flags & AREA_FLAG_SANCTUARY) != 0; } bool IsFlyable() const { - if (flags & AREA_FLAG_OUTLAND) + if (Flags & AREA_FLAG_OUTLAND) { - if (!(flags & AREA_FLAG_NO_FLY_ZONE)) + if (!(Flags & AREA_FLAG_NO_FLY_ZONE)) return true; } @@ -211,102 +218,100 @@ struct AreaTableEntry struct AreaGroupEntry { - uint32 AreaGroupId; // 0 - uint32 AreaId[MAX_GROUP_AREA_IDS]; // 1-6 - uint32 nextGroup; // 7 index of next group + uint32 ID; // 0 + uint32 AreaID[MAX_GROUP_AREA_IDS]; // 1-6 + uint32 NextAreaID; // 7 index of next group }; struct AreaPOIEntry { - uint32 id; //0 - uint32 icon[11]; //1-11 - float x; //12 - float y; //13 - float z; //14 - uint32 mapId; //15 - //uint32 val1; //16 - uint32 zoneId; //17 - //char* name[16]; //18-33 - //uint32 name_flag; //34 - //char* name2[16]; //35-50 - //uint32 name_flag2; //51 - uint32 worldState; //52 - //uint32 val2; //53 + uint32 ID; // 0 + uint32 Importance; // 1 + uint32 Icon[9]; // 2-10 + uint32 FactionID; // 11 + DBCPosition3D Pos; // 12-14 + uint32 ContinentID; // 15 + //uint32 Flags; // 16 + uint32 AreaID; // 17 + //char* Name[16]; // 18-33 + //uint32 Name_lang_mask; // 34 + //char* Description[16]; // 35-50 + //uint32 Description_lang_mask; // 51 + uint32 WorldStateID; // 52 + //uint32 WorldMapLink; // 53 }; struct AreaTriggerEntry { - uint32 id; // 0 m_ID - uint32 mapid; // 1 m_ContinentID - float x; // 2 m_x - float y; // 3 m_y - float z; // 4 m_z - float radius; // 5 m_radius - float box_x; // 6 m_box_length - float box_y; // 7 m_box_width - float box_z; // 8 m_box_heigh - float box_orientation; // 9 m_box_yaw + uint32 ID; // 0 + uint32 ContinentID; // 1 + DBCPosition3D Pos; // 2-4 + float Radius; // 5 + float BoxLength; // 6 + float BoxWidth; // 7 + float BoxHeight; // 8 + float BoxYaw; // 9 }; struct AuctionHouseEntry { - uint32 houseId; // 0 index - uint32 faction; // 1 id of faction.dbc for player factions associated with city - uint32 depositPercent; // 2 1/3 from real - uint32 cutPercent; // 3 - //char* name[16]; // 4-19 - // 20 string flag, unused + uint32 ID; // 0 + uint32 FactionID; // 1 id of faction.dbc for player factions associated with city + uint32 DepositRate; // 2 1/3 from real + uint32 ConsignmentRate; // 3 + //char* Name[16]; // 4-19 + //uint32 Name_lang_mask; // 20 }; struct BankBagSlotPricesEntry { - uint32 ID; - uint32 price; + uint32 ID; // 0 + uint32 Cost; // 1 }; struct BannedAddOnsEntry { - uint32 Id; - // uint32 NameMD5[4]; - // uint32 VersionMD5[4]; - // uint32 Timestamp; - // uint32 State; + uint32 ID; // 0 + //uint32 NameMD5[4]; // 1-4 + //uint32 VersionMD5[4]; // 5-8 + //uint32 LastModified; // 9 + //uint32 Flags; // 10 }; struct BarberShopStyleEntry { - uint32 Id; // 0 - uint32 type; // 1 value 0 -> hair, value 2 -> facialhair - //char* name[16]; // 2-17 name of hair style - //uint32 name_flags; // 18 - //uint32 unk_name[16]; // 19-34, all empty - //uint32 unk_flags; // 35 - //float CostMultiplier; // 36 values 1 and 0.75 - uint32 race; // 37 race - uint32 gender; // 38 0 -> male, 1 -> female - uint32 hair_id; // 39 real ID to hair/facial hair + uint32 ID; // 0 + uint32 Type; // 1 value 0 -> hair, value 2 -> facialhair + //char* DisplayName[16]; // 2-17 + //uint32 DisplayName_lang_mask; // 18 + //uint32 Description[16]; // 19-34, all empty + //uint32 Description_lang_mask; // 35 + //float CostModifier; // 36 + uint32 Race; // 37 + uint32 Sex; // 38 + uint32 Data; // 39 real ID to hair/facial hair }; struct BattlemasterListEntry { - uint32 id; // 0 - int32 mapid[8]; // 1-8 mapid - uint32 type; // 9 map type (3 - BG, 4 - arena) - //uint32 canJoinAsGroup; // 10 (0 or 1) - char* name[16]; // 11-26 - //uint32 nameFlags // 27 string flag, unused - uint32 maxGroupSize; // 28 maxGroupSize, used for checking if queue as group - uint32 HolidayWorldStateId; // 29 new 3.1 + uint32 ID; // 0 + int32 MapID[8]; // 1-8 + uint32 InstanceType; // 9 map type (3 - BG, 4 - arena) + //uint32 GroupsAllowed; // 10 + char* Name[16]; // 11-26 + //uint32 Name_lang_mask; // 27 + uint32 MaxGroupSize; // 28 used for checking if queue as group + uint32 HolidayWorldState; // 29 //uint32 MinLevel; // 30 - //uint32 SomeLevel; // 31, may be max level + //uint32 MaxLevel; // 31 }; struct CharacterFacialHairStylesEntry { - uint32 Race; - uint32 Gender; - uint32 Variation; - // uint32 Geoset[5]; + uint32 RaceID; // 0 + uint32 SexID; // 1 + uint32 VariationID; // 2 + //uint32 Geoset[5]; // 3-7 }; enum CharSectionFlags @@ -326,70 +331,71 @@ enum CharSectionType struct CharSectionsEntry { - //uint32 Id; - uint32 Race; - uint32 Gender; - uint32 GenType; - //char* TexturePath[3]; - uint32 Flags; - uint32 Type; - uint32 Color; + //uint32 ID; // 0 + uint32 RaceID; // 1 + uint32 SexID; // 2 + uint32 BaseSection; // 3 + //char* TextureName[3]; // 4-6 + uint32 Flags; // 7 + uint32 VariationIndex; // 8 + uint32 ColorIndex; // 9 - inline bool HasFlag(CharSectionFlags flag) const { return !!(Flags & flag); } + inline bool HasFlag(CharSectionFlags flag) const { return (Flags & flag) != 0; } }; #define MAX_OUTFIT_ITEMS 24 struct CharStartOutfitEntry { - //uint32 Id; // 0 - uint8 Race; // 1 - uint8 Class; // 2 - uint8 Gender; // 3 - //uint8 Unused; // 4 - int32 ItemId[MAX_OUTFIT_ITEMS]; // 5-28 - //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 29-52 not required at server side - //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side + //uint32 ID; // 0 + uint8 RaceID; // 1 + uint8 ClassID; // 2 + uint8 SexID; // 3 + //uint8 OutfitID; // 4 + int32 ItemID[MAX_OUTFIT_ITEMS]; // 5-28 + //int32 DisplayItemID[MAX_OUTFIT_ITEMS]; // 29-52 not required at server side + //int32 InventoryType[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side }; struct CharTitlesEntry { - uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() - //uint32 unk1; // 1 flags? - char* nameMale[16]; // 2-17 - // 18 string flag, unused - char* nameFemale[16]; // 19-34 - // 35 string flag, unused - uint32 bit_index; // 36 used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES + uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() + //uint32 ConditionID; // 1 + char* Name[16]; // 2-17 male + //uint32 Name_lang_mask; // 18 + char* Name1[16]; // 19-34 female + //uint32 Name1_lang_mask; // 35 + uint32 MaskID; // 36 used in PLAYER_CHOSEN_TITLE and 1<<index in PLAYER__FIELD_KNOWN_TITLES }; struct ChatChannelsEntry { - uint32 ChannelID; // 0 - uint32 flags; // 1 - char* pattern[16]; // 3-18 - // 19 string flags, unused - //char* name[16]; // 20-35 unused - // 36 string flag, unused + uint32 ID; // 0 + uint32 Flags; // 1 + //uint32 FactionGroup; // 2 + char* Name[16]; // 3-18 + //uint32 Name_lang_mask; // 19 + //char* Shortcut[16]; // 20-35 + //uint32 Shortcut_lang_mask; // 36 }; struct ChrClassesEntry { - uint32 ClassID; // 0 - // 1, unused - uint32 powerType; // 2 - // 3-4, unused - char* name[16]; // 5-20 unused - // 21 string flag, unused - //char* nameFemale[16]; // 21-36 unused, if different from base (male) case - // 37 string flag, unused - //char* nameNeutralGender[16]; // 38-53 unused, if different from base (male) case - // 54 string flag, unused - // 55, unused - uint32 spellfamily; // 56 - // 57, unused - uint32 CinematicSequence; // 58 id from CinematicSequences.dbc - uint32 expansion; // 59 (0 - original race, 1 - tbc addon, ...) + uint32 ID; // 0 + //uint32 DamageBonusStat; // 1 + uint32 DisplayPower; // 2 + //char* PetNameToken; // 3 + char* Name[16]; // 4-19 + //uint32 Name_lang_mask; // 20 + //char* NameFemale[16]; // 21-36 + //uint32 NameFemale_lang_mask; // 37 + //char* NameMale[16]; // 38-53 + //uint32 NameMale_lang_mask; // 54 + //char* Filename; // 55 + uint32 SpellClassSet; // 56 + //uint32 Flags; // 57 + uint32 CinematicSequenceID; // 58 ID from CinematicSequences.dbc + uint32 RequiredExpansion; // 59 }; enum ChrRacesAllianceType @@ -408,105 +414,96 @@ enum ChrRacesFlags struct ChrRacesEntry { - uint32 RaceID; // 0 - uint32 Flags; // 1 - uint32 FactionID; // 2 facton template id - // 3 unused - uint32 model_m; // 4 - uint32 model_f; // 5 - // 6 unused - uint32 TeamID; // 7 (7-Alliance 1-Horde) - uint32 CreatureType; // 8 Blizzlike Always 7 (humanoid). - uint32 ResSicknessSpellID; // 9 Blizzlike DBC always 15007. - // 10-11 unused - uint32 CinematicSequence; // 12 id from CinematicSequences.dbc - uint32 Alliance; // 13 faction (0 alliance, 1 horde, 2 not available?) - char* name[16]; // 14-29 used for DBC language detection/selection - // 30 string flags, unused - //char* nameFemale[16]; // 31-46, if different from base (male) case - // 47 string flags, unused - //char* nameNeutralGender[16]; // 48-63, if different from base (male) case - // 64 string flags, unused - // 65-67 unused - uint32 expansion; // 68 (0 - original race, 1 - tbc addon, ...) - - inline bool HasFlag(ChrRacesFlags flag) const { return !!(Flags & flag); } + uint32 ID; // 0 + uint32 Flags; // 1 + uint32 FactionID; // 2 + //uint32 ExplorationSoundID; // 3 + uint32 MaleDisplayID; // 4 + uint32 FemaleDisplayID; // 5 + //char* ClientPrefix; // 6 + uint32 BaseLanguage; // 7 (7-Alliance 1-Horde) + uint32 CreatureType; // 8 + uint32 ResSicknessSpellID; // 9 + //uint32 SplashSoundID; // 10 + //char* ClientFileString; // 11 + uint32 CinematicSequenceID; // 12 ID from CinematicSequences.dbc + uint32 Alliance; // 13 + char* Name[16]; // 14-29 + //uint32 Name_lang_mask; // 30 + //char* NameFemale[16]; // 31-46 + //uint32 NameFemale_lang_mask; // 47 + //char* NameMale[16]; // 48-63 + //uint32 NameMale_lang_mask; // 64 + //char* FacialHairCustomization[2]; // 65-66 + //char* HairCustomization; // 67 + uint32 RequiredExpansion; // 68 + + inline bool HasFlag(ChrRacesFlags flag) const { return (Flags & flag) != 0; } }; struct CinematicCameraEntry { uint32 ID; // 0 - char const* Model; // 1 Model filename (translate .mdx to .m2) - uint32 SoundID; // 2 Sound ID (voiceover for cinematic) - DBCPosition3D Origin; // 3-5 Position in map used for basis for M2 co-ordinates - float OriginFacing; // 6 Orientation in map used for basis for M2 co-ordinates + char* Model; // 1 Model filename (translate .mdx to .m2) + uint32 SoundID; // 2 Sound ID (voiceover for cinematic) + DBCPosition3D Origin; // 3-5 Position in map used for basis for M2 co-ordinates + float OriginFacing; // 6 Orientation in map used for basis for M2 co-ordinates }; struct CinematicSequencesEntry { - uint32 Id; // 0 index - //uint32 unk1; // 1 always 0 - uint32 cinematicCamera; // 2 id in CinematicCamera.dbc - // 3-9 always 0 + uint32 ID; // 0 + //uint32 SoundID; // 1 + uint32 Camera[8]; // 2-9 ID in CinematicCamera.dbc }; struct CreatureDisplayInfoEntry { - uint32 Displayid; // 0 m_ID - uint32 ModelId; // 1 m_modelID - // 2 m_soundID - uint32 ExtraId; // 3 m_extendedDisplayInfoID - float scale; // 4 m_creatureModelScale - // 5 m_creatureModelAlpha - // 6-8 m_textureVariation[3] - // 9 m_portraitTextureName - // 10 m_sizeClass - // 11 m_bloodID - // 12 m_NPCSoundID - // 13 m_particleColorID - // 14 m_creatureGeosetData - // 15 m_objectEffectPackageID + uint32 ID; // 0 + uint32 ModelID; // 1 + //uint32 SoundID; // 2 + uint32 ExtendedDisplayInfoID; // 3 + float CreatureModelScale; // 4 + //uint32 CreatureModelAlpha; // 5 + //char* TextureVariation[3]; // 6-8 + //char* PortraitTextureName; // 9 + //uint32 SizeClass; // 10 + //uint32 BloodID; // 11 + //uint32 NPCSoundID; // 12 + //uint32 ParticleColorID; // 13 + //uint32 CreatureGeosetData; // 14 + //uint32 ObjectEffectPackageID; // 15 }; struct CreatureDisplayInfoExtraEntry { - //uint32 Id; // 0 - uint32 Race; // 1 - uint32 Gender; // 2 - //uint32 SkinColor; // 3 - //uint32 FaceType; // 4 - //uint32 HairType; // 5 - //uint32 HairStyle; // 6 - //uint32 FacialHair; // 7 - //uint32 HelmDisplayId; // 8 - //uint32 ShoulderDisplayId; // 9 - //uint32 ShirtDisplayId; // 10 - //uint32 ChestDisplayId; // 11 - //uint32 BeltDisplayId; // 12 - //uint32 LegsDisplayId; // 13 - //uint32 BootsDisplayId; // 14 - //uint32 WristDisplayId; // 15 - //uint32 GlovesDisplayId; // 16 - //uint32 TabardDisplayId; // 17 - //uint32 CloakDisplayId; // 18 - //uint32 CanEquip; // 19 - //char const* Texture; // 20 + //uint32 ID; // 0 + uint32 DisplayRaceID; // 1 + uint32 DisplaySexID; // 2 + //uint32 SkinID; // 3 + //uint32 FaceID; // 4 + //uint32 HairStyleID; // 5 + //uint32 HairColorID; // 6 + //uint32 FacialHairID; // 7 + //uint32 NPCItemDisplay[11]; // 8-18 + //uint32 Flags; // 19 + //char* BakeName; // 20 }; struct CreatureFamilyEntry { - uint32 ID; // 0 m_ID - float minScale; // 1 m_minScale - uint32 minScaleLevel; // 2 m_minScaleLevel - float maxScale; // 3 m_maxScale - uint32 maxScaleLevel; // 4 m_maxScaleLevel - uint32 skillLine[2]; // 5-6 m_skillLine - uint32 petFoodMask; // 7 m_petFoodMask - int32 petTalentType; // 8 m_petTalentType - // 9 m_categoryEnumID - char* Name[16]; // 10-25 m_name_lang - // 26 string flags - // 27 m_iconFile + uint32 ID; // 0 + float MinScale; // 1 + uint32 MinScaleLevel; // 2 + float MaxScale; // 3 + uint32 MaxScaleLevel; // 4 + uint32 SkillLine[2]; // 5-6 + uint32 PetFoodMask; // 7 + int32 PetTalentType; // 8 + //int32 CategoryEnumID; // 9 + char* Name[16]; // 10-25 + //uint32 Name_lang_mask; // 26 + //char* IconFile; // 27 }; enum CreatureModelDataFlags @@ -516,33 +513,39 @@ enum CreatureModelDataFlags struct CreatureModelDataEntry { - uint32 Id; - uint32 Flags; - char* ModelPath; - //uint32 Unk1; - float Scale; // Used in calculation of unit collision data - //int32 Unk2 - //int32 Unk3 - //uint32 Unk4 - //uint32 Unk5 - //float Unk6 - //uint32 Unk7 - //float Unk8 - //uint32 Unk9 - //uint32 Unk10 - //float CollisionWidth; - float CollisionHeight; - float MountHeight; // Used in calculation of unit collision data when mounted - //float Unks[11] - - inline bool HasFlag(CreatureModelDataFlags flag) const { return !!(Flags & flag); } + uint32 ID; // 0 + uint32 Flags; // 1 + char* ModelName; // 2 + //uint32 SizeClass; // 3 + float ModelScale; // 4 Used in calculation of unit collision data + //int32 BloodID; // 5 + //int32 FootprintTextureID; // 6 + //uint32 FootprintTextureLength; // 7 + //uint32 FootprintTextureWidth; // 8 + //float FootprintParticleScale; // 9 + //uint32 FoleyMaterialID; // 10 + //float FootstepShakeSize; // 11 + //uint32 DeathThudShakeSize; // 12 + //uint32 SoundID; // 13 + //float CollisionWidth; // 14 + float CollisionHeight; // 15 + float MountHeight; // 16 Used in calculation of unit collision data when mounted + //float GeoBoxMin[3]; // 17-19 + //float GeoBoxMax[3]; // 20-22 + //float WorldEffectScale; // 23 + //float AttachedEffectScale; // 24 + //float MissileCollisionRadius; // 25 + //float MissileCollisionPush; // 26 + //float MissileCollisionRaise; // 27 + + inline bool HasFlag(CreatureModelDataFlags flag) const { return (Flags & flag) != 0; } }; struct CreatureSpellDataEntry { - uint32 ID; // 0 m_ID - uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 m_spells[4] - //uint32 availability[MAX_CREATURE_SPELL_DATA_SLOT]; // 4-7 m_availability[4] + uint32 ID; // 0 + uint32 Spells[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 + //uint32 Availability[MAX_CREATURE_SPELL_DATA_SLOT]; // 4-7 }; enum CreatureTypeEntryFlags @@ -552,125 +555,128 @@ enum CreatureTypeEntryFlags struct CreatureTypeEntry { - uint32 ID; // 0 m_ID - //char* Name[16]; // 1-16 name - // 17 string flags - //uint32 Flags; // 18 Critters, non-combat pets, gas cloud. (called Flags in struct) + uint32 ID; // 0 + //char* Name[16]; // 1-16 + //uint32 Name_lang_mask; // 17 + //uint32 Flags; // 18 }; /* not used struct CurrencyCategoryEntry { - uint32 ID; // 0 - uint32 Unk1; // 1 0 for known categories and 3 for unknown one (3.0.9) - char* Name[16]; // 2-17 name - // // 18 string flags + uint32 ID; // 0 + uint32 Flags; // 1 + char* Name[16]; // 2-17 + uint32 Name_lang_mask; // 18 }; */ struct CurrencyTypesEntry { - //uint32 ID; // 0 not used - uint32 ItemId; // 1 used as real index - //uint32 Category; // 2 may be category - uint32 BitIndex; // 3 bit index in PLAYER_FIELD_KNOWN_CURRENCIES (1 << (index-1)) + //uint32 ID; // 0 + uint32 ItemID; // 1 + //uint32 CategoryID; // 2 + uint32 BitIndex; // 3 bit index in PLAYER_FIELD_KNOWN_CURRENCIES (1 << (index-1)) }; struct DestructibleModelDataEntry { - uint32 Id; - //uint32 State0ImpactEffectDoodadSet; - //uint32 State0AmbientDoodadSet; - uint32 State1Wmo; - //uint32 State1DestructionDoodadSet; - //uint32 State1ImpactEffectDoodadSet; - //uint32 State1AmbientDoodadSet; - uint32 State2Wmo; - //uint32 State2DestructionDoodadSet; - //uint32 State2ImpactEffectDoodadSet; - //uint32 State2AmbientDoodadSet; - uint32 State3Wmo; - //uint32 State3InitDoodadSet; - //uint32 State3AmbientDoodadSet; - //uint32 EjectDirection; - uint32 State0Wmo; - //uint32 DoNotHighlight; - //uint32 HealEffect; - //uint32 HealEffectSpeed; + uint32 ID; // 0 + //uint32 State0ImpactEffectDoodadSet; // 1 + //uint32 State0AmbientDoodadSet; // 2 + uint32 State1Wmo; // 3 + //uint32 State1DestructionDoodadSet; // 4 + //uint32 State1ImpactEffectDoodadSet; // 5 + //uint32 State1AmbientDoodadSet; // 6 + uint32 State2Wmo; // 7 + //uint32 State2DestructionDoodadSet; // 8 + //uint32 State2ImpactEffectDoodadSet; // 9 + //uint32 State2AmbientDoodadSet; // 10 + uint32 State3Wmo; // 11 + //uint32 State3InitDoodadSet; // 12 + //uint32 State3AmbientDoodadSet; // 13 + //uint32 EjectDirection; // 14 + uint32 RepairGroundFx; // 15 + //uint32 DoNotHighlight; // 16 + //uint32 HealEffect; // 17 + //uint32 HealEffectSpeed; // 18 }; struct DungeonEncounterEntry { - uint32 id; // 0 unique id - uint32 mapId; // 1 map id - uint32 difficulty; // 2 instance mode - //uint32 unk0; // 3 - uint32 encounterIndex; // 4 encounter index for creating completed mask - char* encounterName[16]; // 5-20 encounter name - //uint32 nameFlags; // 21 - //uint32 unk1; // 22 + uint32 ID; // 0 + uint32 MapID; // 1 + uint32 Difficulty; // 2 + //uint32 OrderIndex; // 3 + uint32 Bit; // 4 encounter index for creating completed mask + char* Name[16]; // 5-20 + //uint32 Name_lang_mask; // 21 + //uint32 SpellIconID; // 22 }; struct DurabilityCostsEntry { - uint32 Itemlvl; // 0 - uint32 multiplier[29]; // 1-29 + uint32 ID; // 0 + uint32 WeaponSubClassCost[21]; // 1-21 + uint32 ArmorSubClassCost[8]; // 22-29 }; struct DurabilityQualityEntry { - uint32 Id; // 0 - float quality_mod; // 1 + uint32 ID; // 0 + float Data; // 1 }; struct EmotesEntry { - uint32 Id; // 0 - //char* Name; // 1, internal name - //uint32 AnimationId; // 2, ref to animationData - uint32 Flags; // 3, bitmask, may be unit_flags - uint32 EmoteType; // 4, Can be 0, 1 or 2 (determine how emote are shown) - uint32 UnitStandState; // 5, uncomfirmed, may be enum UnitStandStateType - //uint32 SoundId; // 6, ref to soundEntries + uint32 ID; // 0 + //char* EmoteSlashCommand; // 1 internal name + //uint32 AnimID; // 2 ref to animationData + uint32 EmoteFlags; // 3 bitmask, may be unit_flags + uint32 EmoteSpecProc; // 4 Can be 0, 1 or 2 (determine how emote are shown) + uint32 EmoteSpecProcParam; // 5 unconfirmed, may be enum UnitStandStateType + //uint32 EventSoundID; // 6 }; struct EmotesTextEntry { - uint32 Id; - uint32 textid; + uint32 ID; // 0 + //char* Name; // 1 + uint32 EmoteID; // 2 + //uint32 EmoteText[16]; // 3-18 }; struct EmotesTextSoundEntry { - uint32 Id; // 0 - uint32 EmotesTextId; // 1 - uint32 RaceId; // 2 - uint32 SexId; // 3, 0 male / 1 female - uint32 SoundId; // 4 + uint32 ID; // 0 + uint32 EmotesTextID; // 1 + uint32 RaceID; // 2 + uint32 SexID; // 3 0 male / 1 female + uint32 SoundID; // 4 }; struct FactionEntry { - uint32 ID; // 0 m_ID - int32 reputationListID; // 1 m_reputationIndex - uint32 BaseRepRaceMask[4]; // 2-5 m_reputationRaceMask - uint32 BaseRepClassMask[4]; // 6-9 m_reputationClassMask - int32 BaseRepValue[4]; // 10-13 m_reputationBase - uint32 ReputationFlags[4]; // 14-17 m_reputationFlags - uint32 team; // 18 m_parentFactionID - float spilloverRateIn; // 19 Faction gains incoming rep * spilloverRateIn - float spilloverRateOut; // 20 Faction outputs rep * spilloverRateOut as spillover reputation - uint32 spilloverMaxRankIn; // 21 The highest rank the faction will profit from incoming spillover - //uint32 spilloverRank_unk; // 22 It does not seem to be the max standing at which a faction outputs spillover ...so no idea - char* name[16]; // 23-38 m_name_lang - // 39 string flags - //char* description[16]; // 40-55 m_description_lang - // 56 string flags + uint32 ID; // 0 + int32 ReputationIndex; // 1 + uint32 ReputationRaceMask[4]; // 2-5 + uint32 ReputationClassMask[4]; // 6-9 + int32 ReputationBase[4]; // 10-13 + uint32 ReputationFlags[4]; // 14-17 + uint32 ParentFactionID; // 18 + float ParentFactionMod[2]; // 19-20 [0] Faction gains incoming rep * spilloverRateIn + // [1] Faction outputs rep * spilloverRateOut as spillover reputation + uint32 ParentFactionCap[2]; // 21-22 [0] The highest rank the faction will profit from incoming spillover + // [1] It does not seem to be the max standing at which a faction outputs spillover ...so no idea + char* Name[16]; // 23-38 + //uint32 Name_lang_mask; // 39 + //char* Description[16]; // 40-55 + //uint32 Description_lang_mask; // 56 // helpers bool CanHaveReputation() const { - return reputationListID >= 0; + return ReputationIndex >= 0; } }; @@ -678,88 +684,85 @@ struct FactionEntry struct FactionTemplateEntry { - uint32 ID; // 0 m_ID - uint32 faction; // 1 m_faction - uint32 factionFlags; // 2 m_flags - uint32 ourMask; // 3 m_factionGroup - uint32 friendlyMask; // 4 m_friendGroup - uint32 hostileMask; // 5 m_enemyGroup - uint32 enemyFaction[MAX_FACTION_RELATIONS]; // 6 m_enemies[MAX_FACTION_RELATIONS] - uint32 friendFaction[MAX_FACTION_RELATIONS]; // 10 m_friend[MAX_FACTION_RELATIONS] - //------------------------------------------------------- end structure + uint32 ID; // 0 + uint32 Faction; // 1 + uint32 Flags; // 2 + uint32 FactionGroup; // 3 + uint32 FriendGroup; // 4 + uint32 EnemyGroup; // 5 + uint32 Enemies[MAX_FACTION_RELATIONS]; // 6-9 + uint32 Friend[MAX_FACTION_RELATIONS]; // 10-13 // helpers bool IsFriendlyTo(FactionTemplateEntry const& entry) const { - if (entry.faction) + if (entry.Faction) { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] == entry.faction) + if (Enemies[i] == entry.Faction) return false; for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (friendFaction[i] == entry.faction) + if (Friend[i] == entry.Faction) return true; } - return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask); + return (FriendGroup & entry.FactionGroup) || (FactionGroup & entry.FriendGroup); } bool IsHostileTo(FactionTemplateEntry const& entry) const { - if (entry.faction) + if (entry.Faction) { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] == entry.faction) + if (Enemies[i] == entry.Faction) return true; for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (friendFaction[i] == entry.faction) + if (Friend[i] == entry.Faction) return false; } - return (hostileMask & entry.ourMask) != 0; + return (EnemyGroup & entry.FactionGroup) != 0; } - bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; } + bool IsHostileToPlayers() const { return (EnemyGroup & FACTION_MASK_PLAYER) !=0; } bool IsNeutralToAll() const { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] != 0) + if (Enemies[i] != 0) return false; - return hostileMask == 0 && friendlyMask == 0; + return EnemyGroup == 0 && FriendGroup == 0; } - bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } + bool IsContestedGuardFaction() const { return (Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } }; struct GameObjectDisplayInfoEntry { - uint32 Displayid; // 0 m_ID - char* filename; // 1 - //uint32 unk1[10]; //2-11 - float minX; - float minY; - float minZ; - float maxX; - float maxY; - float maxZ; - //uint32 transport; //18 + uint32 ID; // 0 + char* ModelName; // 1 + //uint32 Sound[10]; // 2-11 + DBCPosition3D GeoBoxMin; // 12-14 + DBCPosition3D GeoBoxMax; // 15-17 + //uint32 ObjectEffectPackageID; // 18 }; struct GemPropertiesEntry { - uint32 ID; - uint32 spellitemenchantement; - uint32 color; + uint32 ID; // 0 + uint32 EnchantID; // 1 + //uint32 MaxCountInv; // 2 + //uint32 MaxCountItem; // 3 + uint32 Type; // 4 }; struct GlyphPropertiesEntry { - uint32 Id; - uint32 SpellId; - uint32 TypeFlags; - uint32 Unk1; // GlyphIconId (SpellIcon.dbc) + uint32 ID; // 0 + uint32 SpellID; // 1 + uint32 GlyphSlotFlags; // 2 + uint32 SpellIconID; // 3 }; struct GlyphSlotEntry { - uint32 Id; - uint32 TypeFlags; - uint32 Order; + uint32 ID; // 0 + uint32 Type; // 1 + uint32 Tooltip; // 2 }; // All Gt* DBC store data for 100 levels, some by 100 per class/race @@ -769,79 +772,81 @@ struct GlyphSlotEntry struct GtBarberShopCostBaseEntry { - float cost; + float Data; // 0 }; struct GtCombatRatingsEntry { - float ratio; + float Data; // 0 }; struct GtChanceToMeleeCritBaseEntry { - float base; + float Data; // 0 }; struct GtChanceToMeleeCritEntry { - float ratio; + float Data; // 0 }; struct GtChanceToSpellCritBaseEntry { - float base; + float Data; // 0 }; struct GtNPCManaCostScalerEntry { - float ratio; + float Data; // 0 }; struct GtChanceToSpellCritEntry { - float ratio; + float Data; // 0 }; struct GtOCTClassCombatRatingScalarEntry { - float ratio; + float Data; // 0 }; struct GtOCTRegenHPEntry { - float ratio; + float Data; // 0 }; -//struct GtOCTRegenMPEntry -//{ -// float ratio; -//}; +/* +struct GtOCTRegenMPEntry +{ + float Data; // 0 +}; +*/ struct GtRegenHPPerSptEntry { - float ratio; + float Data; // 0 }; struct GtRegenMPPerSptEntry { - float ratio; + float Data; // 0 }; -/* no used +/* struct HolidayDescriptionsEntry { - uint32 ID; // 0, m_holidayDescriptionID - //char* name[16] // 1-16 m_name_lang - // 17 name flags + uint32 ID; // 0 + char* Description[16]; // 1-16 + uint32 Description_lang_mask; // 17 }; */ -/* no used +/* struct HolidayNamesEntry { - uint32 ID; // 0, m_holidayNameID - //char* name[16] // 1-16 m_name_lang - // 17 name flags + uint32 ID; // 0 + char* Name[16]; // 1-16 + uint32 Name_lang_mask; // 17 }; */ @@ -851,107 +856,112 @@ struct HolidayNamesEntry struct HolidaysEntry { - uint32 Id; // 0 m_ID - uint32 Duration[MAX_HOLIDAY_DURATIONS]; // 1-10 m_duration - uint32 Date[MAX_HOLIDAY_DATES]; // 11-36 m_date (dates in unix time starting at January, 1, 2000) - uint32 Region; // 37 m_region (wow region) - uint32 Looping; // 38 m_looping - uint32 CalendarFlags[MAX_HOLIDAY_FLAGS]; // 39-48 m_calendarFlags - //uint32 holidayNameId; // 49 m_holidayNameID (HolidayNames.dbc) - //uint32 holidayDescriptionId; // 50 m_holidayDescriptionID (HolidayDescriptions.dbc) - char* TextureFilename; // 51 m_textureFilename - uint32 Priority; // 52 m_priority - int32 CalendarFilterType; // 53 m_calendarFilterType (-1 = Fishing Contest, 0 = Unk, 1 = Darkmoon Festival, 2 = Yearly holiday) - //uint32 flags; // 54 m_flags (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) + uint32 ID; // 0 + uint32 Duration[MAX_HOLIDAY_DURATIONS]; // 1-10 + uint32 Date[MAX_HOLIDAY_DATES]; // 11-36 dates in unix time starting at January, 1, 2000 + uint32 Region; // 37 WoW region + uint32 Looping; // 38 + uint32 CalendarFlags[MAX_HOLIDAY_FLAGS]; // 39-48 + //uint32 HolidayNameID; // 49 HolidayNames.dbc + //uint32 HolidayDescriptionID; // 50 HolidayDescriptions.dbc + char* TextureFilename; // 51 + uint32 Priority; // 52 + int32 CalendarFilterType; // 53 + //uint32 Flags; // 54 0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1 }; struct ItemEntry { - uint32 ID; // 0 - uint32 Class; // 1 - uint32 SubClass; // 2 some items have strange subclasses - int32 SoundOverrideSubclass; // 3 - int32 Material; // 4 - uint32 DisplayId; // 5 - uint32 InventoryType; // 6 - uint32 Sheath; // 7 + uint32 ID; // 0 + uint32 ClassID; // 1 + uint32 SubclassID; // 2 + int32 SoundOverrideSubclassID; // 3 + int32 Material; // 4 + uint32 DisplayInfoID; // 5 + uint32 InventoryType; // 6 + uint32 SheatheType; // 7 }; struct ItemBagFamilyEntry { - uint32 ID; // 0 - //char* name[16] // 1-16 m_name_lang - // // 17 name flags + uint32 ID; // 0 + //char* Name[16]; // 1-16 + //uint32 Name_lang_mask; // 17 }; +/* struct ItemDisplayInfoEntry { - uint32 ID; // 0 m_ID - // 1 m_modelName[2] - // 2 m_modelTexture[2] - // 3 m_inventoryIcon - // 4 m_geosetGroup[3] - // 5 m_flags - // 6 m_spellVisualID - // 7 m_groupSoundIndex - // 8 m_helmetGeosetVis[2] - // 9 m_texture[2] - // 10 m_itemVisual[8] - // 11 m_particleColorID -}; - -//struct ItemCondExtCostsEntry -//{ -// uint32 ID; -// uint32 condExtendedCost; // ItemTemplate::CondExtendedCost -// uint32 itemextendedcostentry; // ItemTemplate::ExtendedCost -// uint32 arenaseason; // arena season number(1-4) -//}; + uint32 ID; // 0 + char* ModelName[2]; // 1-2 + char* ModelTexture[2]; // 3-4 + char* InventoryIcon[2]; // 5-6 + uint32 GeosetGroup[3]; // 7-9 + uint32 Flags; // 10 + uint32 SpellVisualID; // 11 + uint32 GroupSoundIndex; // 12 + uint32 HelmetGeosetVisID[2]; // 13-14 + char* Texture[8]; // 15-22 + int32 ItemVisual; // 23 + uint32 ParticleColorID; // 24 +}; +*/ + +/* +struct ItemCondExtCostsEntry +{ + uint32 ID; // 0 + uint32 CondExtendedCost; // 1 ItemTemplate::CondExtendedCost + uint32 ItemExtendedCostEntry; // 2 ItemTemplate::ExtendedCost + uint32 ArenaSeason; // 3 arena season number (1-4) +}; +*/ #define MAX_ITEM_EXTENDED_COST_REQUIREMENTS 5 struct ItemExtendedCostEntry { - uint32 ID; // 0 extended-cost entry id - uint32 reqhonorpoints; // 1 required honor points - uint32 reqarenapoints; // 2 required arena points - uint32 reqarenaslot; // 3 arena slot restrctions (min slot value) - uint32 reqitem[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]; // 4-8 required item id - uint32 reqitemcount[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]; // 9-14 required count of 1st item - uint32 reqpersonalarenarating; // 15 required personal arena rating}; + uint32 ID; // 0 + uint32 HonorPoints; // 1 required honor points + uint32 ArenaPoints; // 2 required arena points + uint32 ArenaBracket; // 3 arena slot restrictions (min slot value) + uint32 ItemID[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]; // 4-8 required item id + uint32 ItemCount[MAX_ITEM_EXTENDED_COST_REQUIREMENTS]; // 9-13 required count of item + uint32 RequiredArenaRating; // 14 required personal arena rating + //uint32 ItemPurchaseGroup; // 15 }; struct ItemLimitCategoryEntry { - uint32 ID; // 0 Id - //char* name[16] // 1-16 m_name_lang - // 17 name flags - uint32 maxCount; // 18, max allowed equipped as item or in gem slot - uint32 mode; // 19, 0 = have, 1 = equip (enum ItemLimitCategoryMode) + uint32 ID; // 0 + //char* Name[16] // 1-16 + //uint32 Name_lang_mask; // 17 + uint32 Quantity; // 18 max allowed equipped as item or in gem slot + uint32 Flags; // 19 enum ItemLimitCategoryMode }; #define MAX_ITEM_ENCHANTMENT_EFFECTS 3 struct ItemRandomPropertiesEntry { - uint32 ID; // 0 m_ID - //char* internalName // 1 m_Name - uint32 enchant_id[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 m_Enchantment - // 5-6 unused - char* nameSuffix[16]; // 7-22 m_name_lang - // 23 name flags + uint32 ID; // 0 + //char* InternalName; // 1 + uint32 Enchantment[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 + //uint32 UnusedEnchantment[2]; // 5-6 + char* Name[16]; // 7-22 + //uint32 Name_lang_mask; // 23 }; struct ItemRandomSuffixEntry { - uint32 ID; // 0 m_ID - char* nameSuffix[16]; // 1-16 m_name_lang - // 17, name flags - // 18 m_internalName - uint32 enchant_id[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 19-21 m_enchantment - //uint32 unk1[2] // 22-23 unknown - uint32 prefix[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 24-26 m_allocationPct - //uint32 unk2[2] // 27-28 unknown + uint32 ID; // 0 + char* Name[16]; // 1-16 + //uint32 Name_lang_mask; // 17 + //char* InternalName; // 18 + uint32 Enchantment[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 19-21 + //uint32 UnusedEnchantment[2] // 22-23 + uint32 AllocationPct[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 24-26 + //uint32 UnusedAllocationPct[2] // 27-28 }; #define MAX_ITEM_SET_ITEMS 10 @@ -959,150 +969,144 @@ struct ItemRandomSuffixEntry struct ItemSetEntry { - //uint32 id // 0 m_ID - char* name[16]; // 1-16 m_name_lang - // 17 string flags, unused - uint32 itemId[MAX_ITEM_SET_ITEMS]; // 18-27 m_itemID - //uint32 unknown[7]; // 28-34 unk, all 0 - uint32 spells[MAX_ITEM_SET_SPELLS]; // 35-42 m_setSpellID - uint32 items_to_triggerspell[MAX_ITEM_SET_SPELLS]; // 43-50 m_setThreshold - uint32 required_skill_id; // 51 m_requiredSkill - uint32 required_skill_value; // 52 m_requiredSkillRank + //uint32 ID; // 0 + char* Name[16]; // 1-16 + //uint32 Name_lang_mask; // 17 + uint32 ItemID[MAX_ITEM_SET_ITEMS]; // 18-27 + //uint32 UnusedItemID[7]; // 28-34 + uint32 SetSpellID[MAX_ITEM_SET_SPELLS]; // 35-42 + uint32 SetThreshold[MAX_ITEM_SET_SPELLS]; // 43-50 + uint32 RequiredSkill; // 51 + uint32 RequiredSkillRank; // 52 }; struct LFGDungeonEntry { - uint32 ID; // 0 - char* name[16]; // 1-17 Name lang - uint32 minlevel; // 18 - uint32 maxlevel; // 19 - uint32 reclevel; // 20 - uint32 recminlevel; // 21 - uint32 recmaxlevel; // 22 - int32 map; // 23 - uint32 difficulty; // 24 - uint32 flags; // 25 - uint32 type; // 26 - //uint32 unk; // 27 - //char* iconname; // 28 - uint32 expansion; // 29 - //uint32 unk4; // 30 - uint32 grouptype; // 31 - //char* desc[16]; // 32-47 Description + uint32 ID; // 0 + char* Name[16]; // 1-16 + //uint32 Name_lang_mask; // 17 + uint32 MinLevel; // 18 + uint32 MaxLevel; // 19 + uint32 TargetLevel; // 20 + uint32 TargetLevelMin; // 21 + uint32 TargetLevelMax; // 22 + int32 MapID; // 23 + uint32 Difficulty; // 24 + uint32 Flags; // 25 + uint32 TypeID; // 26 + //int32 Faction; // 27 + //char* TextureFilename; // 28 + uint32 ExpansionLevel; // 29 + //uint32 OrderIndex; // 30 + uint32 GroupID; // 31 + //char* Description[16]; // 32-47 + //uint32 Description_lang_mask; // 48 + // Helpers - uint32 Entry() const { return ID + (type << 24); } + uint32 Entry() const { return ID + (TypeID << 24); } }; struct LightEntry { - uint32 Id; - uint32 MapId; - float X; - float Y; - float Z; - //float FalloffStart; - //float FalloffEnd; - //uint32 SkyAndFog; - //uint32 WaterSettings; - //uint32 SunsetParams; - //uint32 OtherParams; - //uint32 DeathParams; - //uint32 Unknown; - //uint32 Unknown; - //uint32 Unknown; + uint32 ID; // 0 + uint32 ContinentID; // 1 + DBCPosition3D GameCoords; // 2-4 + //float GameFalloffStart; // 5 + //float GameFalloffEnd; // 6 + //uint32 LightParamsID[8]; // 7-14 }; struct LiquidTypeEntry { - uint32 Id; - //char* Name; - //uint32 Flags; - uint32 Type; - //uint32 SoundId; - uint32 SpellId; - //float MaxDarkenDepth; - //float FogDarkenIntensity; - //float AmbDarkenIntensity; - //float DirDarkenIntensity; - //uint32 LightID; - //float ParticleScale; - //uint32 ParticleMovement; - //uint32 ParticleTexSlots; - //uint32 LiquidMaterialID; - //char* Texture[6]; - //uint32 Color[2]; - //float Unk1[18]; - //uint32 Unk2[4]; + uint32 ID; // 0 + //char* Name; // 1 + //uint32 Flags; // 2 + uint32 SoundBank; // 3 + //uint32 SoundID; // 4 + uint32 SpellID; // 5 + //float MaxDarkenDepth; // 6 + //float FogDarkenIntensity; // 7 + //float AmbDarkenIntensity; // 8 + //float DirDarkenIntensity; // 9 + //uint32 LightID; // 10 + //float ParticleScale; // 11 + //uint32 ParticleMovement; // 12 + //uint32 ParticleTexSlots; // 13 + //uint32 MaterialID; // 14 + //char* Texture[6]; // 15-20 + //uint32 Color[2]; // 21-22 + //float Unk1[18]; // 23-40 + //uint32 Unk2[4]; // 41-44 }; #define MAX_LOCK_CASE 8 struct LockEntry { - uint32 ID; // 0 m_ID - uint32 Type[MAX_LOCK_CASE]; // 1-8 m_Type - uint32 Index[MAX_LOCK_CASE]; // 9-16 m_Index - uint32 Skill[MAX_LOCK_CASE]; // 17-24 m_Skill - //uint32 Action[MAX_LOCK_CASE]; // 25-32 m_Action + uint32 ID; // 0 + uint32 Type[MAX_LOCK_CASE]; // 1-8 + uint32 Index[MAX_LOCK_CASE]; // 9-16 + uint32 Skill[MAX_LOCK_CASE]; // 17-24 + //uint32 Action[MAX_LOCK_CASE]; // 25-32 }; struct MailTemplateEntry { - uint32 ID; // 0 - //char* subject[16]; // 1-16 - // 17 name flags, unused - char* content[16]; // 18-33 + uint32 ID; // 0 + //char* Subject[16]; // 1-16 + //uint32 Subject_lang_mask; // 17 + char* Body[16]; // 18-33 + //uint32 Body_lang_mask; // 34 }; struct MapEntry { - uint32 MapID; // 0 - //char* internalname; // 1 unused - uint32 map_type; // 2 - uint32 Flags; // 3 - // 4 0 or 1 for battlegrounds (not arenas) - char* name[16]; // 5-20 - // 21 name flags, unused - uint32 linked_zone; // 22 common zone for instance and continent map - //char* hordeIntro[16]; // 23-38 text for PvP Zones - // 39 intro text flags - //char* allianceIntro[16]; // 40-55 text for PvP Zones - // 56 intro text flags - uint32 multimap_id; // 57 - //float BattlefieldMapIconScale; // 58 - int32 entrance_map; // 59 map_id of entrance map - float entrance_x; // 60 entrance x coordinate (if exist single entry) - float entrance_y; // 61 entrance y coordinate (if exist single entry) + uint32 ID; // 0 + //char* Directory; // 1 + uint32 InstanceType; // 2 + uint32 Flags; // 3 + //uint32 MapType; // 4 0 or 1 for battlegrounds (not arenas) + char* MapName[16]; // 5-20 + //uint32 MapName_lang_mask; // 21 + uint32 AreaTableID; // 22 common zone for instance and continent map + //char* MapDescription0[16]; // 23-38 text for PvP Zones (Horde) + //uint32 MapDescription0_lang_mask; // 39 + //char* MapDescription1[16]; // 40-55 text for PvP Zones (Alliance) + //uint32 MapDescription1_lang_mask; // 56 + uint32 LoadingScreenID; // 57 + //float MinimapIconScale; // 58 + int32 CorpseMapID; // 59 MapID of entrance map + DBCPosition2D Corpse; // 60-61 entrance coordinate (if exist single entry) //uint32 TimeOfDayOverride; // 62 -1, 0 and 720 - uint32 addon; // 63 (0-original maps, 1-tbc addon) - uint32 unk_time; // 64 some kind of time? - uint32 maxPlayers; // 65 max players, fallback if not present in MapDifficulty.dbc + uint32 ExpansionID; // 63 + uint32 RaidOffset; // 64 + uint32 MaxPlayers; // 65 max players, fallback if not present in MapDifficulty.dbc // Helpers - uint32 Expansion() const { return addon; } + uint32 Expansion() const { return ExpansionID; } - bool IsDungeon() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID; } - bool IsNonRaidDungeon() const { return map_type == MAP_INSTANCE; } - bool Instanceable() const { return map_type == MAP_INSTANCE || map_type == MAP_RAID || map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; } - bool IsRaid() const { return map_type == MAP_RAID; } - bool IsBattleground() const { return map_type == MAP_BATTLEGROUND; } - bool IsBattleArena() const { return map_type == MAP_ARENA; } - bool IsBattlegroundOrArena() const { return map_type == MAP_BATTLEGROUND || map_type == MAP_ARENA; } - bool IsWorldMap() const { return map_type == MAP_COMMON; } + bool IsDungeon() const { return InstanceType == MAP_INSTANCE || InstanceType == MAP_RAID; } + bool IsNonRaidDungeon() const { return InstanceType == MAP_INSTANCE; } + bool Instanceable() const { return InstanceType == MAP_INSTANCE || InstanceType == MAP_RAID || InstanceType == MAP_BATTLEGROUND || InstanceType == MAP_ARENA; } + bool IsRaid() const { return InstanceType == MAP_RAID; } + bool IsBattleground() const { return InstanceType == MAP_BATTLEGROUND; } + bool IsBattleArena() const { return InstanceType == MAP_ARENA; } + bool IsBattlegroundOrArena() const { return InstanceType == MAP_BATTLEGROUND || InstanceType == MAP_ARENA; } + bool IsWorldMap() const { return InstanceType == MAP_COMMON; } bool GetEntrancePos(int32 &mapid, float &x, float &y) const { - if (entrance_map < 0) + if (CorpseMapID < 0) return false; - mapid = entrance_map; - x = entrance_x; - y = entrance_y; + mapid = CorpseMapID; + x = Corpse.X; + y = Corpse.Y; return true; } bool IsContinent() const { - return MapID == 0 || MapID == 1 || MapID == 530 || MapID == 571; + return ID == 0 || ID == 1 || ID == 530 || ID == 571; } bool IsDynamicDifficultyMap() const { return (Flags & MAP_FLAG_DYNAMIC_DIFFICULTY) != 0; } @@ -1110,127 +1114,141 @@ struct MapEntry struct MapDifficultyEntry { - //uint32 Id; // 0 - uint32 MapId; // 1 - uint32 Difficulty; // 2 (for arenas: arena slot) - char* areaTriggerText; // 3-18 text showed when transfer to map failed (missing requirements) - //uint32 textFlags; // 19 - uint32 resetTime; // 20 - uint32 maxPlayers; // 21 - //char* difficultyString; // 22 + //uint32 ID; // 0 + uint32 MapID; // 1 + uint32 Difficulty; // 2 (for arenas: arena slot) + char* Message; // 3-18 text showed when transfer to map failed (missing requirements) + //uint32 Message_lang_mask; // 19 + uint32 RaidDuration; // 20 + uint32 MaxPlayers; // 21 + //char* Difficultystring; // 22 }; struct MovieEntry { - uint32 Id; // 0 index - //char* filename; // 1 - //uint32 unk2; // 2 always 100 + uint32 ID; // 0 + //char* Filename; // 1 + //uint32 Volume; // 2 always 100 }; struct NamesProfanityEntry { - //uint32 ID; // 0 - char const* Name; // 1 - int32 Language; // 2 + //uint32 ID; // 0 + char* Name; // 1 + int32 Language; // 2 }; struct NamesReservedEntry { - //uint32 ID; // 0 - char const* Name; // 1 - int32 Language; // 2 + //uint32 ID; // 0 + char* Name; // 1 + int32 Language; // 2 }; #define MAX_OVERRIDE_SPELL 10 struct OverrideSpellDataEntry { - uint32 id; // 0 - uint32 spellId[MAX_OVERRIDE_SPELL]; // 1-10 - //uint32 unk0; // 11 + uint32 ID; // 0 + uint32 Spells[MAX_OVERRIDE_SPELL]; // 1-10 + //uint32 Flags; // 11 }; struct PowerDisplayEntry { - uint32 Id; // 0 - uint32 PowerType; // 1 - //char* Name; // 2 - //uint32 R; // 3 - //uint32 G; // 4 - //uint32 B; // 5 + uint32 ID; // 0 + uint32 ActualType; // 1 + //char* GlobalStringBaseTag; // 2 + //uint8 Red; // 3 + //uint8 Green; // 4 + //uint8 Blue; // 5 }; struct PvPDifficultyEntry { - //uint32 id; // 0 m_ID - uint32 mapId; // 1 - uint32 bracketId; // 2 - uint32 minLevel; // 3 - uint32 maxLevel; // 4 - uint32 difficulty; // 5 + //uint32 ID; // 0 + uint32 MapID; // 1 + uint32 RangeIndex; // 2 + uint32 MinLevel; // 3 + uint32 MaxLevel; // 4 + uint32 Difficulty; // 5 // helpers - BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(bracketId); } + BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(RangeIndex); } }; struct QuestSortEntry { - uint32 id; // 0 m_ID - //char* name[16]; // 1-16 m_SortName_lang - // 17 name flags + uint32 ID; // 0 + //char* SortName[16]; // 1-16 + //uint32 SortName_lang; // 17 }; struct QuestXPEntry { - uint32 id; - uint32 Exp[10]; + uint32 ID; // 0 + uint32 Difficulty[10]; // 1-10 }; struct QuestFactionRewEntry { - uint32 id; - int32 QuestRewFactionValue[10]; + uint32 ID; // 0 + int32 Difficulty[10]; // 1 }; -struct RandomPropertiesPointsEntry +struct RandPropPointsEntry { - //uint32 Id; // 0 hidden key - uint32 itemLevel; // 1 - uint32 EpicPropertiesPoints[5]; // 2-6 - uint32 RarePropertiesPoints[5]; // 7-11 - uint32 UncommonPropertiesPoints[5]; // 12-16 + uint32 ID; // 0 item level + uint32 Epic[5]; // 1-5 + uint32 Superior[5]; // 6-10 + uint32 Good[5]; // 11-15 }; struct ScalingStatDistributionEntry { - uint32 Id; // 0 - int32 StatMod[10]; // 1-10 - uint32 Modifier[10]; // 11-20 - uint32 MaxLevel; // 21 + uint32 ID; // 0 + int32 StatID[10]; // 1-10 + uint32 Bonus[10]; // 11-20 + uint32 Maxlevel; // 21 }; struct ScalingStatValuesEntry { - uint32 Id; // 0 - uint32 Level; // 1 - uint32 ssdMultiplier[4]; // 2-5 Multiplier for ScalingStatDistribution - uint32 armorMod[4]; // 6-9 Armor for level - uint32 dpsMod[6]; // 10-15 DPS mod for level - uint32 spellPower; // 16 spell power for level - uint32 ssdMultiplier2; // 17 there's data from 3.1 dbc ssdMultiplier[3] - uint32 ssdMultiplier3; // 18 3.3 - uint32 armorMod2[5]; // 19-23 Armor for level + uint32 ID; // 0 + uint32 Charlevel; // 1 + uint32 ShoulderBudget; // 2 + uint32 TrinketBudget; // 3 + uint32 WeaponBudget1H; // 4 + uint32 RangedBudget; // 5 + uint32 ClothShoulderArmor; // 6 + uint32 LeatherShoulderArmor; // 7 + uint32 MailShoulderArmor; // 8 + uint32 PlateShoulderArmor; // 9 + uint32 WeaponDPS1H; // 10 + uint32 WeaponDPS2H; // 11 + uint32 SpellcasterDPS1H; // 12 + uint32 SpellcasterDPS2H; // 13 + uint32 RangedDPS; // 14 + uint32 WandDPS; // 15 + uint32 SpellPower; // 16 + uint32 PrimaryBudget; // 17 + uint32 TertiaryBudget; // 18 + uint32 ClothCloakArmor; // 19 + uint32 ClothChestArmor; // 20 + uint32 LeatherChestArmor; // 21 + uint32 MailChestArmor; // 22 + uint32 PlateChestArmor; // 23 uint32 getssdMultiplier(uint32 mask) const { if (mask & 0x4001F) { - if (mask & 0x00000001) return ssdMultiplier[0]; // Shoulder - if (mask & 0x00000002) return ssdMultiplier[1]; // Trinket - if (mask & 0x00000004) return ssdMultiplier[2]; // Weapon1H - if (mask & 0x00000008) return ssdMultiplier2; - if (mask & 0x00000010) return ssdMultiplier[3]; // Ranged - if (mask & 0x00040000) return ssdMultiplier3; + if (mask & 0x00000001) return ShoulderBudget; + if (mask & 0x00000002) return TrinketBudget; + if (mask & 0x00000004) return WeaponBudget1H; + if (mask & 0x00000008) return PrimaryBudget; + if (mask & 0x00000010) return RangedBudget; + if (mask & 0x00040000) return TertiaryBudget; } return 0; } @@ -1239,16 +1257,16 @@ struct ScalingStatValuesEntry { if (mask & 0x00F001E0) { - if (mask & 0x00000020) return armorMod[0]; // Cloth shoulder - if (mask & 0x00000040) return armorMod[1]; // Leather shoulder - if (mask & 0x00000080) return armorMod[2]; // Mail shoulder - if (mask & 0x00000100) return armorMod[3]; // Plate shoulder - - if (mask & 0x00080000) return armorMod2[0]; // cloak - if (mask & 0x00100000) return armorMod2[1]; // cloth - if (mask & 0x00200000) return armorMod2[2]; // leather - if (mask & 0x00400000) return armorMod2[3]; // mail - if (mask & 0x00800000) return armorMod2[4]; // plate + if (mask & 0x00000020) return ClothShoulderArmor; + if (mask & 0x00000040) return LeatherShoulderArmor; + if (mask & 0x00000080) return MailShoulderArmor; + if (mask & 0x00000100) return PlateShoulderArmor; + + if (mask & 0x00080000) return ClothCloakArmor; + if (mask & 0x00100000) return ClothChestArmor; + if (mask & 0x00200000) return LeatherChestArmor; + if (mask & 0x00400000) return MailChestArmor; + if (mask & 0x00800000) return PlateChestArmor; } return 0; } @@ -1257,19 +1275,19 @@ struct ScalingStatValuesEntry { if (mask & 0x7E00) { - if (mask & 0x00000200) return dpsMod[0]; // Weapon 1h - if (mask & 0x00000400) return dpsMod[1]; // Weapon 2h - if (mask & 0x00000800) return dpsMod[2]; // Caster dps 1h - if (mask & 0x00001000) return dpsMod[3]; // Caster dps 2h - if (mask & 0x00002000) return dpsMod[4]; // Ranged - if (mask & 0x00004000) return dpsMod[5]; // Wand + if (mask & 0x00000200) return WeaponDPS1H; + if (mask & 0x00000400) return WeaponDPS2H; + if (mask & 0x00000800) return SpellcasterDPS1H; + if (mask & 0x00001000) return SpellcasterDPS2H; + if (mask & 0x00002000) return RangedDPS; + if (mask & 0x00004000) return WandDPS; } return 0; } uint32 getSpellBonus(uint32 mask) const { - if (mask & 0x00008000) return spellPower; + if (mask & 0x00008000) return SpellPower; return 0; } @@ -1280,191 +1298,194 @@ struct ScalingStatValuesEntry } }; -//struct SkillLineCategoryEntry{ -// uint32 id; // 0 m_ID -// char* name[16]; // 1-17 m_name_lang -// // 18 string flag -// uint32 displayOrder; // 19 m_sortIndex -//}; - struct SkillLineEntry { - uint32 id; // 0 m_ID - int32 categoryId; // 1 m_categoryID - //uint32 skillCostID; // 2 m_skillCostsID - char* name[16]; // 3-18 m_displayName_lang - // 19 string flags - //char* description[16]; // 20-35 m_description_lang - // 36 string flags - uint32 spellIcon; // 37 m_spellIconID - //char* alternateVerb[16]; // 38-53 m_alternateVerb_lang - // 54 string flags - uint32 canLink; // 55 m_canLink (prof. with recipes + uint32 ID; // 0 + int32 CategoryID; // 1 + //uint32 SkillCostsID; // 2 + char* DisplayName[16]; // 3-18 + //uint32 DisplayName_lang_mask; // 19 + //char* Description[16]; // 20-35 + //uint32 Description_lang_mask; // 36 + uint32 SpellIconID; // 37 + //char* AlternateVerb[16]; // 38-53 + //uint32 AlternateVerb_lang_mask; // 54 + uint32 CanLink; // 55 }; struct SkillLineAbilityEntry { - uint32 id; // 0 m_ID - uint32 skillId; // 1 m_skillLine - uint32 spellId; // 2 m_spell - uint32 racemask; // 3 m_raceMask - uint32 classmask; // 4 m_classMask - //uint32 racemaskNot; // 5 m_excludeRace - //uint32 classmaskNot; // 6 m_excludeClass - uint32 req_skill_value; // 7 m_minSkillLineRank - uint32 forward_spellid; // 8 m_supercededBySpell - uint32 AutolearnType; // 9 m_acquireMethod - uint32 max_value; // 10 m_trivialSkillLineRankHigh - uint32 min_value; // 11 m_trivialSkillLineRankLow - //uint32 characterPoints[2]; // 12-13 m_characterPoints[2] + uint32 ID; // 0 + uint32 SkillLine; // 1 + uint32 Spell; // 2 + uint32 RaceMask; // 3 + uint32 ClassMask; // 4 + //uint32 ExcludeRace; // 5 + //uint32 ExcludeClass; // 6 + uint32 MinSkillLineRank; // 7 + uint32 SupercededBySpell; // 8 + uint32 AcquireMethod; // 9 + uint32 TrivialSkillLineRankHigh; // 10 + uint32 TrivialSkillLineRankLow; // 11 + //uint32 CharacterPoints[2]; // 12-13 }; +/* +struct SkillLineCategoryEntry +{ + uint32 ID; // 0 + char* Name[16]; // 1-17 + uint32 Name_lang_mask; // 18 + uint32 SortIndex; // 19 +}; +*/ + struct SkillRaceClassInfoEntry { - //uint32 Id; // 0 - uint32 SkillId; // 1 + //uint32 ID; // 0 + uint32 SkillID; // 1 uint32 RaceMask; // 2 uint32 ClassMask; // 3 uint32 Flags; // 4 //uint32 MinLevel; // 5 - uint32 SkillTier; // 6 - //uint32 SkillCostType; // 7 + uint32 SkillTierID; // 6 + //uint32 SkillCostIndex; // 7 }; #define MAX_SKILL_STEP 16 struct SkillTiersEntry { - uint32 Id; // 0 - //uint32 StepCost[MAX_SKILL_STEP]; // 1-16 - uint32 MaxSkill[MAX_SKILL_STEP]; // 17-32 + uint32 ID; // 0 + //uint32 Cost[MAX_SKILL_STEP]; // 1-16 + uint32 Value[MAX_SKILL_STEP]; // 17-32 }; struct SoundEntriesEntry { - uint32 Id; // 0 m_ID - //uint32 Type; // 1 m_soundType - //char* InternalName; // 2 m_name - //char* FileName[10]; // 3-12 m_File[10] - //uint32 Unk13[10]; // 13-22 m_Freq[10] - //char* Path; // 23 m_DirectoryBase - // 24 m_volumeFloat - // 25 m_flags - // 26 m_minDistance - // 27 m_distanceCutoff - // 28 m_EAXDef - // 29 new in 3.1 + uint32 ID; // 0 + //uint32 SoundType; // 1 + //char* Name; // 2 + //char* File[10]; // 3-12 + //uint32 Freq[10]; // 13-22 + //char* DirectoryBase; // 23 + //float VolumeFloat; // 24 + //uint32 Flags; // 25 + //float MinDistance; // 26 + //float DistanceCutoff; // 27 + //uint32 EAXDef; // 28 + //uint32 SoundEntriesAdvancedID; // 29 }; struct SpellEntry { - uint32 Id; // 0 m_ID - uint32 Category; // 1 m_category - uint32 Dispel; // 2 m_dispelType - uint32 Mechanic; // 3 m_mechanic - uint32 Attributes; // 4 m_attributes - uint32 AttributesEx; // 5 m_attributesEx - uint32 AttributesEx2; // 6 m_attributesExB - uint32 AttributesEx3; // 7 m_attributesExC - uint32 AttributesEx4; // 8 m_attributesExD - uint32 AttributesEx5; // 9 m_attributesExE - uint32 AttributesEx6; // 10 m_attributesExF - uint32 AttributesEx7; // 11 m_attributesExG - uint32 Stances[2]; // 12 m_shapeshiftMask - uint32 StancesNot[2]; // 14 m_shapeshiftExclude - uint32 Targets; // 16 m_targets - uint32 TargetCreatureType; // 17 m_targetCreatureType - uint32 RequiresSpellFocus; // 18 m_requiresSpellFocus - uint32 FacingCasterFlags; // 19 m_facingCasterFlags - uint32 CasterAuraState; // 20 m_casterAuraState - uint32 TargetAuraState; // 21 m_targetAuraState - uint32 CasterAuraStateNot; // 22 m_excludeCasterAuraState - uint32 TargetAuraStateNot; // 23 m_excludeTargetAuraState - uint32 casterAuraSpell; // 24 m_casterAuraSpell - uint32 targetAuraSpell; // 25 m_targetAuraSpell - uint32 excludeCasterAuraSpell; // 26 m_excludeCasterAuraSpell - uint32 excludeTargetAuraSpell; // 27 m_excludeTargetAuraSpell - uint32 CastingTimeIndex; // 28 m_castingTimeIndex - uint32 RecoveryTime; // 29 m_recoveryTime - uint32 CategoryRecoveryTime; // 30 m_categoryRecoveryTime - uint32 InterruptFlags; // 31 m_interruptFlags - uint32 AuraInterruptFlags; // 32 m_auraInterruptFlags - uint32 ChannelInterruptFlags; // 33 m_channelInterruptFlags - uint32 procFlags; // 34 m_procTypeMask - uint32 procChance; // 35 m_procChance - uint32 procCharges; // 36 m_procCharges - uint32 maxLevel; // 37 m_maxLevel - uint32 baseLevel; // 38 m_baseLevel - uint32 spellLevel; // 39 m_spellLevel - uint32 DurationIndex; // 40 m_durationIndex - uint32 powerType; // 41 m_powerType - uint32 manaCost; // 42 m_manaCost - uint32 manaCostPerlevel; // 43 m_manaCostPerLevel - uint32 manaPerSecond; // 44 m_manaPerSecond - uint32 manaPerSecondPerLevel; // 45 m_manaPerSecondPerLeve - uint32 rangeIndex; // 46 m_rangeIndex - float speed; // 47 m_speed - //uint32 modalNextSpell; // 48 m_modalNextSpell not used - uint32 StackAmount; // 49 m_cumulativeAura - uint32 Totem[2]; // 50-51 m_totem - int32 Reagent[MAX_SPELL_REAGENTS]; // 52-59 m_reagent - uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 60-67 m_reagentCount - int32 EquippedItemClass; // 68 m_equippedItemClass (value) - int32 EquippedItemSubClassMask; // 69 m_equippedItemSubclass (mask) - int32 EquippedItemInventoryTypeMask; // 70 m_equippedItemInvTypes (mask) - uint32 Effect[MAX_SPELL_EFFECTS]; // 71-73 m_effect - int32 EffectDieSides[MAX_SPELL_EFFECTS]; // 74-76 m_effectDieSides - float EffectRealPointsPerLevel[MAX_SPELL_EFFECTS]; // 77-79 m_effectRealPointsPerLevel - int32 EffectBasePoints[MAX_SPELL_EFFECTS]; // 80-82 m_effectBasePoints (must not be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints) - uint32 EffectMechanic[MAX_SPELL_EFFECTS]; // 83-85 m_effectMechanic - uint32 EffectImplicitTargetA[MAX_SPELL_EFFECTS]; // 86-88 m_implicitTargetA - uint32 EffectImplicitTargetB[MAX_SPELL_EFFECTS]; // 89-91 m_implicitTargetB - uint32 EffectRadiusIndex[MAX_SPELL_EFFECTS]; // 92-94 m_effectRadiusIndex - spellradius.dbc - uint32 EffectApplyAuraName[MAX_SPELL_EFFECTS]; // 95-97 m_effectAura - uint32 EffectAmplitude[MAX_SPELL_EFFECTS]; // 98-100 m_effectAuraPeriod - float EffectValueMultiplier[MAX_SPELL_EFFECTS]; // 101-103 - uint32 EffectChainTarget[MAX_SPELL_EFFECTS]; // 104-106 m_effectChainTargets - uint32 EffectItemType[MAX_SPELL_EFFECTS]; // 107-109 m_effectItemType - int32 EffectMiscValue[MAX_SPELL_EFFECTS]; // 110-112 m_effectMiscValue - int32 EffectMiscValueB[MAX_SPELL_EFFECTS]; // 113-115 m_effectMiscValueB - uint32 EffectTriggerSpell[MAX_SPELL_EFFECTS]; // 116-118 m_effectTriggerSpell - float EffectPointsPerComboPoint[MAX_SPELL_EFFECTS]; // 119-121 m_effectPointsPerCombo - flag96 EffectSpellClassMask[MAX_SPELL_EFFECTS]; // 122-130 - uint32 SpellVisual[2]; // 131-132 m_spellVisualID - uint32 SpellIconID; // 133 m_spellIconID - uint32 activeIconID; // 134 m_activeIconID - uint32 SpellPriority; // 135 m_spellPriority - char* SpellName[16]; // 136-151 m_name_lang - //uint32 SpellNameFlag; // 152 not used - char* Rank[16]; // 153-168 m_nameSubtext_lang - //uint32 RankFlags; // 169 not used - //char* Description[16]; // 170-185 m_description_lang not used - //uint32 DescriptionFlags; // 186 not used - //char* ToolTip[16]; // 187-202 m_auraDescription_lang not used - //uint32 ToolTipFlags; // 203 not used - uint32 ManaCostPercentage; // 204 m_manaCostPct - uint32 StartRecoveryCategory; // 205 m_startRecoveryCategory - uint32 StartRecoveryTime; // 206 m_startRecoveryTime - uint32 MaxTargetLevel; // 207 m_maxTargetLevel - uint32 SpellFamilyName; // 208 m_spellClassSet - flag96 SpellFamilyFlags; // 209-211 - uint32 MaxAffectedTargets; // 212 m_maxTargets - uint32 DmgClass; // 213 m_defenseType - uint32 PreventionType; // 214 m_preventionType - //uint32 StanceBarOrder; // 215 m_stanceBarOrder not used - float EffectDamageMultiplier[MAX_SPELL_EFFECTS]; // 216-218 m_effectChainAmplitude - //uint32 MinFactionId; // 219 m_minFactionID not used - //uint32 MinReputation; // 220 m_minReputation not used - //uint32 RequiredAuraVision; // 221 m_requiredAuraVision not used - uint32 TotemCategory[2]; // 222-223 m_requiredTotemCategoryID - int32 AreaGroupId; // 224 m_requiredAreaGroupId - uint32 SchoolMask; // 225 m_schoolMask - uint32 runeCostID; // 226 m_runeCostID - //uint32 spellMissileID; // 227 m_spellMissileID not used - //uint32 PowerDisplayId; // 228 PowerDisplay.dbc, new in 3.1 - float EffectBonusMultiplier[MAX_SPELL_EFFECTS]; // 229-231 3.2.0 - //uint32 spellDescriptionVariableID; // 232 3.2.0 - //uint32 SpellDifficultyId; // 233 3.3.0 + uint32 ID; // 0 + uint32 Category; // 1 + uint32 DispelType; // 2 + uint32 Mechanic; // 3 + uint32 Attributes; // 4 + uint32 AttributesEx; // 5 + uint32 AttributesExB; // 6 + uint32 AttributesExC; // 7 + uint32 AttributesExD; // 8 + uint32 AttributesExE; // 9 + uint32 AttributesExF; // 10 + uint32 AttributesExG; // 11 + uint32 ShapeshiftMask[2]; // 12 + uint32 ShapeshiftExclude[2]; // 14 + uint32 Targets; // 16 + uint32 TargetCreatureType; // 17 + uint32 RequiresSpellFocus; // 18 + uint32 FacingCasterFlags; // 19 + uint32 CasterAuraState; // 20 + uint32 TargetAuraState; // 21 + uint32 ExcludeCasterAuraState; // 22 + uint32 ExcludeTargetAuraState; // 23 + uint32 CasterAuraSpell; // 24 + uint32 TargetAuraSpell; // 25 + uint32 ExcludeCasterAuraSpell; // 26 + uint32 ExcludeTargetAuraSpell; // 27 + uint32 CastingTimeIndex; // 28 + uint32 RecoveryTime; // 29 + uint32 CategoryRecoveryTime; // 30 + uint32 InterruptFlags; // 31 + uint32 AuraInterruptFlags; // 32 + uint32 ChannelInterruptFlags; // 33 + uint32 ProcTypeMask; // 34 + uint32 ProcChance; // 35 + uint32 ProcCharges; // 36 + uint32 MaxLevel; // 37 + uint32 BaseLevel; // 38 + uint32 SpellLevel; // 39 + uint32 DurationIndex; // 40 + uint32 PowerType; // 41 + uint32 ManaCost; // 42 + uint32 ManaCostPerLevel; // 43 + uint32 ManaPerSecond; // 44 + uint32 ManaPerSecondPerLevel; // 45 + uint32 RangeIndex; // 46 + float Speed; // 47 + //uint32 ModalNextSpell; // 48 + uint32 CumulativeAura; // 49 + uint32 Totem[2]; // 50-51 + int32 Reagent[MAX_SPELL_REAGENTS]; // 52-59 + uint32 ReagentCount[MAX_SPELL_REAGENTS]; // 60-67 + int32 EquippedItemClass; // 68 + int32 EquippedItemSubclass; // 69 + int32 EquippedItemInvTypes; // 70 + uint32 Effect[MAX_SPELL_EFFECTS]; // 71-73 + int32 EffectDieSides[MAX_SPELL_EFFECTS]; // 74-76 + float EffectRealPointsPerLevel[MAX_SPELL_EFFECTS]; // 77-79 + int32 EffectBasePoints[MAX_SPELL_EFFECTS]; // 80-82 + uint32 EffectMechanic[MAX_SPELL_EFFECTS]; // 83-85 + uint32 EffectImplicitTargetA[MAX_SPELL_EFFECTS]; // 86-88 + uint32 EffectImplicitTargetB[MAX_SPELL_EFFECTS]; // 89-91 + uint32 EffectRadiusIndex[MAX_SPELL_EFFECTS]; // 92-94 + uint32 EffectAura[MAX_SPELL_EFFECTS]; // 95-97 + uint32 EffectAuraPeriod[MAX_SPELL_EFFECTS]; // 98-100 + float EffectAmplitude[MAX_SPELL_EFFECTS]; // 101-103 + uint32 EffectChainTargets[MAX_SPELL_EFFECTS]; // 104-106 + uint32 EffectItemType[MAX_SPELL_EFFECTS]; // 107-109 + int32 EffectMiscValue[MAX_SPELL_EFFECTS]; // 110-112 + int32 EffectMiscValueB[MAX_SPELL_EFFECTS]; // 113-115 + uint32 EffectTriggerSpell[MAX_SPELL_EFFECTS]; // 116-118 + float EffectPointsPerCombo[MAX_SPELL_EFFECTS]; // 119-121 + flag96 EffectSpellClassMask[MAX_SPELL_EFFECTS]; // 122-130 + uint32 SpellVisualID[2]; // 131-132 + uint32 SpellIconID; // 133 + uint32 ActiveIconID; // 134 + uint32 SpellPriority; // 135 + char* Name[16]; // 136-151 + //uint32 Name_lang_mask; // 152 + char* NameSubtext[16]; // 153-168 + //uint32 NameSubtext_lang_mask; // 169 + //char* Description[16]; // 170-185 + //uint32 Description_lang_mask; // 186 + //char* AuraDescription[16]; // 187-202 + //uint32 AuraDescription_lang_mask; // 203 + uint32 ManaCostPct; // 204 + uint32 StartRecoveryCategory; // 205 + uint32 StartRecoveryTime; // 206 + uint32 MaxTargetLevel; // 207 + uint32 SpellClassSet; // 208 + flag96 SpellClassMask; // 209-211 + uint32 MaxTargets; // 212 + uint32 DefenseType; // 213 + uint32 PreventionType; // 214 + //uint32 StanceBarOrder; // 215 + float EffectChainAmplitude[MAX_SPELL_EFFECTS]; // 216-218 + //uint32 MinFactionID; // 219 + //uint32 MinReputation; // 220 + //uint32 RequiredAuraVision; // 221 + uint32 RequiredTotemCategoryID[2]; // 222-223 + int32 RequiredAreasID; // 224 + uint32 SchoolMask; // 225 + uint32 RuneCostID; // 226 + //uint32 SpellMissileID; // 227 + //uint32 PowerDisplayID; // 228 + float EffectBonusCoefficient[MAX_SPELL_EFFECTS]; // 229-231 + //uint32 DescriptionVariablesID; // 232 + //uint32 Difficulty; // 233 }; typedef std::set<uint32> PetFamilySpellsSet; @@ -1472,359 +1493,354 @@ typedef std::map<uint32, PetFamilySpellsSet> PetFamilySpellsStore; struct SpellCastTimesEntry { - uint32 ID; // 0 - int32 CastTime; // 1 - //float CastTimePerLevel; // 2 unsure / per skill? - //int32 MinCastTime; // 3 unsure + uint32 ID; // 0 + int32 Base; // 1 + //int32 PerLevel; // 2 + //int32 Minimum; // 3 }; struct SpellCategoryEntry { - uint32 Id; - uint32 Flags; + uint32 ID; // 0 + uint32 Flags; // 1 }; struct SpellDifficultyEntry { - uint32 ID; // 0 - int32 SpellID[MAX_DIFFICULTY]; // 1-4 instance modes: 10N, 25N, 10H, 25H or Normal/Heroic if only 1-2 is set, if 3-4 is 0 then Mode-2 + uint32 ID; // 0 + int32 DifficultySpellID[MAX_DIFFICULTY]; // 1-4 instance modes: 10N, 25N, 10H, 25H or Normal/Heroic if only 1-2 is set, if 3-4 is 0 then Mode-2 }; -struct SpellFocusObjectEntry +struct SpellDurationEntry { - uint32 ID; // 0 - //char* Name[16]; // 1-15 unused - // 16 string flags, unused + uint32 ID; // 0 + int32 Duration; // 1 + int32 DurationPerLevel; // 2 + int32 MaxDuration; // 3 }; -struct SpellRadiusEntry +struct SpellFocusObjectEntry { - uint32 ID; - float RadiusMin; - float RadiusPerLevel; - float RadiusMax; + uint32 ID; // 0 + //char* Name[16]; // 1-15 + //uint32 Name_lang_mask; // 16 }; -struct SpellRangeEntry +struct SpellItemEnchantmentEntry { - uint32 ID; - float minRangeHostile; - float minRangeFriend; - float maxRangeHostile; - float maxRangeFriend; - uint32 type; - //char* Name[16]; // 7-23 unused - // 24 string flags, unused - //char* Name2[16]; // 25-40 unused - // 41 string flags, unused + uint32 ID; // 0 + //uint32 Charges; // 1 + uint32 Effect[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 + uint32 EffectPointsMin[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 5-7 + //uint32 EffectPointsMax[MAX_ITEM_ENCHANTMENT_EFFECTS] // 8-10 + uint32 EffectArg[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 11-13 + char* Name[16]; // 14-29 + //uint32 Name_lang_mask; // 30 + uint32 ItemVisual; // 31 + uint32 Flags; // 32 + uint32 SrcItemID; // 33 + uint32 ConditionID; // 34 + uint32 RequiredSkillID; // 35 + uint32 RequiredSkillRank; // 36 + uint32 MinLevel; // 37 }; -struct SpellRuneCostEntry +struct SpellItemEnchantmentConditionEntry { - uint32 ID; // 0 - uint32 RuneCost[3]; // 1-3 (0=blood, 1=frost, 2=unholy) - uint32 runePowerGain; // 4 - - bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; } - bool NoRunicPowerGain() const { return runePowerGain == 0; } + uint32 ID; // 0 + uint8 LtOperandType[5]; // 1-5 + //uint32 LtOperand[5]; // 6-10 + uint8 Operator[5]; // 11-15 + uint8 RtOperandType[5]; // 15-20 + uint32 RtOperand[5]; // 21-25 + //uint8 Logic[5]; // 25-30 }; -#define MAX_SHAPESHIFT_SPELLS 8 - -struct SpellShapeshiftEntry +struct SpellRadiusEntry { uint32 ID; // 0 - //uint32 buttonPosition; // 1 unused - //char* Name[16]; // 2-17 unused - //uint32 NameFlags; // 18 unused - uint32 flags1; // 19 - int32 creatureType; // 20 <= 0 humanoid, other normal creature types - //uint32 unk1; // 21 unused - uint32 attackSpeed; // 22 - uint32 modelID_A; // 23 alliance modelid - uint32 modelID_H; // 24 horde modelid (only one form) - //uint32 unk3; // 25 unused - //uint32 unk4; // 26 unused - uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]; // 27 - 34 unused + float Radius; // 1 + float RadiusPerLevel; // 2 + float RadiusMax; // 3 }; -struct SpellDurationEntry +struct SpellRangeEntry { - uint32 ID; - int32 Duration[3]; + uint32 ID; // 0 + float RangeMin[2]; // 1-2 [0] Hostile [1] Friendly + float RangeMax[2]; // 3-4 [0] Hostile [1] Friendly + uint32 Flags; // 5 + //char* DisplayName[16]; // 6-21 + //uint32 DisplayName_lang_mask; // 22 + //char* DisplayNameShort[16]; // 23-38 + //uint32 DisplayNameShort_lang_mask; // 39 }; -struct SpellItemEnchantmentEntry +struct SpellRuneCostEntry { - uint32 ID; // 0 m_ID - //uint32 charges; // 1 m_charges - uint32 type[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 m_effect[MAX_ITEM_ENCHANTMENT_EFFECTS] - uint32 amount[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 5-7 m_effectPointsMin[MAX_ITEM_ENCHANTMENT_EFFECTS] - //uint32 amount2[MAX_ITEM_ENCHANTMENT_EFFECTS] // 8-10 m_effectPointsMax[MAX_ITEM_ENCHANTMENT_EFFECTS] - uint32 spellid[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 11-13 m_effectArg[MAX_ITEM_ENCHANTMENT_EFFECTS] - char* description[16]; // 14-29 m_name_lang[16] - //uint32 descriptionFlags; // 30 name flags - uint32 aura_id; // 31 m_itemVisual - uint32 slot; // 32 m_flags - uint32 GemID; // 33 m_src_itemID - uint32 EnchantmentCondition; // 34 m_condition_id - uint32 requiredSkill; // 35 m_requiredSkillID - uint32 requiredSkillValue; // 36 m_requiredSkillRank - uint32 requiredLevel; // 37 m_requiredLevel + uint32 ID; // 0 + uint32 RuneCost[3]; // 1-3 [0] Blood [1] Unholy [2] Frost + uint32 RunicPower; // 4 + + bool NoRuneCost() const { return RuneCost[0] == 0 && RuneCost[1] == 0 && RuneCost[2] == 0; } + bool NoRunicPowerGain() const { return RunicPower == 0; } }; -struct SpellItemEnchantmentConditionEntry +#define MAX_SHAPESHIFT_SPELLS 8 + +struct SpellShapeshiftFormEntry { - uint32 ID; // 0 m_ID - uint8 Color[5]; // 1-5 m_lt_operandType[5] - //uint32 LT_Operand[5]; // 6-10 m_lt_operand[5] - uint8 Comparator[5]; // 11-15 m_operator[5] - uint8 CompareColor[5]; // 15-20 m_rt_operandType[5] - uint32 Value[5]; // 21-25 m_rt_operand[5] - //uint8 Logic[5] // 25-30 m_logic[5] + uint32 ID; // 0 + //uint32 BonusActionBar; // 1 + //char* Name[16]; // 2-17 + //uint32 Name_lang_mask; // 18 + uint32 Flags; // 19 + int32 CreatureType; // 20 <= 0 humanoid, other normal creature types + //uint32 AttackIconID; // 21 + uint32 CombatRoundTime; // 22 + uint32 CreatureDisplayID[4]; // 23-26 [0] Alliance [1] Horde [2] Unk [3] Unk + uint32 PresetSpellID[MAX_SHAPESHIFT_SPELLS]; // 27-34 }; struct SpellVisualEntry { - //uint32 Id; - //uint32 PrecastKit; - //uint32 CastingKit; - //uint32 ImpactKit; - //uint32 StateKit; - //uint32 StateDoneKit; - //uint32 ChannelKit; - uint32 HasMissile; - int32 MissileModel; - //uint32 MissilePathType; - //uint32 MissileDestinationAttachment; - //uint32 MissileSound; - //uint32 AnimEventSoundID; - //uint32 Flags; - //uint32 CasterImpactKit; - //uint32 TargetImpactKit; - //int32 MissileAttachment; - //uint32 MissileFollowGroundHeight; - //uint32 MissileFollowGroundDropSpeed; - //uint32 MissileFollowGroundApprach; - //uint32 MissileFollowGroundFlags; - //uint32 MissileMotionId; - //uint32 MissileTargetingKit; - //uint32 InstantAreaKit; - //uint32 ImpactAreaKit; - //uint32 PersistentAreaKit; - //DBCPosition3D MissileCastOffset; - //DBCPosition3D MissileImpactOffset; + //uint32 ID; // 0 + //uint32 PrecastKit; // 1 + //uint32 CastKit; // 2 + //uint32 ImpactKit; // 3 + //uint32 StateKit; // 4 + //uint32 StateDoneKit; // 5 + //uint32 ChannelKit; // 6 + uint32 HasMissile; // 7 + int32 MissileModel; // 8 + //uint32 MissilePathType; // 9 + //uint32 MissileDestinationAttachment; // 10 + //uint32 MissileSound; // 11 + //uint32 AnimEventSoundID; // 12 + //uint32 Flags; // 13 + //uint32 CasterImpactKit; // 14 + //uint32 TargetImpactKit; // 15 + //int32 MissileAttachment; // 16 + //uint32 MissileFollowGroundHeight; // 17 + //uint32 MissileFollowGroundDropSpeed; // 18 + //uint32 MissileFollowGroundApproach; // 19 + //uint32 MissileFollowGroundFlags; // 20 + //uint32 MissileMotion; // 21 + //uint32 MissileTargetingKit; // 22 + //uint32 InstantAreaKit; // 23 + //uint32 ImpactAreaKit; // 24 + //uint32 PersistentAreaKit; // 25 + //DBCPosition3D MissileCastOffset; // 26-28 + //DBCPosition3D MissileImpactOffset; // 29-31 }; struct StableSlotPricesEntry { - uint32 Slot; - uint32 Price; + uint32 ID; // 0 + uint32 Cost; // 1 }; struct SummonPropertiesEntry { - uint32 Id; // 0 - uint32 Category; // 1, 0 - can't be controlled?, 1 - something guardian?, 2 - pet?, 3 - something controllable?, 4 - taxi/mount? - uint32 Faction; // 2, 14 rows > 0 - uint32 Type; // 3, see enum - uint32 Slot; // 4, 0-6 - uint32 Flags; // 5 + uint32 ID; // 0 + uint32 Control; // 1 + uint32 Faction; // 2 + uint32 Title; // 3 + uint32 Slot; // 4 + uint32 Flags; // 5 }; struct TalentEntry { - uint32 TalentID; // 0 - uint32 TalentTab; // 1 index in TalentTab.dbc (TalentTabEntry) - uint32 Row; // 2 - uint32 Col; // 3 - uint32 RankID[MAX_TALENT_RANK]; // 4-8 - // 9-12 not used, always 0, maybe not used high ranks - uint32 DependsOn; // 13 index in Talent.dbc (TalentEntry) - // 14-15 not used - uint32 DependsOnRank; // 16 - // 17-18 not used - //uint32 needAddInSpellBook; // 19 also need disable higest ranks on reset talent tree - //uint32 unk2; // 20, all 0 - //uint64 allowForPet; // 21 its a 64 bit mask for pet 1<<m_categoryEnumID in CreatureFamily.dbc + uint32 ID; // 0 + uint32 TabID; // 1 index in TalentTab.dbc (TalentTabEntry) + uint32 TierID; // 2 + uint32 ColumnIndex; // 3 + uint32 SpellRank[MAX_TALENT_RANK]; // 4-8 + //uint32 SpellRankUnused[4]; // 9-12 + uint32 PrereqTalent; // 13 index in Talent.dbc (TalentEntry) + //uint32 PrereqTalentUnused[2]; // 14-15 + uint32 PrereqRank; // 16 + //uint32 PrereqRankUnused[2]; // 17-18 + //uint32 Flags; // 19 + //uint32 RequiredSpellID; // 20 all 0 + //uint32 CategoryMask[2]; // 21 its a 64 bit mask for pet 1<<CategoryEnumID in CreatureFamily.dbc }; struct TalentTabEntry { - uint32 TalentTabID; // 0 - //char* name[16]; // 1-16, unused - //uint32 nameFlags; // 17, unused - //unit32 spellicon; // 18 - // 19 not used - uint32 ClassMask; // 20 - uint32 petTalentMask; // 21 - uint32 tabpage; // 22 - //char* internalname; // 23 + uint32 ID; // 0 + //char* Name[16]; // 1-16 + //uint32 Name_lang_mask; // 17 + //unit32 SpellIconID; // 18 + //uint32 RaceMask; // 19 + uint32 ClassMask; // 20 + uint32 CategoryEnumID; // 21 + uint32 OrderIndex; // 22 + //char* BackgroundFile; // 23 }; struct TaxiNodesEntry { - uint32 ID; // 0 m_ID - uint32 map_id; // 1 m_ContinentID - float x; // 2 m_x - float y; // 3 m_y - float z; // 4 m_z - char* name[16]; // 5-21 m_Name_lang - // 22 string flags - uint32 MountCreatureID[2]; // 23-24 m_MountCreatureID[2] + uint32 ID; // 0 + uint32 ContinentID; // 1 + DBCPosition3D Pos; // 2-4 + char* Name[16]; // 5-21 + //uint32 Name_lang_mask; // 22 + uint32 MountCreatureID[2]; // 23-24 }; struct TaxiPathEntry { - uint32 ID; // 0 m_ID - uint32 from; // 1 m_FromTaxiNode - uint32 to; // 2 m_ToTaxiNode - uint32 price; // 3 m_Cost + uint32 ID; // 0 + uint32 FromTaxiNode; // 1 + uint32 ToTaxiNode; // 2 + uint32 Cost; // 3 }; struct TaxiPathNodeEntry { - // 0 ID - uint32 PathID; // 1 - uint32 NodeIndex; // 2 - uint32 MapID; // 3 - float LocX; // 4 - float LocY; // 5 - float LocZ; // 6 - uint32 Flags; // 7 - uint32 Delay; // 8 - uint32 ArrivalEventID; // 9 - uint32 DepartureEventID; // 10 + //uint32 ID; // 0 + uint32 PathID; // 1 + uint32 NodeIndex; // 2 + uint32 ContinentID; // 3 + DBCPosition3D Loc; // 4-6 + uint32 Flags; // 7 + uint32 Delay; // 8 + uint32 ArrivalEventID; // 9 + uint32 DepartureEventID; // 10 }; struct TeamContributionPointsEntry { - //uint32 entry; // 0 - float value; // 1 (???) + //uint32 ID; // 0 + float Data; // 1 }; struct TotemCategoryEntry { - uint32 ID; // 0 - //char* name[16]; // 1-16 - // 17 string flags, unused - uint32 categoryType; // 18 (one for specialization) - uint32 categoryMask; // 19 (compatibility mask for same type: different for totems, compatible from high to low for rods) + uint32 ID; // 0 + //char* Name[16]; // 1-16 + //uint32 Name_lang_mask; // 17 + uint32 TotemCategoryType; // 18 (one for specialization) + uint32 TotemCategoryMask; // 19 (compatibility mask for same type: different for totems, compatible from high to low for rods) }; struct TransportAnimationEntry { - //uint32 Id; - uint32 TransportEntry; - uint32 TimeSeg; - float X; - float Y; - float Z; - //uint32 MovementId; + //uint32 ID; // 0 + uint32 TransportID; // 1 + uint32 TimeIndex; // 2 + DBCPosition3D Pos; // 3 + //uint32 SequenceID; // 4 }; struct TransportRotationEntry { - //uint32 Id; - uint32 TransportEntry; - uint32 TimeSeg; - float X; - float Y; - float Z; - float W; + //uint32 ID; // 0 + uint32 GameObjectsID; // 1 + uint32 TimeIndex; // 2 + float X; // 3 + float Y; // 4 + float Z; // 5 + float W; // 6 }; #define MAX_VEHICLE_SEATS 8 struct VehicleEntry { - uint32 m_ID; // 0 - uint32 m_flags; // 1 - float m_turnSpeed; // 2 - float m_pitchSpeed; // 3 - float m_pitchMin; // 4 - float m_pitchMax; // 5 - uint32 m_seatID[MAX_VEHICLE_SEATS]; // 6-13 - float m_mouseLookOffsetPitch; // 14 - float m_cameraFadeDistScalarMin; // 15 - float m_cameraFadeDistScalarMax; // 16 - float m_cameraPitchOffset; // 17 - //int m_powerType[3]; // removed in 3.1 - //int m_powerToken[3]; // removed in 3.1 - float m_facingLimitRight; // 18 - float m_facingLimitLeft; // 19 - float m_msslTrgtTurnLingering; // 20 - float m_msslTrgtPitchLingering; // 21 - float m_msslTrgtMouseLingering; // 22 - float m_msslTrgtEndOpacity; // 23 - float m_msslTrgtArcSpeed; // 24 - float m_msslTrgtArcRepeat; // 25 - float m_msslTrgtArcWidth; // 26 - float m_msslTrgtImpactRadius[2]; // 27-28 - char* m_msslTrgtArcTexture; // 29 - char* m_msslTrgtImpactTexture; // 30 - char* m_msslTrgtImpactModel[2]; // 31-32 - float m_cameraYawOffset; // 33 - uint32 m_uiLocomotionType; // 34 - float m_msslTrgtImpactTexRadius; // 35 - uint32 m_uiSeatIndicatorType; // 36 - uint32 m_powerDisplayId; // 37, new in 3.1 - // 38, new in 3.1 - // 39, new in 3.1 + uint32 ID; // 0 + uint32 Flags; // 1 + float TurnSpeed; // 2 + float PitchSpeed; // 3 + float PitchMin; // 4 + float PitchMax; // 5 + uint32 SeatID[MAX_VEHICLE_SEATS]; // 6-13 + float MouseLookOffsetPitch; // 14 + float CameraFadeDistScalarMin; // 15 + float CameraFadeDistScalarMax; // 16 + float CameraPitchOffset; // 17 + float FacingLimitRight; // 18 + float FacingLimitLeft; // 19 + float MsslTrgtTurnLingering; // 20 + float MsslTrgtPitchLingering; // 21 + float MsslTrgtMouseLingering; // 22 + float MsslTrgtEndOpacity; // 23 + float MsslTrgtArcSpeed; // 24 + float MsslTrgtArcRepeat; // 25 + float MsslTrgtArcWidth; // 26 + float MsslTrgtImpactRadius[2]; // 27-28 + char* MsslTrgtArcTexture; // 29 + char* MsslTrgtImpactTexture; // 30 + char* MsslTrgtImpactModel[2]; // 31-32 + float CameraYawOffset; // 33 + uint32 UiLocomotionType; // 34 + float MsslTrgtImpactTexRadius; // 35 + uint32 VehicleUIIndicatorID; // 36 + uint32 PowerDisplayID; // 37 + //uint32 PowerDisplayIDUnused[2]; // 38-39 }; struct VehicleSeatEntry { - uint32 m_ID; // 0 - uint32 m_flags; // 1 - int32 m_attachmentID; // 2 - float m_attachmentOffsetX; // 3 - float m_attachmentOffsetY; // 4 - float m_attachmentOffsetZ; // 5 - float m_enterPreDelay; // 6 - float m_enterSpeed; // 7 - float m_enterGravity; // 8 - float m_enterMinDuration; // 9 - float m_enterMaxDuration; // 10 - float m_enterMinArcHeight; // 11 - float m_enterMaxArcHeight; // 12 - int32 m_enterAnimStart; // 13 - int32 m_enterAnimLoop; // 14 - int32 m_rideAnimStart; // 15 - int32 m_rideAnimLoop; // 16 - int32 m_rideUpperAnimStart; // 17 - int32 m_rideUpperAnimLoop; // 18 - float m_exitPreDelay; // 19 - float m_exitSpeed; // 20 - float m_exitGravity; // 21 - float m_exitMinDuration; // 22 - float m_exitMaxDuration; // 23 - float m_exitMinArcHeight; // 24 - float m_exitMaxArcHeight; // 25 - int32 m_exitAnimStart; // 26 - int32 m_exitAnimLoop; // 27 - int32 m_exitAnimEnd; // 28 - float m_passengerYaw; // 29 - float m_passengerPitch; // 30 - float m_passengerRoll; // 31 - int32 m_passengerAttachmentID; // 32 - int32 m_vehicleEnterAnim; // 33 - int32 m_vehicleExitAnim; // 34 - int32 m_vehicleRideAnimLoop; // 35 - int32 m_vehicleEnterAnimBone; // 36 - int32 m_vehicleExitAnimBone; // 37 - int32 m_vehicleRideAnimLoopBone; // 38 - float m_vehicleEnterAnimDelay; // 39 - float m_vehicleExitAnimDelay; // 40 - uint32 m_vehicleAbilityDisplay; // 41 - uint32 m_enterUISoundID; // 42 - uint32 m_exitUISoundID; // 43 - int32 m_uiSkin; // 44 - uint32 m_flagsB; // 45 - // 46-57 added in 3.1, floats mostly - - inline bool HasFlag(VehicleSeatFlags flag) const { return !!(m_flags & flag); } - inline bool HasFlag(VehicleSeatFlagsB flag) const { return !!(m_flagsB & flag); } + uint32 ID; // 0 + uint32 Flags; // 1 + int32 AttachmentID; // 2 + DBCPosition3D AttachmentOffset; // 3-5 + float EnterPreDelay; // 6 + float EnterSpeed; // 7 + float EnterGravity; // 8 + float EnterMinDuration; // 9 + float EnterMaxDuration; // 10 + float EnterMinArcHeight; // 11 + float EnterMaxArcHeight; // 12 + int32 EnterAnimStart; // 13 + int32 EnterAnimLoop; // 14 + int32 RideAnimStart; // 15 + int32 RideAnimLoop; // 16 + int32 RideUpperAnimStart; // 17 + int32 RideUpperAnimLoop; // 18 + float ExitPreDelay; // 19 + float ExitSpeed; // 20 + float ExitGravity; // 21 + float ExitMinDuration; // 22 + float ExitMaxDuration; // 23 + float ExitMinArcHeight; // 24 + float ExitMaxArcHeight; // 25 + int32 ExitAnimStart; // 26 + int32 ExitAnimLoop; // 27 + int32 ExitAnimEnd; // 28 + float PassengerYaw; // 29 + float PassengerPitch; // 30 + float PassengerRoll; // 31 + int32 PassengerAttachmentID; // 32 + int32 VehicleEnterAnim; // 33 + int32 VehicleExitAnim; // 34 + int32 VehicleRideAnimLoop; // 35 + int32 VehicleEnterAnimBone; // 36 + int32 VehicleExitAnimBone; // 37 + int32 VehicleRideAnimLoopBone; // 38 + float VehicleEnterAnimDelay; // 39 + float VehicleExitAnimDelay; // 40 + uint32 VehicleAbilityDisplay; // 41 + uint32 EnterUISoundID; // 42 + uint32 ExitUISoundID; // 43 + int32 UiSkin; // 44 + uint32 FlagsB; // 45 + //float CameraEnteringDelay; // 46 + //float CameraEnteringDuration; // 47 + //float CameraExitingDelay; // 48 + //float CameraExitingDuration; // 49 + //DBCPosition3D CameraOffset; // 50-52 + //float CameraPosChaseRate; // 53 + //float CameraFacingChaseRate; // 54 + //float CameraEnteringZoom; // 55 + //float CameraSeatZoomMin; // 56 + //float CameraSeatZoomMax; // 57 + + inline bool HasFlag(VehicleSeatFlags flag) const { return (Flags & flag) != 0; } + inline bool HasFlag(VehicleSeatFlagsB flag) const { return (FlagsB & flag) != 0; } inline bool CanEnterOrExit() const { return HasFlag(VehicleSeatFlags(VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT | VEHICLE_SEAT_FLAG_CAN_CONTROL | VEHICLE_SEAT_FLAG_SHOULD_USE_VEH_SEAT_EXIT_ANIM_ON_VOLUNTARY_EXIT)); } inline bool CanSwitchFromSeat() const { return HasFlag(VEHICLE_SEAT_FLAG_CAN_SWITCH); } @@ -1836,92 +1852,98 @@ struct VehicleSeatEntry struct WMOAreaTableEntry { - uint32 Id; // 0 index - int32 rootId; // 1 used in root WMO - int32 adtId; // 2 used in adt file - int32 groupId; // 3 used in group WMO - //uint32 field4; - //uint32 field5; - //uint32 field6; - //uint32 field7; - //uint32 field8; + uint32 ID; // 0 index + int32 WMOID; // 1 used in root WMO + int32 NameSetID; // 2 used in adt file + int32 WMOGroupID; // 3 used in group WMO + //uint32 SoundProviderPref; // 4 + //uint32 SoundProviderPrefUnderwater; // 5 + //uint32 AmbienceID; // 6 + //uint32 ZoneMusic; // 7 + //uint32 IntroSound; // 8 uint32 Flags; // 9 used for indoor/outdoor determination - uint32 areaId; // 10 link to AreaTableEntry.ID - //char *Name[16]; - //uint32 nameFlags; + uint32 AreaTableID; // 10 link to AreaTableEntry.ID + //char* AreaName[16]; // 11 + //uint32 AreaName_lang_mask; // 12 }; struct WorldMapAreaEntry { - //uint32 ID; // 0 - uint32 map_id; // 1 - uint32 area_id; // 2 index (continent 0 areas ignored) - //char* internal_name // 3 - float y1; // 4 - float y2; // 5 - float x1; // 6 - float x2; // 7 - int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally) - // int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1, x2, y1, y2 coordinates) - // uint32 parentMapID; // 10 + //uint32 ID; // 0 + uint32 MapID; // 1 + uint32 AreaID; // 2 + //char* AreaName // 3 + float LocLeft; // 4 + float LocRight; // 5 + float LocTop; // 6 + float LocBottom; // 7 + int32 DisplayMapID; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally) + //int32 DefaultDungeonFloor; // 9 pointer to DungeonMap.dbc (override x1, x2, y1, y2 coordinates) + //uint32 ParentWorldMapID; // 10 }; #define MAX_WORLD_MAP_OVERLAY_AREA_IDX 4 struct WorldMapOverlayEntry { - uint32 ID; // 0 - //uint32 worldMapAreaId; // 1 idx in WorldMapArea.dbc - uint32 areatableID[MAX_WORLD_MAP_OVERLAY_AREA_IDX]; // 2-5 - // 6-7 always 0, possible part of areatableID[] - //char* internal_name // 8 - // 9-16 some ints + uint32 ID; // 0 + //uint32 MapAreaID; // 1 ID in WorldMapArea.dbc + uint32 AreaID[MAX_WORLD_MAP_OVERLAY_AREA_IDX]; // 2-5 + //uint32 MapPointX; // 6 + //uint32 MapPointY; // 7 + //char* TextureName // 8 + //uint32 TextureWidth; // 9 + //uint32 TextureHeight; // 10 + //uint32 OffsetX; // 11 + //uint32 OffsetY; // 12 + //uint32 HitRectTop; // 13 + //uint32 HitRectLeft; // 14 + //uint32 HitRectBottom; // 15 + //uint32 HitRectRight; // 16 }; struct WorldSafeLocsEntry { - uint32 ID; // 0 - uint32 map_id; // 1 - float x; // 2 - float y; // 3 - float z; // 4 - //char* name[16] // 5-20 name, unused - // 21 name flags, unused + uint32 ID; // 0 + uint32 Continent; // 1 + DBCPosition3D Loc; // 2-4 + //char* AreaName[16] // 5-20 + //uint32 AreaName_lang_mask; // 21 }; /* -struct WorldStateSounds -{ - uint32 ID; // 0 Worldstate - uint32 unk; // 1 - uint32 areaTable; // 2 - uint32 WMOAreaTable; // 3 - uint32 zoneIntroMusicTable; // 4 - uint32 zoneIntroMusic; // 5 - uint32 zoneMusic; // 6 - uint32 soundAmbience; // 7 - uint32 soundProviderPreferences; // 8 +struct WorldStateUI +{ + uint32 ID; // 0 + uint32 MapID; // 1 Can be -1 to show up everywhere. + uint32 AreaID; // 2 Can be zero for "everywhere". + uint32 PhaseShift; // 3 Phase this WorldState is avaliable in + char* Icon; // 4 The icon that is used in the interface. + char* String; // 5-20 + uint32 String_lang_mask; // 21 + char* Tooltip; // 22-37 + uint32 Tooltip_lang_mask; // 38 + uint32 StateVariable; // 39 + uint32 Type; // 40 0 = unknown, 1 = unknown, 2 = not shown in ui, 3 = wintergrasp + char* DynamicIcon; // 41 + char* DynamicTooltip[16]; // 42-57 + uint32 DynamicTooltip_lang_mask; // 58 + char* ExtendedUI; // 59 + uint32 ExtendedUIStateVariable[3]; // 60-62 }; */ /* -struct WorldStateUI -{ - uint32 ID; // 0 - uint32 map_id; // 1 Can be -1 to show up everywhere. - uint32 zone; // 2 Can be zero for "everywhere". - uint32 phaseMask; // 3 Phase this WorldState is avaliable in - uint32 icon; // 4 The icon that is used in the interface. - char* textureFilename; // 5 - char* text; // 6-21 The worldstate text - char* description; // 22-38 Text shown when hovering mouse on icon - uint32 worldstateID; // 39 This is the actual ID used - uint32 type; // 40 0 = unknown, 1 = unknown, 2 = not shown in ui, 3 = wintergrasp - uint32 unk1; // 41 - uint32 unk2; // 43 - uint32 unk3; // 44-58 - uint32 unk4; // 59-61 Used for some progress bars. - uint32 unk7; // 62 Unused in 3.3.5a +struct WorldStateZoneSounds +{ + uint32 WorldStateID; // 0 + uint32 WorldStateValue; // 1 + uint32 AreaID; // 2 + uint32 WMOAreaID; // 3 + uint32 ZoneIntroMusicID; // 4 + uint32 ZoneMusicID; // 5 + uint32 SoundAmbienceID; // 6 + uint32 SoundProviderPreferencesID; // 7 }; */ diff --git a/src/server/shared/DataStores/DBCfmt.h b/src/server/shared/DataStores/DBCfmt.h index 0370fea071b..1d0f3df9afb 100644 --- a/src/server/shared/DataStores/DBCfmt.h +++ b/src/server/shared/DataStores/DBCfmt.h @@ -18,7 +18,7 @@ #ifndef TRINITY_DBCSFRM_H #define TRINITY_DBCSFRM_H -char constexpr Achievementfmt[] = "niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii"; +char constexpr Achievementfmt[] = "niixssssssssssssssssxxxxxxxxxxxxxxxxxxiixixxxxxxxxxxxxxxxxxxii"; char constexpr CustomAchievementfmt[] = "pppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaapapaaaaaaaaaaaaaaaaaapp"; char constexpr CustomAchievementIndex[] = "ID"; char constexpr AchievementCriteriafmt[] = "niiiiiiiixxxxxxxxxxxxxxxxxiiiix"; @@ -39,7 +39,7 @@ char constexpr ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; char constexpr ChrClassesEntryfmt[] = "nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii"; char constexpr ChrRacesEntryfmt[] = "niixiixiiixxiissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; char constexpr CinematicCameraEntryfmt[] = "nsiffff"; -char constexpr CinematicSequencesEntryfmt[] = "nxixxxxxxx"; +char constexpr CinematicSequencesEntryfmt[] = "nxiiiiiiii"; char constexpr CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxx"; char constexpr CreatureDisplayInfoExtrafmt[] = "diixxxxxxxxxxxxxxxxxx"; char constexpr CreatureFamilyfmt[] = "nfifiiiiixssssssssssssssssxx"; @@ -54,7 +54,7 @@ char constexpr DurabilityQualityfmt[] = "nf"; char constexpr EmotesEntryfmt[] = "nxxiiix"; char constexpr EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx"; char constexpr EmotesTextSoundEntryfmt[] = "niiii"; -char constexpr FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixssssssssssssssssxxxxxxxxxxxxxxxxxx"; +char constexpr FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffiissssssssssssssssxxxxxxxxxxxxxxxxxx"; char constexpr FactionTemplateEntryfmt[] = "niiiiiiiiiiiii"; char constexpr GameObjectDisplayInfofmt[] = "nsxxxxxxxxxxffffffx"; char constexpr GemPropertiesEntryfmt[] = "nixxi"; @@ -98,7 +98,7 @@ char constexpr QuestSortEntryfmt[] = "nxxxxxxxxxxxxxxxxx"; char constexpr QuestXPfmt[] = "niiiiiiiiii"; char constexpr PowerDisplayfmt[] = "nixxxx"; char constexpr PvPDifficultyfmt[] = "diiiii"; -char constexpr RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii"; +char constexpr RandPropPointsfmt[] = "niiiiiiiiiiiiiii"; char constexpr ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiii"; char constexpr ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiii"; char constexpr SkillLinefmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxxixxxxxxxxxxxxxxxxxi"; @@ -108,11 +108,11 @@ char constexpr SkillTiersfmt[] = "nxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiii"; char constexpr SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char constexpr SpellCastTimefmt[] = "nixx"; char constexpr SpellCategoryfmt[] = "ni"; -char constexpr SpellDifficultyfmt[] = "niiii"; +char constexpr SpellDifficultyfmt[] = "niiii"; char constexpr CustomSpellDifficultyfmt[] = "ppppp"; char constexpr CustomSpellDifficultyIndex[] = "id"; char constexpr SpellDurationfmt[] = "niii"; -char constexpr SpellEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiiissssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxfffxx"; +char constexpr SpellEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiiissssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixxfffxx"; char constexpr CustomSpellEntryfmt[] = "papppppppppppapapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppaaappppppppppppaaapppppppppaaaaapaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaaaaaaa"; char constexpr CustomSpellEntryIndex[] = "Id"; char constexpr SpellFocusObjectfmt[] = "nxxxxxxxxxxxxxxxxx"; @@ -121,7 +121,7 @@ char constexpr SpellItemEnchantmentConditionfmt[] = "nbbbbbxxxxxbbbbbbbbbbiiiiiX char constexpr SpellRadiusfmt[] = "nfff"; char constexpr SpellRangefmt[] = "nffffixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char constexpr SpellRuneCostfmt[] = "niiii"; -char constexpr SpellShapeshiftfmt[] = "nxxxxxxxxxxxxxxxxxxiixiiixxiiiiiiii"; +char constexpr SpellShapeshiftFormfmt[] = "nxxxxxxxxxxxxxxxxxxiixiiiiiiiiiiiii"; char constexpr SpellVisualfmt[] = "dxxxxxxiixxxxxxxxxxxxxxxxxxxxxxx"; char constexpr StableSlotPricesfmt[] = "ni"; char constexpr SummonPropertiesfmt[] = "niiiii"; diff --git a/src/server/shared/SharedDefines.h b/src/server/shared/SharedDefines.h index ab4265d087d..6b27202f749 100644 --- a/src/server/shared/SharedDefines.h +++ b/src/server/shared/SharedDefines.h @@ -3213,7 +3213,7 @@ enum ChatLinkColors : uint32 CHAT_LINK_COLOR_GLYPH = 0xff66bbff }; -// Values from ItemPetFood (power of (value-1) used for compare with CreatureFamilyEntry.petDietMask +// Values from ItemPetFood (power of (value-1) used for compare with CreatureFamilyEntry.PetFoodMask enum PetDiet { PET_DIET_MEAT = 1, |