diff options
41 files changed, 686 insertions, 698 deletions
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index fed0a00d0dc..8fe96be26fb 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2634,7 +2634,7 @@ bool AchievementMgr<T>::RequirementsSatisfied(AchievementCriteriaEntry const* ac bool matchFound = false; for (int j = 0; j < MAX_WORLD_MAP_OVERLAY_AREA_IDX; ++j) { - uint32 area_id = worldOverlayEntry->areatableID[j]; + uint32 area_id = worldOverlayEntry->AreaID[j]; if (!area_id) // array have 0 only in empty tail break; diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 401844b6151..d4aa1d37f11 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -652,7 +652,7 @@ void BfGraveyard::SetSpirit(Creature* spirit, TeamId team) float BfGraveyard::GetDistance(Player* player) { const WorldSafeLocsEntry* 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) @@ -728,12 +728,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 d1aa2f77cf8..7f9359053a1 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1397,7 +1397,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(); } diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 0e9dcfacd62..ced77d06514 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -820,7 +820,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 { @@ -831,7 +831,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 { diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index be2110b389c..b57ff5480c8 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -676,7 +676,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 936f87497e6..fdb2f04b7da 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -1105,7 +1105,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) @@ -1113,7 +1113,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 dfecab6a5d4..82647c4b6b3 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -519,14 +519,14 @@ bool BattlegroundEY::SetupBattleground() WorldSafeLocsEntry const* sg = NULL; 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! Battleground 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! Battleground not created!"); return false; @@ -764,7 +764,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player* player, uint32 Point) WorldSafeLocsEntry const* sg = NULL; 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); @@ -923,7 +923,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) @@ -935,7 +935,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetClosestGraveYard(Player* player) TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Not found graveyard: %u", 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 05d0fef1fdd..ace47c53933 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -869,7 +869,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 f77a7383529..3860ca86981 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -201,12 +201,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); } } @@ -712,7 +712,7 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveYard(Player* player) safeloc = BG_SA_GYEntries[BG_SA_DEFENDER_LAST_GY]; closest = sWorldSafeLocsStore.LookupEntry(safeloc); - nearest = std::sqrt((closest->x - x)*(closest->x - x) + (closest->y - y)*(closest->y - y) + (closest->z - z)*(closest->z - z)); + nearest = std::sqrt((closest->Loc.X - x)*(closest->Loc.X - x) + (closest->Loc.Y - y)*(closest->Loc.Y - y) + (closest->Loc.Z - z)*(closest->Loc.Z - z)); for (uint8 i = BG_SA_RIGHT_CAPTURABLE_GY; i < BG_SA_MAX_GY; i++) { @@ -720,7 +720,7 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveYard(Player* player) continue; ret = sWorldSafeLocsStore.LookupEntry(BG_SA_GYEntries[i]); - dist = std::sqrt((ret->x - x)*(ret->x - x) + (ret->y - y)*(ret->y - y) + (ret->z - z)*(ret->z - z)); + dist = std::sqrt((ret->Loc.X - x)*(ret->Loc.X - x) + (ret->Loc.Y - y)*(ret->Loc.Y - y) + (ret->Loc.Z - z)*(ret->Loc.Z - z)); if (dist < nearest) { closest = ret; @@ -777,7 +777,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 3bdfd3a241d..07fdd54fb0f 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -708,14 +708,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/DataStores/DB2Stores.cpp b/src/server/game/DataStores/DB2Stores.cpp index b22b6c6dd0f..413c55b9da6 100644 --- a/src/server/game/DataStores/DB2Stores.cpp +++ b/src/server/game/DataStores/DB2Stores.cpp @@ -16,23 +16,39 @@ */ #include "DB2Stores.h" +#include "DBCStores.h" #include "DB2fmt.h" #include "DB2Utility.h" #include "Common.h" #include "Log.h" #include "World.h" -DB2Storage<ItemEntry> sItemStore(Itemfmt, &DB2Utilities::HasItemEntry, &DB2Utilities::WriteItemDbReply); -DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore(ItemCurrencyCostfmt); -DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt); -DB2Storage<ItemSparseEntry> sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply); -DB2Storage<KeyChainEntry> sKeyChainStore(KeyChainfmt); -DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); -DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt); -DB2Storage<SpellMiscEntry> sSpellMiscStore(SpellMiscEntryfmt); -DB2Storage<SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt); -DB2Storage<SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt); -DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostEntryfmt); +DB2Storage<HolidaysEntry> sHolidaysStore(HolidaysEntryfmt); +DB2Storage<ItemEntry> sItemStore(Itemfmt, &DB2Utilities::HasItemEntry, &DB2Utilities::WriteItemDbReply); +DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore(ItemCurrencyCostfmt); +DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore(ItemExtendedCostEntryfmt); +DB2Storage<ItemSparseEntry> sItemSparseStore(ItemSparsefmt, &DB2Utilities::HasItemSparseEntry, &DB2Utilities::WriteItemSparseDbReply); +DB2Storage<KeyChainEntry> sKeyChainStore(KeyChainfmt); +DB2Storage<OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDataEntryfmt); +DB2Storage<PhaseGroupEntry> sPhaseGroupStore(PhaseGroupEntryfmt); +DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore(SpellAuraRestrictionsEntryfmt); +DB2Storage<SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt); +DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore(SpellClassOptionsEntryfmt); +DB2Storage<SpellMiscEntry> sSpellMiscStore(SpellMiscEntryfmt); +DB2Storage<SpellPowerEntry> sSpellPowerStore(SpellPowerEntryfmt); +DB2Storage<SpellReagentsEntry> sSpellReagentsStore(SpellReagentsEntryfmt); +DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore(SpellRuneCostEntryfmt); +DB2Storage<SpellTotemsEntry> sSpellTotemsStore(SpellTotemsEntryfmt); +DB2Storage<TaxiNodesEntry> sTaxiNodesStore(TaxiNodesEntryfmt); +DB2Storage<TaxiPathEntry> sTaxiPathStore(TaxiPathEntryfmt); +DB2Storage<TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt); +TaxiMask sTaxiNodesMask; +TaxiMask sOldContinentsNodesMask; +TaxiMask sHordeTaxiNodesMask; +TaxiMask sAllianceTaxiNodesMask; +TaxiMask sDeathKnightTaxiNodesMask; +TaxiPathSetBySource sTaxiPathSetBySource; +TaxiPathNodesByPath sTaxiPathNodesByPath; typedef std::list<std::string> DB2StoreProblemList; @@ -102,17 +118,112 @@ void LoadDB2Stores(std::string const& dataPath) DB2StoreProblemList bad_db2_files; uint32 availableDb2Locales = 0xFF; + LoadDB2(availableDb2Locales, bad_db2_files, sHolidaysStore, db2Path, "Holidays.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2"); - LoadDB2(availableDb2Locales, bad_db2_files, sSpellAuraRestrictionsStore, db2Path, "SpellAuraRestrictions.db2");//19116 - LoadDB2(availableDb2Locales, bad_db2_files, sSpellClassOptionsStore, db2Path, "SpellClassOptions.db2");//19116 - LoadDB2(availableDb2Locales, bad_db2_files, sSpellMiscStore, db2Path, "SpellMisc.db2");//19116 - LoadDB2(availableDb2Locales, bad_db2_files, sSpellPowerStore, db2Path, "SpellPower.db2");//19116 - LoadDB2(availableDb2Locales, bad_db2_files, sSpellReagentsStore, db2Path, "SpellReagents.db2");//19116 - LoadDB2(availableDb2Locales, bad_db2_files, sSpellRuneCostStore, db2Path, "SpellRuneCost.db2");//19116 + LoadDB2(availableDb2Locales, bad_db2_files, sOverrideSpellDataStore, db2Path, "OverrideSpellData.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sPhaseGroupStore, db2Path, "PhaseXPhaseGroup.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellAuraRestrictionsStore, db2Path, "SpellAuraRestrictions.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellCastingRequirementsStore, db2Path, "SpellCastingRequirements.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellClassOptionsStore, db2Path, "SpellClassOptions.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellMiscStore, db2Path, "SpellMisc.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellPowerStore, db2Path, "SpellPower.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellReagentsStore, db2Path, "SpellReagents.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellRuneCostStore, db2Path, "SpellRuneCost.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sSpellTotemsStore, db2Path, "SpellTotems.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sTaxiNodesStore, db2Path, "TaxiNodes.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sTaxiPathStore, db2Path, "TaxiPath.db2"); + LoadDB2(availableDb2Locales, bad_db2_files, sTaxiPathNodeStore, db2Path, "TaxiPathNode.db2"); + + for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i) + if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i)) + sTaxiPathSetBySource[entry->From][entry->To] = TaxiPathBySourceAndDestination(entry->ID, entry->Cost); + uint32 pathCount = sTaxiPathStore.GetNumRows(); + + // Calculate path nodes count + std::vector<uint32> pathLength; + pathLength.resize(pathCount); // 0 and some other indexes not used + for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i) + { + if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i)) + { + if (pathLength[entry->PathID] < entry->NodeIndex + 1) + pathLength[entry->PathID] = entry->NodeIndex + 1; + } + } + + // Set path length + sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used + for (uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i) + sTaxiPathNodesByPath[i].resize(pathLength[i]); + + // fill data + for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i) + if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i)) + sTaxiPathNodesByPath[entry->PathID].set(entry->NodeIndex, entry); + + // Initialize global taxinodes mask + // include existed nodes that have at least single not spell base (scripted) path + { + std::set<uint32> spellPaths; + for (uint32 i = 1; i < sSpellEffectStore.GetNumRows(); ++i) + if (SpellEffectEntry const* sInfo = sSpellEffectStore.LookupEntry (i)) + if (sInfo->Effect == SPELL_EFFECT_SEND_TAXI) + spellPaths.insert(sInfo->EffectMiscValue); + + memset(sTaxiNodesMask, 0, sizeof(sTaxiNodesMask)); + memset(sOldContinentsNodesMask, 0, sizeof(sOldContinentsNodesMask)); + memset(sHordeTaxiNodesMask, 0, sizeof(sHordeTaxiNodesMask)); + memset(sAllianceTaxiNodesMask, 0, sizeof(sAllianceTaxiNodesMask)); + memset(sDeathKnightTaxiNodesMask, 0, sizeof(sDeathKnightTaxiNodesMask)); + for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i) + { + TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i); + if (!node) + continue; + + TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(i); + if (src_i != sTaxiPathSetBySource.end() && !src_i->second.empty()) + { + bool ok = false; + for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i) + { + // not spell path + if (spellPaths.find(dest_i->second.ID) == spellPaths.end()) + { + ok = true; + break; + } + } + + if (!ok) + continue; + } + + // valid taxi network node + uint8 field = (uint8)((i - 1) / 8); + uint32 submask = 1 << ((i-1) % 8); + + sTaxiNodesMask[field] |= submask; + if (node->MountCreatureID[0] && node->MountCreatureID[0] != 32981) + sHordeTaxiNodesMask[field] |= submask; + if (node->MountCreatureID[1] && node->MountCreatureID[1] != 32981) + sAllianceTaxiNodesMask[field] |= submask; + if (node->MountCreatureID[0] == 32981 || node->MountCreatureID[1] == 32981) + sDeathKnightTaxiNodesMask[field] |= submask; + + // old continent node (+ nodes virtually at old continents, check explicitly to avoid loading map files for zone info) + if (node->MapID < 2 || i == 82 || i == 83 || i == 93 || i == 94) + sOldContinentsNodesMask[field] |= submask; + + // fix DK node at Ebon Hold and Shadow Vault flight master + if (i == 315 || i == 333) + ((TaxiNodesEntry*)node)->MountCreatureID[1] = 32981; + } + } // error checks if (bad_db2_files.size() >= DB2FilesCount) diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index 0f8ce80bae5..40632a31d3c 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -22,17 +22,32 @@ #include "DB2Structure.h" #include <string> -extern DB2Storage<ItemEntry> sItemStore; -extern DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore; -extern DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore; -extern DB2Storage<ItemSparseEntry> sItemSparseStore; -extern DB2Storage<KeyChainEntry> sKeyChainStore; -extern DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore; -extern DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore; -extern DB2Storage<SpellMiscEntry> sSpellMiscStore; -extern DB2Storage<SpellPowerEntry> sSpellPowerStore; -extern DB2Storage<SpellReagentsEntry> sSpellReagentsStore; -extern DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore; +extern DB2Storage<HolidaysEntry> sHolidaysStore; +extern DB2Storage<ItemEntry> sItemStore; +extern DB2Storage<ItemCurrencyCostEntry> sItemCurrencyCostStore; +extern DB2Storage<ItemExtendedCostEntry> sItemExtendedCostStore; +extern DB2Storage<ItemSparseEntry> sItemSparseStore; +extern DB2Storage<KeyChainEntry> sKeyChainStore; +extern DB2Storage<OverrideSpellDataEntry> sOverrideSpellDataStore; +extern DB2Storage<PhaseGroupEntry> sPhaseGroupStore; +extern DB2Storage<SpellAuraRestrictionsEntry> sSpellAuraRestrictionsStore; +extern DB2Storage<SpellCastingRequirementsEntry> sSpellCastingRequirementsStore; +extern DB2Storage<SpellClassOptionsEntry> sSpellClassOptionsStore; +extern DB2Storage<SpellMiscEntry> sSpellMiscStore; +extern DB2Storage<SpellPowerEntry> sSpellPowerStore; +extern DB2Storage<SpellReagentsEntry> sSpellReagentsStore; +extern DB2Storage<SpellRuneCostEntry> sSpellRuneCostStore; +extern DB2Storage<SpellTotemsEntry> sSpellTotemsStore; +extern DB2Storage<TaxiNodesEntry> sTaxiNodesStore; +extern DB2Storage<TaxiPathEntry> sTaxiPathStore; +extern DB2Storage<TaxiPathNodeEntry> sTaxiPathNodeStore; +extern TaxiMask sTaxiNodesMask; +extern TaxiMask sOldContinentsNodesMask; +extern TaxiMask sHordeTaxiNodesMask; +extern TaxiMask sAllianceTaxiNodesMask; +extern TaxiMask sDeathKnightTaxiNodesMask; +extern TaxiPathSetBySource sTaxiPathSetBySource; +extern TaxiPathNodesByPath sTaxiPathNodesByPath; void LoadDB2Stores(std::string const& dataPath); diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 84967343120..cfc4b97b10a 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -19,6 +19,7 @@ #define TRINITY_DB2STRUCTURE_H #include "Common.h" +#include "DBCEnums.h" #include "ItemPrototype.h" // GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform @@ -29,22 +30,43 @@ #endif // Structures used to access raw DB2 data and required packing to portability + +#define MAX_HOLIDAY_DURATIONS 10 +#define MAX_HOLIDAY_DATES 16 +#define MAX_HOLIDAY_FLAGS 10 + +struct HolidaysEntry +{ + uint32 ID; // 0 + uint32 Duration[MAX_HOLIDAY_DURATIONS]; // 1-10 + uint32 Date[MAX_HOLIDAY_DATES]; // 11-26 (dates in unix time starting at January, 1, 2000) + uint32 Region; // 27 + uint32 Looping; // 28 + uint32 CalendarFlags[MAX_HOLIDAY_FLAGS]; // 29-38 + //uint32 HolidayNameID; // 39 HolidayNames.dbc + //uint32 HolidayDescriptionID; // 40 HolidayDescriptions.dbc + char* TextureFilename; // 41 + uint32 Priority; // 42 + uint32 CalendarFilterType; // 43 (-1 = Fishing Contest, 0 = Unk, 1 = Darkmoon Festival, 2 = Yearly holiday) + //uint32 Flags; // 44 (0 = Darkmoon Faire, Fishing Contest and Wotlk Launch, rest is 1) +}; + struct ItemEntry { - uint32 ID; // 0 - uint32 Class; // 1 - uint32 SubClass; // 2 - int32 SoundOverrideSubclass; // 3 - int32 Material; // 4 - uint32 DisplayId; // 5 - uint32 InventoryType; // 6 - uint32 Sheath; // 7 + uint32 ID; // 0 + uint32 Class; // 1 + uint32 SubClass; // 2 + int32 SoundOverrideSubclass; // 3 + int32 Material; // 4 + uint32 DisplayId; // 5 + uint32 InventoryType; // 6 + uint32 Sheath; // 7 }; struct ItemCurrencyCostEntry { - //uint32 Id; - uint32 ItemId; + //uint32 ID; // 0 + uint32 ItemId; // 1 }; struct ItemSparseEntry @@ -138,7 +160,6 @@ struct ItemExtendedCostEntry uint32 RequiredFactionId; uint32 RequiredFactionStanding; uint32 RequirementFlags; - uint32 RequiredGuildLevel; uint32 RequiredAchievement; }; @@ -150,6 +171,23 @@ struct KeyChainEntry uint8 Key[KEYCHAIN_SIZE]; }; +#define MAX_OVERRIDE_SPELL 10 + +struct OverrideSpellDataEntry +{ + uint32 ID; // 0 + uint32 SpellID[MAX_OVERRIDE_SPELL]; // 1-10 + //uint32 Flags; // 11 + //char* PlayerActionbarFileDataID; // 12 +}; + +struct PhaseGroupEntry +{ + uint32 ID; + uint32 PhaseID; + uint32 PhaseGroupID; +}; + struct SpellAuraRestrictionsEntry { //uint32 ID; // 0 @@ -163,6 +201,17 @@ struct SpellAuraRestrictionsEntry uint32 ExcludeTargetAuraSpell; // 8 }; +struct SpellCastingRequirementsEntry +{ + //uint32 ID; // 0 + uint32 FacingCasterFlags; // 1 + //uint32 MinFactionID; // 1 + //uint32 MinReputation; // 3 + uint32 RequiredAreasID; // 4 + //uint32 RequiredAuraVision; // 5 + uint32 RequiresSpellFocus; // 6 +}; + struct SpellClassOptionsEntry { uint32 ID; // 0 @@ -214,6 +263,7 @@ struct SpellPowerEntry float ManaCostPercentage; // 10 //float Unk7; // 11 //uint32 Unk8; // 12 + //uint32 Unk9; // 13 }; #define MAX_SPELL_REAGENTS 8 @@ -238,6 +288,48 @@ struct SpellRuneCostEntry bool NoRunicPowerGain() const { return RunePowerGain == 0; } }; +#define MAX_SPELL_TOTEMS 2 + +struct SpellTotemsEntry +{ + uint32 ID; // 0 + uint32 TotemCategory[MAX_SPELL_TOTEMS]; // 1 + uint32 Totem[MAX_SPELL_TOTEMS]; // 2 +}; + +struct TaxiNodesEntry +{ + uint32 ID; // 0 + uint32 MapID; // 1 + DBCPosition3D Pos; // 2-4 + char* Name_lang; // 5 + uint32 MountCreatureID[2]; // 6-7 + uint32 ConditionID; // 8 + uint32 Flags; // 9 + float MapOffset[2]; // 10-11 +}; + +struct TaxiPathEntry +{ + uint32 ID; // 0 + uint32 From; // 1 + uint32 To; // 2 + uint32 Cost; // 3 +}; + +struct TaxiPathNodeEntry +{ + uint32 ID; // 0 + uint32 PathID; // 1 + uint32 NodeIndex; // 2 + uint32 MapID; // 3 + DBCPosition3D Loc; // 4-6 + uint32 Flags; // 7 + uint32 Delay; // 8 + uint32 ArrivalEventID; // 9 + uint32 DepartureEventID; // 10 +}; + // GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform #if defined(__GNUC__) #pragma pack() @@ -245,4 +337,29 @@ struct SpellRuneCostEntry #pragma pack(pop) #endif +struct TaxiPathBySourceAndDestination +{ + TaxiPathBySourceAndDestination() : ID(0), price(0) { } + TaxiPathBySourceAndDestination(uint32 _id, uint32 _price) : ID(_id), price(_price) { } + + uint32 ID; + uint32 price; +}; +typedef std::map<uint32, TaxiPathBySourceAndDestination> TaxiPathSetForSource; +typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource; + +struct TaxiPathNodePtr +{ + TaxiPathNodePtr() : i_ptr(NULL) { } + TaxiPathNodePtr(TaxiPathNodeEntry const* ptr) : i_ptr(ptr) { } + TaxiPathNodeEntry const* i_ptr; + operator TaxiPathNodeEntry const& () const { return *i_ptr; } +}; + +typedef Path<TaxiPathNodePtr, TaxiPathNodeEntry const> TaxiPathNodeList; +typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath; + +#define TaxiMaskSize 114 +typedef uint8 TaxiMask[TaxiMaskSize]; + #endif
\ No newline at end of file diff --git a/src/server/game/DataStores/DB2fmt.h b/src/server/game/DataStores/DB2fmt.h index e8bcde8985b..c4d819a48d0 100644 --- a/src/server/game/DataStores/DB2fmt.h +++ b/src/server/game/DataStores/DB2fmt.h @@ -18,16 +18,24 @@ #ifndef TRINITY_DB2SFRM_H #define TRINITY_DB2SFRM_H +char const HolidaysEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; char const Itemfmt[]="niiiiiii"; char const ItemCurrencyCostfmt[]="xn"; char const ItemSparsefmt[]="niiiffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssiiiiiiiiiiiiiiiiiiiiiifiiifii"; -char const ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiiiiiii"; +char const ItemExtendedCostEntryfmt[]="nxxiiiiiiiiiiiixiiiiiiiiiiiiii"; char const KeyChainfmt[]="nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; +char const OverrideSpellDataEntryfmt[] = "niiiiiiiiiixx"; +char const PhaseGroupEntryfmt[] = "nii"; char const SpellAuraRestrictionsEntryfmt[] = "diiiiiiii"; +char const SpellCastingRequirementsEntryfmt[] = "dixxixi"; char const SpellClassOptionsEntryfmt[] = "niiiiii"; -char const SpellMiscEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiix"; -char const SpellPowerEntryfmt[] = "nixxiiixxxfxx"; +char const SpellMiscEntryfmt[] = "niiiiiiiiiiiiiiiiifiiiiix"; +char const SpellPowerEntryfmt[] = "nixxiiixxxfxxx"; char const SpellReagentsEntryfmt[] = "niiiiiiiiiiiiiiiixx"; char const SpellRuneCostEntryfmt[] = "niiixi"; +char const SpellTotemsEntryfmt[] = "niiii"; +char const TaxiNodesEntryfmt[] = "nifffsiiiiff"; +char const TaxiPathEntryfmt[] = "niii"; +char const TaxiPathNodeEntryfmt[] = "niiifffiiii"; #endif diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 2ba5a236f95..006c3ff255f 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -19,6 +19,19 @@ #ifndef DBCENUMS_H #define DBCENUMS_H +struct DBCPosition2D +{ + float X; + float Y; +}; + +struct DBCPosition3D +{ + float X; + float Y; + float Z; +}; + enum LevelLimit { // Client expected level limitation, like as used in DBC item max levels for "until max player level" diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index d3c21c99968..ac2598046a5 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -121,8 +121,6 @@ DBCStorage <GtOCTBaseHPByClassEntry> sGtOCTBaseHPByClassStore(GtOCTBaseHPBy DBCStorage <GtOCTBaseMPByClassEntry> sGtOCTBaseMPByClassStore(GtOCTBaseMPByClassfmt); DBCStorage <GuildPerkSpellsEntry> sGuildPerkSpellsStore(GuildPerkSpellsfmt); -DBCStorage <HolidaysEntry> sHolidaysStore(Holidaysfmt); - DBCStorage <ImportPriceArmorEntry> sImportPriceArmorStore(ImportPriceArmorfmt); DBCStorage <ImportPriceQualityEntry> sImportPriceQualityStore(ImportPriceQualityfmt); DBCStorage <ImportPriceShieldEntry> sImportPriceShieldStore(ImportPriceShieldfmt); @@ -163,8 +161,6 @@ DBCStorage <MapEntry> sMapStore(MapEntryfmt); DBCStorage <MapDifficultyEntry> sMapDifficultyStore(MapDifficultyEntryfmt); // only for loading MapDifficultyMap sMapDifficultyMap; -DBCStorage <MinorTalentEntry> sMinorTalentStore(MinorTalentEntryfmt); - DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt); DBCStorage <MountCapabilityEntry> sMountCapabilityStore(MountCapabilityfmt); DBCStorage <MountTypeEntry> sMountTypeStore(MountTypefmt); @@ -172,8 +168,6 @@ DBCStorage <MountTypeEntry> sMountTypeStore(MountTypefmt); DBCStorage <NameGenEntry> sNameGenStore(NameGenfmt); NameGenContainer sGenerateNamesMap; -DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt); - DBCStorage <PowerDisplayEntry> sPowerDisplayStore(PowerDisplayfmt); DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt); @@ -201,14 +195,12 @@ PetFamilySpellsStore sPetFamilySpellsStore; DBCStorage <SpellScalingEntry> sSpellScalingStore(SpellScalingEntryfmt); -DBCStorage <SpellTotemsEntry> sSpellTotemsStore(SpellTotemsEntryfmt); DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore(SpellTargetRestrictionsEntryfmt); DBCStorage <SpellLevelsEntry> sSpellLevelsStore(SpellLevelsEntryfmt); DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore(SpellInterruptsEntryfmt); DBCStorage <SpellEquippedItemsEntry> sSpellEquippedItemsStore(SpellEquippedItemsEntryfmt); DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore(SpellCooldownsEntryfmt); DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore(SpellAuraOptionsEntryfmt); -DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore(SpellCastingRequirementsEntryfmt); DBCStorage <SpellCastTimesEntry> sSpellCastTimesStore(SpellCastTimefmt); DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore(SpellCategoriesEntryfmt); DBCStorage <SpellCategoryEntry> sSpellCategoryStore(SpellCategoryfmt); @@ -224,21 +216,6 @@ DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore(SummonPropertiesfmt); DBCStorage <TalentEntry> sTalentStore(TalentEntryfmt); TalentBySpellIDMap sTalentBySpellIDMap; -DBCStorage <TaxiNodesEntry> sTaxiNodesStore(TaxiNodesEntryfmt); -TaxiMask sTaxiNodesMask; -TaxiMask sOldContinentsNodesMask; -TaxiMask sHordeTaxiNodesMask; -TaxiMask sAllianceTaxiNodesMask; -TaxiMask sDeathKnightTaxiNodesMask; - -// DBC used only for initialization sTaxiPathSetBySource at startup. -TaxiPathSetBySource sTaxiPathSetBySource; -DBCStorage <TaxiPathEntry> sTaxiPathStore(TaxiPathEntryfmt); - -// DBC used only for initialization sTaxiPathNodeStore at startup. -TaxiPathNodesByPath sTaxiPathNodesByPath; -static DBCStorage <TaxiPathNodeEntry> sTaxiPathNodeStore(TaxiPathNodeEntryfmt); - DBCStorage <TotemCategoryEntry> sTotemCategoryStore(TotemCategoryEntryfmt); DBCStorage <TransportAnimationEntry> sTransportAnimationStore(TransportAnimationfmt); DBCStorage <TransportRotationEntry> sTransportRotationStore(TransportRotationfmt); @@ -250,7 +227,6 @@ DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt); DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore(WorldMapOverlayEntryfmt); DBCStorage <WorldSafeLocsEntry> sWorldSafeLocsStore(WorldSafeLocsEntryfmt); DBCStorage <PhaseEntry> sPhaseStore(PhaseEntryfmt); -DBCStorage <PhaseGroupEntry> sPhaseGroupStore(PhaseGroupfmt); PhaseGroupContainer sPhasesByGroup; @@ -337,8 +313,9 @@ void LoadDBCStores(const std::string& dataPath) } } - LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc", &CustomAchievementfmt, &CustomAchievementIndex);//19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc");//15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementStore, dbcPath, "Achievement.dbc"/*, &CustomAchievementfmt, &CustomAchievementIndex*/);//19116 + // TODO: 6.x remove this and update achievement system with new dbcs + //LoadDBC(availableDbcLocales, bad_dbc_files, sAchievementCriteriaStore, dbcPath, "Achievement_Criteria.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sAreaTriggerStore, dbcPath, "AreaTrigger.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sAreaGroupStore, dbcPath, "AreaGroup.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sAuctionHouseStore, dbcPath, "AuctionHouse.dbc");//19116 @@ -436,13 +413,13 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTBaseMPByClassStore, dbcPath, "gtOCTBaseMPByClass.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sGuildPerkSpellsStore, dbcPath, "GuildPerkSpells.dbc");//19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceArmorStore, dbcPath, "ImportPriceArmor.dbc"); // 19116 LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceQualityStore, dbcPath, "ImportPriceQuality.dbc"); // 19116 LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceShieldStore, dbcPath, "ImportPriceShield.dbc"); // 19116 LoadDBC(availableDbcLocales, bad_dbc_files, sImportPriceWeaponStore, dbcPath, "ImportPriceWeapon.dbc"); // 19116 LoadDBC(availableDbcLocales, bad_dbc_files, sItemPriceBaseStore, dbcPath, "ItemPriceBase.dbc"); // 15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sItemReforgeStore, dbcPath, "ItemReforge.dbc"); // 19116 - REMOVE ME + // TODO: 6.x remove all reforging stuff + //LoadDBC(availableDbcLocales, bad_dbc_files, sItemReforgeStore, dbcPath, "ItemReforge.dbc"); // 19116 LoadDBC(availableDbcLocales, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc"); // 19116 //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sItemDisplayInfoStore, dbcPath, "ItemDisplayInfo.dbc"); -- not used currently @@ -468,7 +445,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemDamageWandStore, dbcPath, "ItemDamageWand.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sItemDisenchantLootStore, dbcPath, "ItemDisenchantLoot.dbc");//19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LFGDungeons.dbc");//19116 + LoadDBC(availableDbcLocales, bad_dbc_files, sLFGDungeonStore, dbcPath, "LfgDungeons.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sLightStore, dbcPath, "Light.dbc"); //19116 LoadDBC(availableDbcLocales, bad_dbc_files, sLiquidTypeStore, dbcPath, "LiquidType.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sLockStore, dbcPath, "Lock.dbc");//19116 @@ -494,10 +471,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sMovieStore, dbcPath, "Movie.dbc");//19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sOverrideSpellDataStore, dbcPath, "OverrideSpellData.dbc");//19116 - - LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStore, dbcPath, "Phase.dbc"); // 19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseGroupStore, dbcPath, "PhaseXPhaseGroup.dbc"); // 19116 + LoadDBC(availableDbcLocales, bad_dbc_files, sPhaseStore, dbcPath, "Phase.dbc"); // 19116 for (uint32 i = 0; i < sPhaseGroupStore.GetNumRows(); ++i) if (PhaseGroupEntry const* group = sPhaseGroupStore.LookupEntry(i)) @@ -519,8 +493,9 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc");//19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc");//19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc");//19116 + // TODO: 6.x item stat scaling requires major changes + //LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc"); + //LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSkillRaceClassInfoStore, dbcPath, "SkillRaceClassInfo.dbc");//19116 @@ -553,15 +528,13 @@ void LoadDBCStores(const std::string& dataPath) } LoadDBC(availableDbcLocales, bad_dbc_files, sSpellScalingStore, dbcPath,"SpellScaling.dbc");//19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTotemsStore, dbcPath,"SpellTotems.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellTargetRestrictionsStore, dbcPath,"SpellTargetRestrictions.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellLevelsStore, dbcPath,"SpellLevels.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellInterruptsStore, dbcPath,"SpellInterrupts.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEquippedItemsStore, dbcPath,"SpellEquippedItems.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCooldownsStore, dbcPath,"SpellCooldowns.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellAuraOptionsStore, dbcPath,"SpellAuraOptions.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastingRequirementsStore, dbcPath,"SpellCastingRequirements.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc", &CustomSpellEffectEntryfmt, &CustomSpellEffectEntryIndex);//15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sSpellEffectStore, dbcPath,"SpellEffect.dbc"/*, &CustomSpellEffectEntryfmt, &CustomSpellEffectEntryIndex*/);//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellCastTimesStore, dbcPath, "SpellCastTimes.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellDurationStore, dbcPath, "SpellDuration.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellFocusObjectStore, dbcPath, "SpellFocusObject.dbc");//19116 @@ -572,7 +545,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftStore, dbcPath, "SpellShapeshift.dbc");//19116 LoadDBC(availableDbcLocales, bad_dbc_files, sSpellShapeshiftFormStore, dbcPath, "SpellShapeshiftForm.dbc");//19116 //LoadDBC(availableDbcLocales, bad_dbc_files, sStableSlotPricesStore, dbcPath, "StableSlotPrices.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");//19116 + LoadDBC(availableDbcLocales, bad_dbc_files, sSummonPropertiesStore, dbcPath, "SummonProperties.dbc");//15595 // Must be done when sSkillLineAbilityStore, sSpellStore, sSpellLevelsStore and sCreatureFamilyStore are all loaded /* TODO: Requires spells attributes from SpellMisc.db2 is loaded after dbc @@ -610,6 +583,8 @@ void LoadDBCStores(const std::string& dataPath) } */ + LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");//15595 + // Create Spelldifficulty searcher /* TODO: 6.x update to new spell diffs for (uint32 i = 0; i < sSpellDifficultyStore.GetNumRows(); ++i) @@ -640,9 +615,6 @@ void LoadDBCStores(const std::string& dataPath) sSpellMgr->SetSpellDifficultyId(uint32(newEntry.SpellID[x]), spellDiff->ID); }*/ - LoadDBC(availableDbcLocales, bad_dbc_files, sTalentStore, dbcPath, "Talent.dbc");//19116 - LoadDBC(availableDbcLocales, bad_dbc_files, sMinorTalentStore, dbcPath, "MinorTalent.dbc");//19116 - for (unsigned int i = 0; i < sTalentStore.GetNumRows(); ++i) { TalentEntry const* talentInfo = sTalentStore.LookupEntry(i); @@ -652,93 +624,6 @@ void LoadDBCStores(const std::string& dataPath) sTalentBySpellIDMap[talentInfo->SpellID] = talentInfo; } - LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiNodesStore, dbcPath, "TaxiNodes.dbc");//15595 - LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathStore, dbcPath, "TaxiPath.dbc");//15595 - for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i) - if (TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i)) - sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID, entry->price); - uint32 pathCount = sTaxiPathStore.GetNumRows(); - - //## TaxiPathNode.dbc ## Loaded only for initialization different structures - LoadDBC(availableDbcLocales, bad_dbc_files, sTaxiPathNodeStore, dbcPath, "TaxiPathNode.dbc");//15595 - // Calculate path nodes count - std::vector<uint32> pathLength; - pathLength.resize(pathCount); // 0 and some other indexes not used - for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i) - if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i)) - { - if (pathLength[entry->path] < entry->index + 1) - pathLength[entry->path] = entry->index + 1; - } - // Set path length - sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used - for (uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i) - sTaxiPathNodesByPath[i].resize(pathLength[i]); - // fill data - for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i) - if (TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i)) - sTaxiPathNodesByPath[entry->path].set(entry->index, entry); - - // Initialize global taxinodes mask - // include existed nodes that have at least single not spell base (scripted) path - { - std::set<uint32> spellPaths; - for (uint32 i = 1; i < sSpellEffectStore.GetNumRows(); ++i) - if (SpellEffectEntry const* sInfo = sSpellEffectStore.LookupEntry (i)) - if (sInfo->Effect == SPELL_EFFECT_SEND_TAXI) - spellPaths.insert(sInfo->EffectMiscValue); - - memset(sTaxiNodesMask, 0, sizeof(sTaxiNodesMask)); - memset(sOldContinentsNodesMask, 0, sizeof(sOldContinentsNodesMask)); - memset(sHordeTaxiNodesMask, 0, sizeof(sHordeTaxiNodesMask)); - memset(sAllianceTaxiNodesMask, 0, sizeof(sAllianceTaxiNodesMask)); - memset(sDeathKnightTaxiNodesMask, 0, sizeof(sDeathKnightTaxiNodesMask)); - for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i) - { - TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i); - if (!node) - continue; - - TaxiPathSetBySource::const_iterator src_i = sTaxiPathSetBySource.find(i); - if (src_i != sTaxiPathSetBySource.end() && !src_i->second.empty()) - { - bool ok = false; - for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i) - { - // not spell path - if (spellPaths.find(dest_i->second.ID) == spellPaths.end()) - { - ok = true; - break; - } - } - - if (!ok) - continue; - } - - // valid taxi network node - uint8 field = (uint8)((i - 1) / 8); - uint32 submask = 1 << ((i-1) % 8); - - sTaxiNodesMask[field] |= submask; - if (node->MountCreatureID[0] && node->MountCreatureID[0] != 32981) - sHordeTaxiNodesMask[field] |= submask; - if (node->MountCreatureID[1] && node->MountCreatureID[1] != 32981) - sAllianceTaxiNodesMask[field] |= submask; - if (node->MountCreatureID[0] == 32981 || node->MountCreatureID[1] == 32981) - 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 || i == 82 || i == 83 || i == 93 || i == 94) - sOldContinentsNodesMask[field] |= submask; - - // fix DK node at Ebon Hold and Shadow Vault flight master - if (i == 315 || i == 333) - ((TaxiNodesEntry*)node)->MountCreatureID[1] = 32981; - } - } - //LoadDBC(availableDbcLocales, bad_dbc_files, sTeamContributionPointsStore, dbcPath, "TeamContributionPoints.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sTotemCategoryStore, dbcPath, "TotemCategory.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sTransportAnimationStore, dbcPath, "TransportAnimation.dbc"); @@ -748,7 +633,7 @@ void LoadDBCStores(const std::string& dataPath) if (!anim) continue; - sTransportMgr->AddPathNodeToTransport(anim->TransportEntry, anim->TimeSeg, anim); + sTransportMgr->AddPathNodeToTransport(anim->TransportID, anim->TimeIndex, anim); } LoadDBC(availableDbcLocales, bad_dbc_files, sTransportRotationStore, dbcPath, "TransportRotation.dbc"); @@ -758,7 +643,7 @@ void LoadDBCStores(const std::string& dataPath) if (!rot) continue; - sTransportMgr->AddPathRotationToTransport(rot->TransportEntry, rot->TimeSeg, rot); + sTransportMgr->AddPathRotationToTransport(rot->TransportID, rot->TimeIndex, rot); } LoadDBC(availableDbcLocales, bad_dbc_files, sUnitPowerBarStore, dbcPath, "UnitPowerBar.dbc");//15595 @@ -769,7 +654,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sWMOAreaTableStore, dbcPath, "WMOAreaTable.dbc");//15595 for (uint32 i = 0; i < sWMOAreaTableStore.GetNumRows(); ++i) if (WMOAreaTableEntry const* entry = sWMOAreaTableStore.LookupEntry(i)) - sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->rootId, entry->adtId, entry->groupId), entry)); + sWMOAreaInfoByTripple.insert(WMOAreaInfoByTripple::value_type(WMOAreaTableTripple(entry->WMOID, entry->NameSet, entry->WMOGroupID), entry)); LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapAreaStore, dbcPath, "WorldMapArea.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sWorldMapOverlayStore, dbcPath, "WorldMapOverlay.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sWorldSafeLocsStore, dbcPath, "WorldSafeLocs.dbc"); // 19116 @@ -893,7 +778,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; } @@ -962,10 +847,10 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT if (!reqEntry) return false; - if (itemEntry->categoryType != reqEntry->categoryType) + if (itemEntry->CategoryType != reqEntry->CategoryType) return false; - return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask; + return (itemEntry->CategoryMask & reqEntry->CategoryMask) == reqEntry->CategoryMask; } void Zone2MapCoordinates(float& x, float& y, uint32 zone) @@ -977,8 +862,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) @@ -989,8 +874,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 } diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index c59782983ec..bb7885c8bc2 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -146,7 +146,6 @@ extern DBCStorage <GtSpellScalingEntry> sGtSpellScalingStore; extern DBCStorage <GtOCTBaseHPByClassEntry> sGtOCTBaseHPByClassStore; extern DBCStorage <GtOCTBaseMPByClassEntry> sGtOCTBaseMPByClassStore; extern DBCStorage <GuildPerkSpellsEntry> sGuildPerkSpellsStore; -extern DBCStorage <HolidaysEntry> sHolidaysStore; extern DBCStorage <ImportPriceArmorEntry> sImportPriceArmorStore; extern DBCStorage <ImportPriceQualityEntry> sImportPriceQualityStore; extern DBCStorage <ImportPriceShieldEntry> sImportPriceShieldStore; @@ -184,11 +183,9 @@ extern DBCStorage <MountCapabilityEntry> sMountCapabilityStore; extern DBCStorage <MountTypeEntry> sMountTypeStore; extern DBCStorage <NameGenEntry> sNameGenStore; extern DBCStorage <PhaseEntry> sPhaseStore; -extern DBCStorage <PhaseGroupEntry> sPhaseGroupStore; //extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed extern MapDifficultyMap sMapDifficultyMap; extern DBCStorage <MovieEntry> sMovieStore; -extern DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore; extern DBCStorage <PowerDisplayEntry> sPowerDisplayStore; extern DBCStorage <QuestSortEntry> sQuestSortStore; extern DBCStorage <QuestXPEntry> sQuestXPStore; @@ -216,7 +213,6 @@ extern DBCStorage <SpellShapeshiftEntry> sSpellShapeshiftStore; extern DBCStorage <SpellShapeshiftFormEntry> sSpellShapeshiftFormStore; extern DBCStorage <SpellEntry> sSpellStore; extern DBCStorage <SpellAuraOptionsEntry> sSpellAuraOptionsStore; -extern DBCStorage <SpellCastingRequirementsEntry> sSpellCastingRequirementsStore; extern DBCStorage <SpellCategoriesEntry> sSpellCategoriesStore; extern DBCStorage <SpellCooldownsEntry> sSpellCooldownsStore; extern DBCStorage <SpellEffectEntry> sSpellEffectStore; @@ -225,20 +221,10 @@ extern DBCStorage <SpellInterruptsEntry> sSpellInterruptsStore; extern DBCStorage <SpellLevelsEntry> sSpellLevelsStore; extern DBCStorage <SpellScalingEntry> sSpellScalingStore; extern DBCStorage <SpellTargetRestrictionsEntry> sSpellTargetRestrictionsStore; -extern DBCStorage <SpellTotemsEntry> sSpellTotemsStore; //extern DBCStorage <StableSlotPricesEntry> sStableSlotPricesStore; extern DBCStorage <SummonPropertiesEntry> sSummonPropertiesStore; extern DBCStorage <TalentEntry> sTalentStore; extern TalentBySpellIDMap sTalentBySpellIDMap; -extern DBCStorage <TaxiNodesEntry> sTaxiNodesStore; -extern DBCStorage <TaxiPathEntry> sTaxiPathStore; -extern TaxiMask sTaxiNodesMask; -extern TaxiMask sOldContinentsNodesMask; -extern TaxiMask sHordeTaxiNodesMask; -extern TaxiMask sAllianceTaxiNodesMask; -extern TaxiMask sDeathKnightTaxiNodesMask; -extern TaxiPathSetBySource sTaxiPathSetBySource; -extern TaxiPathNodesByPath sTaxiPathNodesByPath; extern DBCStorage <TotemCategoryEntry> sTotemCategoryStore; extern DBCStorage <UnitPowerBarEntry> sUnitPowerBarStore; extern DBCStorage <VehicleEntry> sVehicleStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 49877769810..1b198e8c365 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -38,19 +38,6 @@ #pragma pack(push, 1) #endif -struct DBCPosition2D -{ - float X; - float Y; -}; - -struct DBCPosition3D -{ - float X; - float Y; - float Z; -}; - struct AchievementEntry { uint32 ID; // 0 @@ -682,10 +669,8 @@ struct CharStartOutfitEntry uint8 GenderID; // 3 //uint8 OutfitID; // 4 int32 ItemID[MAX_OUTFIT_ITEMS]; // 5-28 - //int32 ItemDisplayID[MAX_OUTFIT_ITEMS]; // 29-52 not required at server side - //int32 InventoryType[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side - uint32 PetDisplayID; // 77 Pet Model ID for starting pet - uint32 PetFamilyID; // 78 Pet Family Entry for starting pet + uint32 PetDisplayID; // 29 Pet Model ID for starting pet + uint32 PetFamilyID; // 30 Pet Family Entry for starting pet }; struct CharTitlesEntry @@ -838,7 +823,8 @@ struct CreatureDisplayInfoExtraEntry //uint32 FacialHairID; // 7 //uint32 NPCItemDisplay[11]; // 8-18 //uint32 Flags; // 19 - //char* FileName; // 20 + //uint32 FileDataID; // 20 + //uint32 Unk; // 21 }; struct CreatureFamilyEntry @@ -981,6 +967,7 @@ struct DungeonEncounterEntry char* Name_lang; // 5 //uint32 CreatureDisplayID; // 6 //uint32 Flags; // 7 + //uint32 Unk; // 8 Flags2? }; struct DurabilityCostsEntry @@ -1232,42 +1219,6 @@ struct GuildPerkSpellsEntry uint32 SpellID; // 2 }; -/* no used -struct HolidayDescriptionsEntry -{ - uint32 ID; // 0, m_holidayDescriptionID - //char* name // 1 m_name_lang -}; -*/ - -/* no used -struct HolidayNamesEntry -{ - uint32 ID; // 0, m_holidayNameID - //char* name // 1 m_name_lang -}; -*/ - -#define MAX_HOLIDAY_DURATIONS 10 -#define MAX_HOLIDAY_DATES 26 -#define MAX_HOLIDAY_FLAGS 10 - -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 - uint32 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) -}; - // ImportPriceArmor.dbc struct ImportPriceArmorEntry { @@ -1402,13 +1353,13 @@ struct ItemLimitCategoryEntry uint32 Flags; // 3, m_flags 0 = have, 1 = equip (enum ItemLimitCategoryMode) }; -#define MAX_ITEM_ENCHANTMENT_EFFECTS 5 +#define MAX_ITEM_RANDOM_PROPERTIES 5 struct ItemRandomPropertiesEntry { uint32 ID; // 0 //char* Name; // 1 - uint32 Enchantment[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-6 + uint32 Enchantment[MAX_ITEM_RANDOM_PROPERTIES]; // 2-6 char* Name_lang; // 7 }; @@ -1417,8 +1368,8 @@ struct ItemRandomSuffixEntry uint32 ID; // 0 char* Name_lang; // 1 //char* InternalName; // 2 - uint32 Enchantment[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 3-7 - uint32 AllocationPct[MAX_ITEM_ENCHANTMENT_EFFECTS];// 8-12 + uint32 Enchantment[MAX_ITEM_RANDOM_PROPERTIES]; // 3-7 + uint32 AllocationPct[MAX_ITEM_RANDOM_PROPERTIES];// 8-12 }; #define MAX_ITEM_SET_ITEMS 17 @@ -1473,6 +1424,9 @@ struct LFGDungeonEntry //uint32 BonusReputationAmount; // 23 //uint32 MentorCharLevel; // 24 //uint32 MentorItemLevel; // 25 + //uint32 Unk1; // 26 (300 for random dungeons, others 0) + //uint32 Unk2; // 27 + //uint32 Unk3; // 28 // Helpers uint32 Entry() const { return ID + (Type << 24); } @@ -1509,6 +1463,7 @@ struct LiquidTypeEntry //uint32 Color[2]; // 21-23 //float Unk1[18]; // 24-41 //uint32 Unk2[4]; // 42-45 + //uint32 Unk3[5]; // 46-50 }; #define MAX_LOCK_CASE 8 @@ -1525,15 +1480,7 @@ struct LockEntry struct PhaseEntry { uint32 ID; // 0 - char* Name; // 1 - uint32 Flaga; // 2 -}; - -struct PhaseGroupEntry -{ - uint32 ID; - uint32 PhaseID; - uint32 PhaseGroupID; + uint32 Flags; // 1 }; struct MailTemplateEntry @@ -1605,7 +1552,8 @@ struct MapDifficultyEntry char* Message_lang; // 3 m_message_lang (text showed when transfer to map failed) uint32 RaidDuration; // 4 m_raidDuration in secs, 0 if no fixed reset time uint32 MaxPlayers; // 5 m_maxPlayers some heroic versions have 0 when expected same amount as in normal version - //char* LockID; // 6 + //uint32 Unk1; // 6 + //uint32 Unk2; // 7 }; struct MinorTalentEntry @@ -1653,16 +1601,6 @@ struct NameGenEntry uint32 Sex; // 3 }; -#define MAX_OVERRIDE_SPELL 10 - -struct OverrideSpellDataEntry -{ - uint32 ID; // 0 - uint32 SpellID[MAX_OVERRIDE_SPELL]; // 1-10 - //uint32 Flags; // 11 - //char* PlayerActionbarFileDataID; // 12 -}; - struct PowerDisplayEntry { uint32 ID; // 0 @@ -1874,28 +1812,6 @@ struct SpellAuraOptionsEntry uint32 SpellProcsPerMinuteID; // 8 }; -// SpellCastingRequirements.dbc -struct SpellCastingRequirementsEntry -{ - //uint32 ID; // 0 - uint32 FacingCasterFlags; // 1 - //uint32 MinFactionID; // 1 - //uint32 MinReputation; // 3 - uint32 RequiredAreasID; // 4 - //uint32 RequiredAuraVision; // 5 - uint32 RequiresSpellFocus; // 6 -}; - -#define MAX_SPELL_TOTEMS 2 - -// SpellTotems.dbc -struct SpellTotemsEntry -{ - uint32 ID; // 0 m_ID - uint32 TotemCategory[MAX_SPELL_TOTEMS]; // 1 m_requiredTotemCategoryID - uint32 Totem[MAX_SPELL_TOTEMS]; // 2 m_totem -}; - // Spell.dbc struct SpellEntry { @@ -2095,6 +2011,8 @@ struct SpellDurationEntry int32 Duration[3]; }; +#define MAX_ITEM_ENCHANTMENT_EFFECTS 3 + struct SpellItemEnchantmentEntry { uint32 ID; // 0 @@ -2114,7 +2032,7 @@ struct SpellItemEnchantmentEntry uint32 ItemLevel; // 20 int32 ScalingClass; // 21 int32 ScalingClassRestricted; // 22 - float EffectScalingPoints[MAX_ITEM_ENCHANTMENT_EFFECTS];//23 + float EffectScalingPoints[MAX_ITEM_ENCHANTMENT_EFFECTS];//23-25 }; struct SpellItemEnchantmentConditionEntry @@ -2163,253 +2081,227 @@ struct TalentEntry //char* Description_lang }; -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; // 5 m_Name_lang - uint32 MountCreatureID[2]; // 6-7 m_MountCreatureID[2] - uint32 Flags; // 8 m_Flags -}; - -struct TaxiPathEntry -{ - uint32 ID; // 0 m_ID - uint32 from; // 1 m_FromTaxiNode - uint32 to; // 2 m_ToTaxiNode - uint32 price; // 3 m_Cost -}; - -struct TaxiPathNodeEntry -{ - // 0 m_ID - uint32 path; // 1 m_PathID - uint32 index; // 2 m_NodeIndex - uint32 mapid; // 3 m_ContinentID - float x; // 4 m_LocX - float y; // 5 m_LocY - float z; // 6 m_LocZ - uint32 actionFlag; // 7 m_flags - uint32 delay; // 8 m_delay - uint32 arrivalEventID; // 9 m_arrivalEventID - uint32 departureEventID; // 10 m_departureEventID -}; - struct TotemCategoryEntry { uint32 ID; // 0 - //char* name; // 1 m_name_lang - uint32 categoryType; // 2 m_totemCategoryType (one for specialization) - uint32 categoryMask; // 3 m_totemCategoryMask (compatibility mask for same type: different for totems, compatible from high to low for rods) + //char* Name_lang; // 1 m_name_lang + uint32 CategoryType; // 2 m_totemCategoryType (one for specialization) + uint32 CategoryMask; // 3 m_totemCategoryMask (compatibility mask for same type: different for totems, compatible from high to low for rods) }; struct UnitPowerBarEntry { - uint32 Id; - uint32 MinPower; - uint32 MaxPower; - //uint32 Unk0; - //uint32 Unk1; - //float Unk2; - //float Unk3; - //uint32 BarType; - //uint32 TextureFile[6]; - //uint32 Unk4[6]; - //uint32 DisplayFlags; - //char* PowerName; - //char* CostString; - //char* EmptyMessage; - //char* Tooltip; - //float StartInset; - //float EndInset; + uint32 ID; // 0 + uint32 MinPower; // 1 + uint32 MaxPower; // 2 + //uint32 StartPower; // 3 + //uint32 CenterPower; // 4 + //float RegenerationPeace; // 5 + //float RegenerationCombat; // 6 + //uint32 BarType; // 7 + //uint32 FileDataID[6]; // 8-13 + //uint32 Color[6]; // 14-19 + //uint32 Flags; // 20 + //char* Name_lang; // 21 + //char* Cost_lang; // 22 + //char* OutOfError_lang; // 23 + //char* ToolTip_lang; // 24 + //float StartInset; // 25 + //float EndInset; // 26 }; 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-5 + //uint32 SequenceID; // 6 }; struct TransportRotationEntry { - //uint32 Id; - uint32 TransportEntry; - uint32 TimeSeg; - float X; - float Y; - float Z; - float W; + //uint32 ID; // 0 + uint32 TransportID; // 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 + uint32 FlagsB; // 2 + float TurnSpeed; // 3 + float PitchSpeed; // 4 + float PitchMin; // 5 + float PitchMax; // 6 + uint32 SeatID[MAX_VEHICLE_SEATS]; // 7-14 + float MouseLookOffsetPitch; // 15 + float CameraFadeDistScalarMin; // 16 + float CameraFadeDistScalarMax; // 17 + float CameraPitchOffset; // 18 + float FacingLimitRight; // 19 + float FacingLimitLeft; // 20 + float MsslTrgtTurnLingering; // 21 + float MsslTrgtPitchLingering; // 22 + float MsslTrgtMouseLingering; // 23 + float MsslTrgtEndOpacity; // 24 + float MsslTrgtArcSpeed; // 25 + float MsslTrgtArcRepeat; // 26 + float MsslTrgtArcWidth; // 27 + float MsslTrgtImpactRadius[2]; // 28-29 + //char* MsslTrgtArcTexture; // 30 + //char* MsslTrgtImpactTexture; // 31 + //char* MsslTrgtImpactModel; // 32-33 + float CameraYawOffset; // 34 + uint32 UILocomotionType; // 35 + float MsslTrgtImpactTexRadius; // 36 + uint32 VehicleUIIndicatorID; // 37 + uint32 PowerDisplayID[3]; // 38-40 }; 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 - - bool CanEnterOrExit() const { return (m_flags & VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT) != 0; } - bool CanSwitchFromSeat() const { return (m_flags & VEHICLE_SEAT_FLAG_CAN_SWITCH) != 0; } - bool IsUsableByOverride() const { return (m_flags & (VEHICLE_SEAT_FLAG_UNCONTROLLED | VEHICLE_SEAT_FLAG_UNK18) - || (m_flagsB & (VEHICLE_SEAT_FLAG_B_USABLE_FORCED | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_2 | + 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 + uint32 FlagsB; // 44 + float CameraEnteringDelay; // 45 + float CameraEnteringDuration; // 46 + float CameraExitingDelay; // 47 + float CameraExitingDuration; // 48 + DBCPosition3D CameraOffset; // 49-51 + float CameraPosChaseRate; // 52 + float CameraFacingChaseRate; // 53 + float CameraEnteringZoom; // 54 + float CameraSeatZoomMin; // 55 + float CameraSeatZoomMax; // 56 + uint32 EnterAnimKitID; // 57 + uint32 RideAnimKitID; // 58 + uint32 ExitAnimKitID; // 59 + uint32 VehicleEnterAnimKitID; // 60 + uint32 VehicleRideAnimKitID; // 61 + uint32 VehicleExitAnimKitID; // 62 + uint32 CameraModeID; // 63 + uint32 FlagsC; // 64 + uint32 UISkinFileDataID; // 65 + + bool CanEnterOrExit() const { return (Flags & VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT) != 0; } + bool CanSwitchFromSeat() const { return (Flags & VEHICLE_SEAT_FLAG_CAN_SWITCH) != 0; } + bool IsUsableByOverride() const { return (Flags & (VEHICLE_SEAT_FLAG_UNCONTROLLED | VEHICLE_SEAT_FLAG_UNK18) + || (FlagsB & (VEHICLE_SEAT_FLAG_B_USABLE_FORCED | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_2 | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_3 | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_4))); } - bool IsEjectable() const { return (m_flagsB & VEHICLE_SEAT_FLAG_B_EJECTABLE) != 0; } + bool IsEjectable() const { return (FlagsB & VEHICLE_SEAT_FLAG_B_EJECTABLE) != 0; } }; 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 Flags; // 9 used for indoor/outdoor determination - uint32 areaId; // 10 link to AreaTableEntry.ID - //char *Name; // 11 m_AreaName_lang - //uint32 field12; // 12 - //uint32 field13; // 13 - //uint32 field14; // 14 + uint32 ID; // 0 index + int32 WMOID; // 1 used in root WMO + int32 NameSet; // 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 AreaTableID; // 10 link to AreaTableEntry.ID + //char* AreaName_lang; // 11 m_AreaName_lang + //uint32 UWIntroSound; // 12 + //uint32 UWZoneMusic; // 13 + //uint32 UWAmbience; // 14 }; 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 minRecommendedLevel; // 12 Minimum recommended level displayed on world map - // uint32 maxRecommendedLevel; // 13 Maximum recommended level displayed on world map + //uint32 ID; // 0 + uint32 MapID; // 1 + uint32 AreaID; // 2 index (continent 0 areas ignored) + //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 (owerride loc coordinates) + //uint32 ParentWorldMapID; // 10 + //uint32 Flags; // 11 + //uint32 LevelRangeMin; // 12 Minimum recommended level displayed on world map + //uint32 LevelRangeMax; // 13 Maximum recommended level displayed on world map }; #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 - //char* internal_name // 6 m_textureName - // 7 m_textureWidth - // 8 m_textureHeight - // 9 m_offsetX - // 10 m_offsetY - // 11 m_hitRectTop - // 12 m_hitRectLeft - // 13 m_hitRectBottom - // 14 m_hitRectRight + uint32 ID; // 0 + //uint32 MapAreaID; // 1 idx in WorldMapArea.dbc + uint32 AreaID[MAX_WORLD_MAP_OVERLAY_AREA_IDX]; // 2-5 + //char* TextureName; // 6 + //uint32 TextureWidth; // 7 + //uint32 TextureHeight; // 8 + //uint32 OffsetX; // 9 + //uint32 OffsetY; // 10 + //uint32 HitRectTop; // 11 + //uint32 HitRectLeft; // 12 + //uint32 HitRectBottom; // 13 + //uint32 HitRectRight; // 14 + //uint32 PlayerConditionID; // 15 }; struct WorldSafeLocsEntry { - uint32 ID; // 0 - uint32 map_id; // 1 - float x; // 2 - float y; // 3 - float z; // 4 - float Facing; // 5 values are in degrees - //char* name; // 6 m_AreaName_lang + uint32 ID; // 0 + uint32 MapID; // 1 + DBCPosition3D Loc; // 2-4 + float Facing; // 5 values are in degrees + //char* AreaName_lang; // 6 }; /* @@ -2475,30 +2367,5 @@ struct MapDifficulty typedef std::map<uint32, uint32> TalentSpellPosMap; -struct TaxiPathBySourceAndDestination -{ - TaxiPathBySourceAndDestination() : ID(0), price(0) { } - TaxiPathBySourceAndDestination(uint32 _id, uint32 _price) : ID(_id), price(_price) { } - - uint32 ID; - uint32 price; -}; -typedef std::map<uint32, TaxiPathBySourceAndDestination> TaxiPathSetForSource; -typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource; - -struct TaxiPathNodePtr -{ - TaxiPathNodePtr() : i_ptr(NULL) { } - TaxiPathNodePtr(TaxiPathNodeEntry const* ptr) : i_ptr(ptr) { } - TaxiPathNodeEntry const* i_ptr; - operator TaxiPathNodeEntry const& () const { return *i_ptr; } -}; - -typedef Path<TaxiPathNodePtr, TaxiPathNodeEntry const> TaxiPathNodeList; -typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath; - -#define TaxiMaskSize 114 -typedef uint8 TaxiMask[TaxiMaskSize]; - typedef std::unordered_map<uint32, std::set<uint32>> PhaseGroupContainer; #endif diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index f6787b6cca1..7d53f448aea 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -35,7 +35,7 @@ char const BankBagSlotPricesEntryfmt[] = "ni"; char const BannedAddOnsfmt[] = "nxxxxxxxxxx"; char const BarberShopStyleEntryfmt[] = "nixxxiii"; char const BattlemasterListEntryfmt[] = "niiiiiiiiiiiiiiiiixsiiiixxxxxxx"; -char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxii"; +char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiiii"; char const CharTitlesEntryfmt[] = "nxssix"; char const ChatChannelsEntryfmt[] = "nixsx"; char const ChrClassesEntryfmt[] = "nixsxxxixiiiixxxxxx"; @@ -44,14 +44,14 @@ char const ChrClassesXPowerTypesfmt[] = "nii"; char const ChrSpecializationEntryfmt[] = "nxiiiiiiiiixxxii"; char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxxxxxx"; -char const CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxx"; +char const CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxxx"; char const CreatureFamilyfmt[] = "nfifiiiiixsx"; char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx"; char const CreatureSpellDatafmt[] = "niiiixxxx"; char const CreatureTypefmt[] = "nxx"; char const CurrencyTypesfmt[] = "nixxxxxiiixx"; char const DestructibleModelDatafmt[] = "nixxxixxxxixxxxixxxxxxxx"; -char const DungeonEncounterfmt[] = "niiixsxx"; +char const DungeonEncounterfmt[] = "niiixsxxx"; char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; char const DurabilityQualityfmt[] = "nf"; char const EmotesEntryfmt[] = "nxxiiixx"; @@ -78,7 +78,6 @@ char const GtSpellScalingfmt[] = "df"; char const GtOCTBaseHPByClassfmt[] = "df"; char const GtOCTBaseMPByClassfmt[] = "df"; char const GuildPerkSpellsfmt[] = "dii"; -char const Holidaysfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxsiix"; char const ImportPriceArmorfmt[] = "nffff"; char const ImportPriceQualityfmt[] = "nf"; char const ImportPriceShieldfmt[] = "nf"; @@ -98,22 +97,20 @@ char const ItemRandomPropertiesfmt[] = "nxiiiiis"; char const ItemRandomSuffixfmt[] = "nsxiiiiiiiiii"; char const ItemSetEntryfmt[] = "nsiiiiiiiiiiiiiiiiiii"; char const ItemSetSpellEntryfmt[] = "niiii"; -char const LFGDungeonEntryfmt[] = "nsiiixxiiiixxixixxxxxxxxxx"; -char const LightEntryfmt[] = "nifffxxxxxxxxxxxxx"; -char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const LFGDungeonEntryfmt[] = "nsiiixxiiiixxixixxxxxxxxxxxxx"; +char const LightEntryfmt[] = "nifffxxxxxxxxxx"; +char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; -char const PhaseEntryfmt[] = "nsi"; -char const PhaseGroupfmt[] = "nii"; +char const PhaseEntryfmt[] = "ni"; char const MailTemplateEntryfmt[] = "nxs"; char const MapEntryfmt[] = "nxiixxsixxixiffxiiiixx"; -char const MapDifficultyEntryfmt[] = "diisiix"; +char const MapDifficultyEntryfmt[] = "diisiixx"; char const MinorTalentEntryfmt[] = "niii"; char const MovieEntryfmt[] = "nxxxx"; char const MountCapabilityfmt[] = "niiiiiii"; char const MountTypefmt[] = "niiiiiiiiiiiiiiiiiiiiiiii"; char const NameGenfmt[] = "dsii"; char const NumTalentsAtLevelfmt[] = "df"; -char const OverrideSpellDatafmt[] = "niiiiiiiiiixx"; char const QuestFactionRewardfmt[] = "niiiiiiiiii"; char const QuestSortEntryfmt[] = "nx"; char const QuestXPfmt[] = "niiiiiiiiii"; @@ -139,18 +136,16 @@ char const SpellEntryfmt[] = "nsxxxiiiiiiiiiiiiiiiiiii"; const std::string CustomSpellEntryfmt = "ppppppppppppppapaaaaaaaaapaaaaaapapppaapppaaapa"; const std::string CustomSpellEntryIndex = "Id"; char const SpellFocusObjectfmt[] = "nx"; -char const SpellItemEnchantmentfmt[] = "niiiiiiiiiiiiiiiixiiiiiiiiiiiiiiif"; -char const SpellItemEnchantmentConditionfmt[] = "nbbbbbXXXiiiiibbbbbbbbbbXXiiiiibbbbbXXX"; +char const SpellItemEnchantmentfmt[] = "niiiiiiiiiixiiiiiiiiiiifff"; +char const SpellItemEnchantmentConditionfmt[] = "nbbbbbiiiiibbbbbbbbbbiiiiibbbbb"; char const SpellRadiusfmt[] = "nxfff"; char const SpellRangefmt[] = "nffffixx"; char const SpellScalingEntryfmt[] = "niiiifiii"; -char const SpellTotemsEntryfmt[] = "niiii"; char const SpellTargetRestrictionsEntryfmt[] = "niiffiiii"; char const SpellPowerEntryfmt[] = "diiiiixf"; char const SpellInterruptsEntryfmt[] = "diiiiiii"; char const SpellEquippedItemsEntryfmt[] = "diiiii"; char const SpellAuraOptionsEntryfmt[] = "niiiiiiii"; -char const SpellCastingRequirementsEntryfmt[] = "dixxixi"; char const SpellCooldownsEntryfmt[] = "diiiii"; char const SpellLevelsEntryfmt[] = "diiiii"; char const SpellShapeshiftEntryfmt[] = "niiiix"; @@ -158,18 +153,15 @@ char const SpellShapeshiftFormfmt[] = "nxxiixiiiiiiiiiiiiixx"; char const StableSlotPricesfmt[] = "ni"; char const SummonPropertiesfmt[] = "niiiii"; char const TalentEntryfmt[] = "niiiiiiiiix"; -char const TaxiNodesEntryfmt[] = "nifffsiiixx"; -char const TaxiPathEntryfmt[] = "niii"; -char const TaxiPathNodeEntryfmt[] = "diiifffiiii"; char const TotemCategoryEntryfmt[] = "nxii"; char const UnitPowerBarfmt[] = "niixxxxxxxxxxxxxxxxxxxxxxxx"; char const TransportAnimationfmt[] = "diifffx"; char const TransportRotationfmt[] = "diiffff"; -char const VehicleEntryfmt[] = "niffffiiiiiiiifffffffffffffffssssfifiixx"; -char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiixxxxxxxxxxxxxxxxxxxx"; +char const VehicleEntryfmt[] = "niiffffiiiiiiiifffffffffffffffxxxxfifiiii"; +char const VehicleSeatEntryfmt[] = "niiffffffffffiiiiiifffffffiiifffiiiiiiiffiiiiffffffffffffiiiiiiiii"; char const WMOAreaTableEntryfmt[] = "niiixxxxxiixxxx"; char const WorldMapAreaEntryfmt[] = "xinxffffixxxxx"; -char const WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxx"; +char const WorldMapOverlayEntryfmt[] = "nxiiiixxxxxxxxxx"; char const WorldSafeLocsEntryfmt[] = "niffffx"; #endif diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 8572d23bf64..e482e0a449d 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -541,7 +541,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint32 flags) const if (VehicleCreate) { Unit const* unit = ToUnit(); - *data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->m_ID); // RecID + *data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->ID); // RecID *data << float(unit->GetOrientation()); // InitialRawFacing } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3fb7c8572fb..cac2f810e2a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5176,14 +5176,14 @@ void Player::RepopAtGraveyard() // and don't show spirit healer location if (ClosestGrave) { - TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, (ClosestGrave->Facing * M_PI) / 180); // Orientation is initially in degrees + TeleportTo(ClosestGrave->MapID, ClosestGrave->Loc.X, ClosestGrave->Loc.Y, ClosestGrave->Loc.Z, (ClosestGrave->Facing * M_PI) / 180); // Orientation is initially in degrees 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 << ClosestGrave->x; - data << ClosestGrave->y; - data << ClosestGrave->z; + data << ClosestGrave->MapID; + data << ClosestGrave->Loc.X; + data << ClosestGrave->Loc.Y; + data << ClosestGrave->Loc.Z; GetSession()->SendPacket(&data); } } @@ -13631,7 +13631,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool if (item_rand) { // Search enchant_amount - for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + for (int k = 0; k < MAX_ITEM_RANDOM_PROPERTIES; ++k) { if (item_rand->Enchantment[k] == enchant_id) { @@ -13657,7 +13657,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId())); if (item_rand) { - for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + for (int k = 0; k < MAX_ITEM_RANDOM_PROPERTIES; ++k) { if (item_rand->Enchantment[k] == enchant_id) { @@ -13677,7 +13677,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId())); if (item_rand_suffix) { - for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + for (int k = 0; k < MAX_ITEM_RANDOM_PROPERTIES; ++k) { if (item_rand_suffix->Enchantment[k] == enchant_id) { @@ -17175,8 +17175,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder) else // have start node, to it { TC_LOG_ERROR("entities.player", "%s have 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->MapID; + Relocate(nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z, 0.0f); } m_taxi.ClearTaxiDestinations(); } @@ -17185,11 +17185,11 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *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->MapID == GetMapId()) { ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString - mapId = nodeEntry->map_id; - Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f); + mapId = nodeEntry->MapID; + Relocate(nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z, 0.0f); } // flight will started later @@ -21176,12 +21176,12 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc } // check node starting pos data set case if provided - if (node->x != 0.0f || node->y != 0.0f || node->z != 0.0f) + if (node->Pos.X != 0.0f || node->Pos.Y != 0.0f || node->Pos.Z != 0.0f) { - if (node->map_id != GetMapId() || - (node->x - GetPositionX())*(node->x - GetPositionX())+ - (node->y - GetPositionY())*(node->y - GetPositionY())+ - (node->z - GetPositionZ())*(node->z - GetPositionZ()) > + if (node->MapID != GetMapId() || + (node->Pos.X - GetPositionX())*(node->Pos.X - GetPositionX())+ + (node->Pos.Y - GetPositionY())*(node->Pos.Y - GetPositionY())+ + (node->Pos.Z - GetPositionZ())*(node->Pos.Z - GetPositionZ()) > (2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE)) { GetSession()->SendActivateTaxiReply(ERR_TAXITOOFARAWAY); @@ -21284,7 +21284,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc TaxiNodesEntry const* lastPathNode = sTaxiNodesStore.LookupEntry(nodes[nodes.size()-1]); ASSERT(lastPathNode); m_taxi.ClearTaxiDestinations(); - TeleportTo(lastPathNode->map_id, lastPathNode->x, lastPathNode->y, lastPathNode->z, GetOrientation()); + TeleportTo(lastPathNode->MapID, lastPathNode->Pos.X, lastPathNode->Pos.Y, lastPathNode->Pos.Z, GetOrientation()); return false; } else @@ -21304,8 +21304,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->From; + nodes[1] = entry->To; return ActivateTaxiPathTo(nodes, NULL, spellid); } @@ -21339,9 +21339,9 @@ void Player::ContinueTaxiFlight() float distPrev = MAP_SIZE*MAP_SIZE; float distNext = - (nodeList[0].x-GetPositionX())*(nodeList[0].x-GetPositionX())+ - (nodeList[0].y-GetPositionY())*(nodeList[0].y-GetPositionY())+ - (nodeList[0].z-GetPositionZ())*(nodeList[0].z-GetPositionZ()); + (nodeList[0].Loc.X-GetPositionX())*(nodeList[0].Loc.X-GetPositionX())+ + (nodeList[0].Loc.Y-GetPositionY())*(nodeList[0].Loc.Y-GetPositionY())+ + (nodeList[0].Loc.Z-GetPositionZ())*(nodeList[0].Loc.Z-GetPositionZ()); for (uint32 i = 1; i < nodeList.size(); ++i) { @@ -21349,20 +21349,20 @@ void Player::ContinueTaxiFlight() TaxiPathNodeEntry const& prevNode = nodeList[i-1]; // skip nodes at another map - if (node.mapid != GetMapId()) + if (node.MapID != GetMapId()) continue; distPrev = distNext; distNext = - (node.x-GetPositionX())*(node.x-GetPositionX())+ - (node.y-GetPositionY())*(node.y-GetPositionY())+ - (node.z-GetPositionZ())*(node.z-GetPositionZ()); + (node.Loc.X-GetPositionX())*(node.Loc.X-GetPositionX())+ + (node.Loc.Y-GetPositionY())*(node.Loc.Y-GetPositionY())+ + (node.Loc.Z-GetPositionZ())*(node.Loc.Z-GetPositionZ()); float distNodes = - (node.x-prevNode.x)*(node.x-prevNode.x)+ - (node.y-prevNode.y)*(node.y-prevNode.y)+ - (node.z-prevNode.z)*(node.z-prevNode.z); + (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) { @@ -21666,12 +21666,6 @@ bool Player::BuyCurrencyFromVendorSlot(ObjectGuid vendorGuid, uint32 vendorSlot, return false; } - if (iece->RequiredGuildLevel && iece->RequiredGuildLevel < GetGuildLevel()) - { - SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // Find correct error - return false; - } - if (iece->RequiredAchievement && !HasAchieved(iece->RequiredAchievement)) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // Find correct error @@ -21862,12 +21856,6 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin return false; } - if (iece->RequiredGuildLevel && iece->RequiredGuildLevel < GetGuildLevel()) - { - SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // Find correct error - return false; - } - if (iece->RequiredAchievement && !HasAchieved(iece->RequiredAchievement)) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, NULL, NULL); // Find correct error @@ -22468,7 +22456,7 @@ void Player::SetBattlegroundEntryPoint() if (GetMap()->IsDungeon()) { if (const WorldSafeLocsEntry* 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->MapID, entry->Loc.X, entry->Loc.Y, entry->Loc.Z, 0.0f); else TC_LOG_ERROR("entities.player", "SetBattlegroundEntryPoint: Dungeon map %u has no linked graveyard, setting home location as entry point.", GetMapId()); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 0f02be336a4..a5698740092 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -20,6 +20,7 @@ #define _PLAYER_H #include "DBCStores.h" +#include "DB2Stores.h" #include "GroupReference.h" #include "MapReference.h" diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index b11b0f8806e..046d9f7824e 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -177,13 +177,13 @@ void Transport::Update(uint32 diff) MoveToNextWaypoint(); - sScriptMgr->OnRelocate(this, _currentFrame->Node->index, _currentFrame->Node->mapid, _currentFrame->Node->x, _currentFrame->Node->y, _currentFrame->Node->z); + sScriptMgr->OnRelocate(this, _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _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->index, _currentFrame->Node->mapid, _currentFrame->Node->x, _currentFrame->Node->y, _currentFrame->Node->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->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z); // Departure event if (_currentFrame->IsTeleportFrame()) - if (TeleportTransport(_nextFrame->Node->mapid, _nextFrame->Node->x, _nextFrame->Node->y, _nextFrame->Node->z, _nextFrame->InitialOrientation)) + if (TeleportTransport(_nextFrame->Node->MapID, _nextFrame->Node->Loc.X, _nextFrame->Node->Loc.Y, _nextFrame->Node->Loc.Z, _nextFrame->InitialOrientation)) return; // Update more in new map thread } @@ -709,9 +709,9 @@ void Transport::UpdatePassengerPositions(PassengerSet& passengers) void Transport::DoEventIfAny(KeyFrame const& node, bool departure) { - if (uint32 eventid = departure ? node.Node->departureEventID : node.Node->arrivalEventID) + if (uint32 eventid = departure ? node.Node->DepartureEventID : node.Node->ArrivalEventID) { - TC_LOG_DEBUG("maps.script", "Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.Node->index, GetName().c_str()); + TC_LOG_DEBUG("maps.script", "Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.Node->NodeIndex, GetName().c_str()); GetMap()->ScriptsStart(sEventScripts, eventid, this, this); EventInform(eventid); } diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index d7ced149364..96da4d14f03 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -39,7 +39,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)) { Seats.insert(std::make_pair(i, VehicleSeat(veSeat))); @@ -78,7 +78,7 @@ void Vehicle::Install() { if (_me->GetTypeId() == TYPEID_UNIT) { - if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(_vehicleInfo->m_powerDisplayId)) + if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(_vehicleInfo->PowerDisplayID[0])) _me->setPowerType(Powers(powerDisplay->PowerType)); else if (_me->getClass() == CLASS_ROGUE) _me->setPowerType(POWER_ENERGY); @@ -197,7 +197,7 @@ void Vehicle::ApplyAllImmunities() } // 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 @@ -406,7 +406,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) } TC_LOG_DEBUG("entities.vehicle", "Unit %s scheduling enter vehicle (entry: %u, vehicleId: %u, %s (dbguid: " UI64FMTD ") on seat %d", - unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().ToString().c_str(), + unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->ID, _me->GetGUID().ToString().c_str(), uint64(_me->GetTypeId() == TYPEID_UNIT ? _me->ToCreature()->GetDBTableGUIDLow() : UI64LIT(0)), (int32)seatId); // The seat selection code may kick other passengers off the vehicle. @@ -476,18 +476,18 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit) ASSERT(seat != Seats.end()); TC_LOG_DEBUG("entities.vehicle", "Unit %s exit vehicle entry %u id %u %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()) @@ -572,7 +572,7 @@ bool Vehicle::IsVehicleInUse() const void Vehicle::InitMovementInfoForBase() { - uint32 vehicleFlags = GetVehicleInfo()->m_flags; + uint32 vehicleFlags = GetVehicleInfo()->Flags; if (vehicleFlags & VEHICLE_FLAG_NO_STRAFE) _me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_NO_STRAFE); @@ -789,21 +789,21 @@ bool VehicleJoinEvent::Execute(uint64, uint32) player->StopCastingCharm(); player->StopCastingBindSight(); player->SendOnCancelExpectedVehicleRideAura(); - if (!(veSeat->m_flagsB & VEHICLE_SEAT_FLAG_B_KEEP_PET)) + if (!(veSeat->FlagsB & VEHICLE_SEAT_FLAG_B_KEEP_PET)) player->UnsummonPetTemporaryIfAny(); } - if (Seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE) + if (Seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE) Passenger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Passenger->m_movementInfo.transport.pos.Relocate(veSeat->m_attachmentOffsetX, veSeat->m_attachmentOffsetY, veSeat->m_attachmentOffsetZ); + Passenger->m_movementInfo.transport.pos.Relocate(veSeat->AttachmentOffset.X, veSeat->AttachmentOffset.Y, veSeat->AttachmentOffset.Z); Passenger->m_movementInfo.transport.time = 0; Passenger->m_movementInfo.transport.seat = Seat->first; Passenger->m_movementInfo.transport.guid = Target->GetBase()->GetGUID(); - Passenger->m_movementInfo.transport.vehicleId = Target->GetVehicleInfo()->m_ID; + Passenger->m_movementInfo.transport.vehicleId = Target->GetVehicleInfo()->ID; if (Target->GetBase()->GetTypeId() == TYPEID_UNIT && Passenger->GetTypeId() == TYPEID_PLAYER && - Seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) + Seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_CAN_CONTROL) ASSERT(Target->GetBase()->SetCharmedBy(Passenger, CHARM_TYPE_VEHICLE)); // SMSG_CLIENT_CONTROL Passenger->SendClearTarget(); // SMSG_BREAK_TARGET @@ -812,7 +812,7 @@ bool VehicleJoinEvent::Execute(uint64, uint32) Movement::MoveSplineInit init(Passenger); init.DisableTransportPathTransformations(); - init.MoveTo(veSeat->m_attachmentOffsetX, veSeat->m_attachmentOffsetY, veSeat->m_attachmentOffsetZ, false, true); + init.MoveTo(veSeat->AttachmentOffset.X, veSeat->AttachmentOffset.Y, veSeat->AttachmentOffset.Z, false, true); init.SetFacing(0.0f); init.SetTransportEnter(); init.Launch(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 985d0508f6c..ab4b2c9e22e 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4925,11 +4925,11 @@ void ObjectMgr::LoadEventScripts() { TaxiPathNodeEntry const& node = sTaxiPathNodesByPath[path_idx][node_idx]; - if (node.arrivalEventID) - evt_scripts.insert(node.arrivalEventID); + if (node.ArrivalEventID) + evt_scripts.insert(node.ArrivalEventID); - if (node.departureEventID) - evt_scripts.insert(node.departureEventID); + if (node.DepartureEventID) + evt_scripts.insert(node.DepartureEventID); } } @@ -5712,7 +5712,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->MapID != mapid || (!node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981)) // dk flight continue; uint8 field = (uint8)((i - 1) / 8); @@ -5722,7 +5722,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) @@ -5944,12 +5944,12 @@ 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->MapID) { // if find graveyard at different map from where entrance placed (or no entrance data), use any first if (!mapEntry || mapEntry->CorpseMapID < 0 - || uint32(mapEntry->CorpseMapID) != entry->map_id + || uint32(mapEntry->CorpseMapID) != entry->MapID || (mapEntry->CorpsePos.X == 0 && mapEntry->CorpsePos.Y == 0)) // Check X and Y { // not have any corrdinates for check distance anyway @@ -5958,8 +5958,8 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float } // at entrance map calculate distance (2D); - float dist2 = (entry->x - mapEntry->CorpsePos.X)*(entry->x - mapEntry->CorpsePos.X) - +(entry->y - mapEntry->CorpsePos.Y)*(entry->y - mapEntry->CorpsePos.Y); + float dist2 = (entry->Loc.X - mapEntry->CorpsePos.X)*(entry->Loc.X - mapEntry->CorpsePos.X) + +(entry->Loc.Y - mapEntry->CorpsePos.Y)*(entry->Loc.Y - mapEntry->CorpsePos.Y); if (foundEntr) { if (dist2 < distEntr) @@ -5978,7 +5978,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) @@ -6127,10 +6127,10 @@ void ObjectMgr::LoadAreaTriggerTeleports() AreaTriggerStruct at; - at.target_mapId = portLoc->map_id; - at.target_X = portLoc->x; - at.target_Y = portLoc->y; - at.target_Z = portLoc->z; + at.target_mapId = portLoc->MapID; + at.target_X = portLoc->Loc.X; + at.target_Y = portLoc->Loc.Y; + at.target_Z = portLoc->Loc.Z; at.target_Orientation = (portLoc->Facing * M_PI) / 180; // Orientation is initially in degrees AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); diff --git a/src/server/game/Handlers/CombatHandler.cpp b/src/server/game/Handlers/CombatHandler.cpp index 152d6994949..99aae6f5d0d 100644 --- a/src/server/game/Handlers/CombatHandler.cpp +++ b/src/server/game/Handlers/CombatHandler.cpp @@ -58,7 +58,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData) { 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(pEnemy); return; diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index dda5cbf0f13..097c47a228e 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -1173,7 +1173,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); @@ -1355,7 +1355,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]); if (updateFlags & GROUP_UPDATE_FLAG_PHASE) { diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 23cbdc7d4a3..196727f9e7b 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -369,7 +369,7 @@ void WorldSession::HandleMovementOpcodes(WorldPackets::Movement::ClientPlayerMov { 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 d607533a9a7..cc82063e074 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -443,7 +443,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, (corpseGrave->Facing * M_PI) / 180); // Orientation is initially in degrees + _player->TeleportTo(corpseGrave->MapID, corpseGrave->Loc.X, corpseGrave->Loc.Y, corpseGrave->Loc.Z, (corpseGrave->Facing * M_PI) / 180); // Orientation is initially in degrees // or update at original position else _player->UpdateObjectVisibility(); diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index e7d7f6152d3..91623368f3d 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -224,7 +224,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) TaxiNodesEntry const* curDestNode = sTaxiNodesStore.LookupEntry(curDest); // far teleport case - if (curDestNode && curDestNode->map_id != GetPlayer()->GetMapId()) + if (curDestNode && curDestNode->MapID != GetPlayer()->GetMapId()) { if (GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) { @@ -235,7 +235,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) TaxiPathNodeEntry const& node = flight->GetPath()[flight->GetCurrentNode()]; flight->SkipCurrentNode(); - GetPlayer()->TeleportTo(curDestNode->map_id, node.x, node.y, node.z, GetPlayer()->GetOrientation()); + GetPlayer()->TeleportTo(curDestNode->MapID, node.Loc.X, node.Loc.Y, node.Loc.Z, GetPlayer()->GetOrientation()); } return; } diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index 1b2516c1c5a..065857f6673 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -60,7 +60,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData) { recvData.rfinish(); // prevent warnings spam TC_LOG_ERROR("network", "HandleChangeSeatsOnControlledVehicle, Opcode: %u, %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; } @@ -209,7 +209,7 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/) GetPlayer()->ExitVehicle(); else TC_LOG_ERROR("network", "%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/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 16a8f110a15..b8dabf1f07a 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2221,8 +2221,8 @@ bool Map::IsOutdoors(float x, float y, float z) const WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId); if (wmoEntry) { - TC_LOG_DEBUG("maps", "Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId); - atEntry = GetAreaEntryByAreaID(wmoEntry->areaId); + TC_LOG_DEBUG("maps", "Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->AreaTableID); + atEntry = GetAreaEntryByAreaID(wmoEntry->AreaTableID); } return IsOutdoorWMO(mogpFlags, adtId, rootId, groupId, wmoEntry, atEntry); } @@ -2259,7 +2259,7 @@ uint16 Map::GetAreaFlag(float x, float y, float z, bool *isOutdoors) const haveAreaInfo = true; wmoEntry = GetWMOAreaTableEntryByTripple(rootId, adtId, groupId); if (wmoEntry) - atEntry = GetAreaEntryByAreaID(wmoEntry->areaId); + atEntry = GetAreaEntryByAreaID(wmoEntry->AreaTableID); } uint16 areaflag; diff --git a/src/server/game/Maps/TransportMgr.cpp b/src/server/game/Maps/TransportMgr.cpp index 98d10ff40ce..19e2e436692 100644 --- a/src/server/game/Maps/TransportMgr.cpp +++ b/src/server/game/Maps/TransportMgr.cpp @@ -115,7 +115,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].x, path[i].y, path[i].z)); + 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)); @@ -132,7 +132,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl if (!mapChange) { TaxiPathNodeEntry const& node_i = path[i]; - if (i != path.size() - 1 && (node_i.actionFlag & 1 || node_i.mapid != path[i + 1].mapid)) + if (i != path.size() - 1 && (node_i.Flags & 1 || node_i.MapID != path[i + 1].MapID)) { keyFrames.back().Teleport = true; mapChange = true; @@ -145,8 +145,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.x, node_i.y, node_i.z)); - 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->MapID); } } else @@ -156,12 +156,12 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl if (splinePath.size() >= 2) { // Remove special catmull-rom spline points - if (!keyFrames.front().IsStopFrame() && !keyFrames.front().Node->arrivalEventID && !keyFrames.front().Node->departureEventID) + if (!keyFrames.front().IsStopFrame() && !keyFrames.front().Node->ArrivalEventID && !keyFrames.front().Node->DepartureEventID) { splinePath.erase(splinePath.begin()); keyFrames.erase(keyFrames.begin()); } - if (!keyFrames.back().IsStopFrame() && !keyFrames.back().Node->arrivalEventID && !keyFrames.back().Node->departureEventID) + if (!keyFrames.back().IsStopFrame() && !keyFrames.back().Node->ArrivalEventID && !keyFrames.back().Node->DepartureEventID) { splinePath.pop_back(); keyFrames.pop_back(); @@ -314,7 +314,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl float curPathTime = 0.0f; if (keyFrames[0].IsStopFrame()) { - curPathTime = float(keyFrames[0].Node->delay); + curPathTime = float(keyFrames[0].Node->Delay); keyFrames[0].DepartureTime = uint32(curPathTime * IN_MILLISECONDS); } @@ -325,7 +325,7 @@ void TransportMgr::GeneratePath(GameObjectTemplate const* goInfo, TransportTempl { keyFrames[i].ArriveTime = uint32(curPathTime * IN_MILLISECONDS); keyFrames[i - 1].NextArriveTime = keyFrames[i].ArriveTime; - curPathTime += float(keyFrames[i].Node->delay); + curPathTime += float(keyFrames[i].Node->Delay); keyFrames[i].DepartureTime = uint32(curPathTime * IN_MILLISECONDS); } else @@ -377,10 +377,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->x; - float y = startNode->y; - float z = startNode->z; + uint32 mapId = startNode->MapID; + 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/Maps/TransportMgr.h b/src/server/game/Maps/TransportMgr.h index 8d06ca0f671..34733613c28 100644 --- a/src/server/game/Maps/TransportMgr.h +++ b/src/server/game/Maps/TransportMgr.h @@ -62,7 +62,7 @@ struct KeyFrame uint32 NextArriveTime; bool IsTeleportFrame() const { return Teleport; } - bool IsStopFrame() const { return Node->actionFlag == 2; } + bool IsStopFrame() const { return Node->Flags == 2; } }; struct TransportTemplate diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index ed42c513a2c..7b5d9e54436 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -249,10 +249,10 @@ uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const if (i_currentNode >= i_path->size()) return i_path->size(); - uint32 curMapId = (*i_path)[i_currentNode].mapid; + uint32 curMapId = (*i_path)[i_currentNode].MapID; for (uint32 i = i_currentNode; i < i_path->size(); ++i) { - if ((*i_path)[i].mapid != curMapId) + if ((*i_path)[i].MapID != curMapId) return i; } @@ -297,7 +297,7 @@ void FlightPathMovementGenerator::DoReset(Player* player) uint32 end = GetPathAtMapEnd(); for (uint32 i = GetCurrentNode(); i != end; ++i) { - G3D::Vector3 vertice((*i_path)[i].x, (*i_path)[i].y, (*i_path)[i].z); + G3D::Vector3 vertice((*i_path)[i].Loc.X, (*i_path)[i].Loc.Y, (*i_path)[i].Loc.Z); init.Path().push_back(vertice); } init.SetFirstPointId(GetCurrentNode()); @@ -336,10 +336,10 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() if (i_path->empty()) return; - uint32 map0 = (*i_path)[0].mapid; + uint32 map0 = (*i_path)[0].MapID; for (size_t i = 1; i < i_path->size(); ++i) { - if ((*i_path)[i].mapid != map0) + if ((*i_path)[i].MapID != map0) { i_currentNode = i; return; @@ -349,9 +349,9 @@ void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry const& node, bool departure) { - if (uint32 eventid = departure ? node.departureEventID : node.arrivalEventID) + if (uint32 eventid = departure ? node.DepartureEventID : node.ArrivalEventID) { - TC_LOG_DEBUG("maps.script", "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player->GetName().c_str()); + TC_LOG_DEBUG("maps.script", "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.NodeIndex, node.PathID, player->GetName().c_str()); player->GetMap()->ScriptsStart(sEventScripts, eventid, player, player); } } @@ -359,7 +359,7 @@ void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry bool FlightPathMovementGenerator::GetResetPos(Player*, float& x, float& y, float& z) { const TaxiPathNodeEntry& node = (*i_path)[i_currentNode]; - x = node.x; y = node.y; z = node.z; + x = node.Loc.X; y = node.Loc.Y; z = node.Loc.Z; return true; } @@ -368,10 +368,10 @@ void FlightPathMovementGenerator::InitEndGridInfo() /*! Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will be reinitialized for each flightmaster at the end of each spline (or stop) in the flight. */ uint32 nodeCount = (*i_path).size(); //! Number of nodes in path. - _endMapId = (*i_path)[nodeCount - 1].mapid; //! MapId of last node + _endMapId = (*i_path)[nodeCount - 1].MapID; //! MapId of last node _preloadTargetNode = nodeCount - 3; - _endGridX = (*i_path)[nodeCount - 1].x; - _endGridY = (*i_path)[nodeCount - 1].y; + _endGridX = (*i_path)[nodeCount - 1].Loc.X; + _endGridY = (*i_path)[nodeCount - 1].Loc.Y; } void FlightPathMovementGenerator::PreloadEndGrid() diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 292f126d8a4..c55c92d296e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -496,7 +496,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId())); if (item_rand_suffix) { - for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; k++) + for (int k = 0; k < MAX_ITEM_RANDOM_PROPERTIES; k++) { SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k]); if (pEnchant) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 451cc180cd3..0baab94d88e 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1890,11 +1890,11 @@ SpellCastResult SpellInfo::CheckVehicle(Unit const* caster) const VehicleSeatEntry const* vehicleSeat = vehicle->GetSeatForPassenger(caster); if (!(AttributesEx6 & SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !(Attributes & 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) { diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 2c5d5c76bbe..3b7ab7abe30 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2818,6 +2818,11 @@ void SpellMgr::LoadSpellInfoStore() SpellEffectEntry const* effect = sSpellEffectStore.LookupEntry(i); if (!effect) continue; + + // TODO: 6.x implement dynamic spell effect storage and remove MAX_SPELL_EFFECTS + // This is a temporary fix to avoid crash when loading spells + if (effect->EffectIndex >= MAX_SPELL_EFFECTS) + continue; effectsBySpell[effect->SpellID].effects[effect->EffectIndex] = effect; } diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index c1f4f027c60..d7dac2a4012 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -199,9 +199,9 @@ public: return false; } - if (!MapManager::IsValidMapCoord(gy->map_id, gy->x, gy->y, gy->z)) + if (!MapManager::IsValidMapCoord(gy->MapID, 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->MapID); handler->SetSentErrorMessage(true); return false; } @@ -216,7 +216,7 @@ public: else player->SaveRecallPosition(); - player->TeleportTo(gy->map_id, gy->x, gy->y, gy->z, (gy->Facing * M_PI) / 180); // Orientation is initially in degrees + player->TeleportTo(gy->MapID, gy->Loc.X, gy->Loc.Y, gy->Loc.Z, (gy->Facing * M_PI) / 180); // Orientation is initially in degrees return true; } @@ -345,10 +345,10 @@ public: return false; } - if ((node->x == 0.0f && node->y == 0.0f && node->z == 0.0f) || - !MapManager::IsValidMapCoord(node->map_id, node->x, node->y, node->z)) + if ((node->Pos.X == 0.0f && node->Pos.Y == 0.0f && node->Pos.Z == 0.0f) || + !MapManager::IsValidMapCoord(node->MapID, node->Pos.X, node->Pos.Y, node->Pos.Z)) { - handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, node->x, node->y, node->map_id); + handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, node->Pos.X, node->Pos.Y, node->MapID); handler->SetSentErrorMessage(true); return false; } @@ -363,7 +363,7 @@ public: else player->SaveRecallPosition(); - player->TeleportTo(node->map_id, node->x, node->y, node->z, player->GetOrientation()); + player->TeleportTo(node->MapID, node->Pos.X, node->Pos.Y, node->Pos.Z, player->GetOrientation()); return true; } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 55468788d9f..75d22b86824 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -949,7 +949,7 @@ public: TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(id); if (nodeEntry) { - std::string name = nodeEntry->name; + std::string name = nodeEntry->Name_lang; if (name.empty()) continue; @@ -965,10 +965,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(), "", - nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); + nodeEntry->MapID, nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z); else handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), "", - nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); + nodeEntry->MapID, nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z); if (!found) found = true; diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index b0059de7e27..285e9b2c2a4 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -215,7 +215,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->MapID, safeLoc->Loc.X, safeLoc->Loc.Y, safeLoc->Loc.Z, 0); } return true; } @@ -554,7 +554,7 @@ public: 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; } |