From e1cb43e831d017f7b0e047737d8983189d24f734 Mon Sep 17 00:00:00 2001 From: Intel Date: Wed, 5 Nov 2014 23:33:56 +0200 Subject: Core/DataStores: Fixed build after rename --- src/server/scripts/Commands/cs_lookup.cpp | 4 ++-- src/server/scripts/Commands/cs_misc.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 714d1851a3e..b4b0c2502ad 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -1132,7 +1132,7 @@ public: { if (MapEntry const* mapInfo = sMapStore.LookupEntry(id)) { - std::string name = mapInfo->name; + std::string name = mapInfo->MapName_lang; if (name.empty()) continue; @@ -1150,7 +1150,7 @@ public: if (mapInfo->IsContinent()) ss << handler->GetTrinityString(LANG_CONTINENT); - switch (mapInfo->map_type) + switch (mapInfo->InstanceType) { case MAP_INSTANCE: ss << handler->GetTrinityString(LANG_INSTANCE); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index bd7cb9175fa..d51150edb66 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -202,7 +202,7 @@ public: char const* unknown = handler->GetTrinityString(LANG_UNKNOWN); handler->PSendSysMessage(LANG_MAP_POSITION, - mapId, (mapEntry ? mapEntry->name : unknown), + mapId, (mapEntry ? mapEntry->MapName_lang : unknown), zoneId, (zoneEntry ? zoneEntry->area_name : unknown), areaId, (areaEntry ? areaEntry->area_name : unknown), object->GetPhaseMask(), @@ -1714,7 +1714,7 @@ public: } if (target) - handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name, + handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->MapName_lang, (!zoneName.empty() ? zoneName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)), (!areaName.empty() ? areaName.c_str() : handler->GetTrinityString(LANG_UNKNOWN))); -- cgit v1.2.3 From 5f2b5a325b90d66915f0f8f18b9d29f22dfaf754 Mon Sep 17 00:00:00 2001 From: Intel Date: Thu, 6 Nov 2014 01:13:06 +0200 Subject: Core/DataStores: Updated AreaTrigger.dbc struct --- src/server/game/AI/SmartScripts/SmartAI.cpp | 4 +-- src/server/game/AI/SmartScripts/SmartScript.cpp | 8 ++--- .../game/Battlegrounds/Zones/BattlegroundEY.cpp | 6 ++-- src/server/game/DataStores/DBCStructure.h | 28 ++++++++-------- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/game/Handlers/MiscHandler.cpp | 38 +++++++++++----------- src/server/game/Scripting/ScriptMgr.cpp | 2 +- src/server/scripts/Commands/cs_go.cpp | 6 ++-- src/server/scripts/Events/childrens_week.cpp | 2 +- src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp | 4 +-- src/server/scripts/World/areatrigger_scripts.cpp | 12 +++---- 12 files changed, 58 insertions(+), 56 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 037a82713e1..92f7ce21f04 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -936,10 +936,10 @@ class SmartTrigger : public AreaTriggerScript if (!player->IsAlive()) return false; - TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->id); + TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->ID); SmartScript script; script.OnInitialize(NULL, trigger); - script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id); + script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->ID); return true; } }; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3de318ff030..4c8348f0238 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3405,7 +3405,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn if (obj) TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); if (at) - TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); + TC_LOG_DEBUG("scripts.ai", "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->ID); return; } for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i) @@ -3431,7 +3431,7 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn if (mEvents.empty() && obj) TC_LOG_ERROR("sql.sql", "SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry()); if (mEvents.empty() && at) - TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id); + TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->ID); } void SmartScript::GetScript() @@ -3453,7 +3453,7 @@ void SmartScript::GetScript() } else if (trigger) { - e = sSmartScriptMgr->GetScript((int32)trigger->id, mScriptType); + e = sSmartScriptMgr->GetScript((int32)trigger->ID, mScriptType); FillScript(e, NULL, trigger); } } @@ -3482,7 +3482,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) { mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER; trigger = at; - TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); + TC_LOG_DEBUG("scripts.ai", "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->ID); } else { diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 034f7c91999..d1bf2c18fac 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -510,9 +510,9 @@ bool BattlegroundEY::SetupBattleground() TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]); continue; } - if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) - || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) - || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) ) TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Cannot spawn buff"); } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 8798a328022..34925dbc2ac 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -579,19 +579,21 @@ struct AreaGroupEntry struct AreaTriggerEntry { - uint32 id; // 0 m_ID - uint32 mapid; // 1 m_ContinentID - float x; // 2 m_x - float y; // 3 m_y - float z; // 4 m_z - //uint32 // 5 - //uint32 // 6 - //uint32 // 7 - float radius; // 8 m_radius - float box_x; // 9 m_box_length - float box_y; // 10 m_box_width - float box_z; // 11 m_box_heigh - float box_orientation; // 12 m_box_yaw + uint32 ID; // 0 + uint32 ContinentID; // 1 MapID + float Pos[3]; // 2-4 + //uint32 PhaseUseFlags // 5 + //uint32 PhaseID // 6 + //uint32 PhaseGroupID // 7 + float Radius; // 8 + float BoxLength; // 9 + float BoxWidth; // 10 + float BoxHeight; // 11 + float BoxYaw; // 12 + //uint32 ShapeType // 13 + //uint32 ShapeID // 14 + //uint32 AreaTriggerActionSetID // 15 + //uint32 Flags // 16 }; struct ArmorLocationEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index ce348d05496..c1399db57bd 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -28,7 +28,7 @@ const std::string CustomAchievementIndex = "ID"; char const AchievementCriteriafmt[] = "niiiliiiisiiiiixxiiiiii"; char const AreaTableEntryfmt[] = "iiinixxxxxisiiiiiffixxxxxx"; char const AreaGroupEntryfmt[] = "niiiiiii"; -char const AreaTriggerEntryfmt[] = "nifffxxxfffff"; +char const AreaTriggerEntryfmt[] = "nifffxxxfffffxxxx"; char const ArmorLocationfmt[] = "nfffff"; char const AuctionHouseEntryfmt[] = "niiix"; char const BankBagSlotPricesEntryfmt[] = "ni"; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 584c8c6cf5d..e850fb2ceaf 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6320,7 +6320,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId)) { AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first); - if (atEntry && atEntry->mapid == Map) + if (atEntry && atEntry->ContinentID == Map) return &itr->second; } return NULL; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 788ebd693dd..7e7b5aa1ab5 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -867,24 +867,24 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) return; } - if (player->GetMapId() != atEntry->mapid) + if (player->GetMapId() != atEntry->ContinentID) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", - player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->mapid, player->GetMapId(), triggerId); + player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->ContinentID, player->GetMapId(), triggerId); return; } // delta is safe radius const float delta = 5.0f; - if (atEntry->radius > 0) + if (atEntry->Radius > 0) { // if we have radius check it - float dist = player->GetDistance(atEntry->x, atEntry->y, atEntry->z); - if (dist > atEntry->radius + delta) + float dist = player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]); + if (dist > atEntry->Radius + delta) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", - player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->radius, dist, triggerId); + player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->Radius, dist, triggerId); return; } } @@ -896,26 +896,26 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) // is-in-cube check and we have to calculate only one point instead of 4 // 2PI = 360°, keep in mind that ingame orientation is counter-clockwise - double rotation = 2 * M_PI - atEntry->box_orientation; + double rotation = 2 * M_PI - atEntry->BoxYaw; double sinVal = std::sin(rotation); double cosVal = std::cos(rotation); - float playerBoxDistX = player->GetPositionX() - atEntry->x; - float playerBoxDistY = player->GetPositionY() - atEntry->y; + float playerBoxDistX = player->GetPositionX() - atEntry->Pos[0]; + float playerBoxDistY = player->GetPositionY() - atEntry->Pos[1]; - float rotPlayerX = float(atEntry->x + playerBoxDistX * cosVal - playerBoxDistY*sinVal); - float rotPlayerY = float(atEntry->y + playerBoxDistY * cosVal + playerBoxDistX*sinVal); + float rotPlayerX = float(atEntry->Pos[0] + playerBoxDistX * cosVal - playerBoxDistY*sinVal); + float rotPlayerY = float(atEntry->Pos[1] + playerBoxDistY * cosVal + playerBoxDistX*sinVal); // box edges are parallel to coordiante axis, so we can treat every dimension independently :D - float dz = player->GetPositionZ() - atEntry->z; - float dx = rotPlayerX - atEntry->x; - float dy = rotPlayerY - atEntry->y; - if ((std::fabs(dx) > atEntry->box_x / 2 + delta) || - (std::fabs(dy) > atEntry->box_y / 2 + delta) || - (std::fabs(dz) > atEntry->box_z / 2 + delta)) + float dz = player->GetPositionZ() - atEntry->Pos[2]; + float dx = rotPlayerX - atEntry->Pos[0]; + float dy = rotPlayerY - atEntry->Pos[1]; + if ((std::fabs(dx) > atEntry->BoxLength / 2 + delta) || + (std::fabs(dy) > atEntry->BoxWidth / 2 + delta) || + (std::fabs(dz) > atEntry->BoxHeight / 2 + delta)) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", - player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->box_x / 2, atEntry->box_y / 2, atEntry->box_z / 2, rotPlayerX, rotPlayerY, dz, triggerId); + player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->BoxLength / 2, atEntry->BoxWidth / 2, atEntry->BoxHeight / 2, rotPlayerX, rotPlayerY, dz, triggerId); return; } } @@ -935,7 +935,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) { // set resting flag we are in the inn player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); - player->InnEnter(time(NULL), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z); + player->InnEnter(time(NULL), atEntry->ContinentID, atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]); player->SetRestType(REST_TYPE_IN_TAVERN); if (sWorld->IsFFAPvPRealm()) diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 30926e8f06b..ac0b5bbf2e6 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -925,7 +925,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTriggerEntry const* trigger) ASSERT(player); ASSERT(trigger); - GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->id), tmpscript, false); + GET_SCRIPT_RET(AreaTriggerScript, sObjectMgr->GetAreaTriggerScriptId(trigger->ID), tmpscript, false); return tmpscript->OnTrigger(player, trigger); } diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 162e1665177..9b367bab6a0 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -391,9 +391,9 @@ public: return false; } - if (!MapManager::IsValidMapCoord(at->mapid, at->x, at->y, at->z)) + if (!MapManager::IsValidMapCoord(at->ContinentID, at->Pos[0], at->Pos[1], at->Pos[2])) { - handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->x, at->y, at->mapid); + handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->Pos[0], at->Pos[1], at->ContinentID); handler->SetSentErrorMessage(true); return false; } @@ -408,7 +408,7 @@ public: else player->SaveRecallPosition(); - player->TeleportTo(at->mapid, at->x, at->y, at->z, player->GetOrientation()); + player->TeleportTo(at->ContinentID, at->Pos[0], at->Pos[1], at->Pos[2], player->GetOrientation()); return true; } diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 44d503ac672..beaff689a8d 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -928,7 +928,7 @@ class at_bring_your_orphan_to : public AreaTriggerScript uint32 questId = 0; uint32 orphanId = 0; - switch (trigger->id) + switch (trigger->ID) { case AT_DOWN_AT_THE_DOCKS: questId = QUEST_DOWN_AT_THE_DOCKS; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 5d6d075a09d..3ced2ee0b90 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -155,7 +155,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) if (atEntry) { // 5.0f is safe-distance - if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius) + if (player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]) > 5.0f + atEntry->Radius) { // he dropped it further, summon mound GameObject* go = new GameObject; @@ -192,7 +192,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) if (atEntry) { // 5.0f is safe-distance - if (player->GetDistance(atEntry->x, atEntry->y, atEntry->z) > 5.0f + atEntry->radius) + if (player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]) > 5.0f + atEntry->Radius) { // he dropped it further, summon mound GameObject* go = new GameObject; diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp index a1e328ebaf0..535d1f3e1d1 100644 --- a/src/server/scripts/World/areatrigger_scripts.cpp +++ b/src/server/scripts/World/areatrigger_scripts.cpp @@ -180,7 +180,7 @@ class AreaTrigger_at_last_rites : public AreaTriggerScript WorldLocation pPosition; - switch (trigger->id) + switch (trigger->ID) { case 5332: case 5338: @@ -233,7 +233,7 @@ class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript if (!player->isDead() && (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) != QUEST_STATUS_NONE || (player->GetQuestStatus(QUEST_THE_MAKERS_OVERLOOK) == QUEST_STATUS_REWARDED && player->GetQuestStatus(QUEST_THE_MAKERS_PERCH) == QUEST_STATUS_REWARDED))) { - switch (trigger->id) + switch (trigger->ID) { case AT_SHOLAZAR: player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, true); @@ -312,7 +312,7 @@ class AreaTrigger_at_brewfest : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override { - uint32 triggerId = trigger->id; + uint32 triggerId = trigger->ID; // Second trigger happened too early after first, skip for now if (sWorld->GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN) return false; @@ -370,8 +370,8 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript if (!player->IsAlive()) return false; - uint32 triggerId = trigger->id; - if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN) + uint32 triggerId = trigger->ID; + if (sWorld->GetGameTime() - _triggerTimes[trigger->ID] < SUMMON_COOLDOWN) return false; switch (triggerId) @@ -400,7 +400,7 @@ class AreaTrigger_at_area_52_entrance : public AreaTriggerScript player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000); player->AddAura(SPELL_A52_NEURALYZER, player); - _triggerTimes[trigger->id] = sWorld->GetGameTime(); + _triggerTimes[trigger->ID] = sWorld->GetGameTime(); return false; } -- cgit v1.2.3 From 4123e27a66ff88ccdd16adea473a7ce96a511ffd Mon Sep 17 00:00:00 2001 From: Intel Date: Fri, 7 Nov 2014 13:53:25 +0200 Subject: Core/DataStores: Fixed name consistency and improved coords handling --- src/server/game/Achievements/AchievementMgr.cpp | 4 +- .../game/Battlegrounds/Zones/BattlegroundEY.cpp | 6 +- src/server/game/DataStores/DBCStructure.h | 91 ++++++++++++---------- src/server/game/Globals/ObjectMgr.cpp | 8 +- src/server/game/Handlers/MiscHandler.cpp | 22 +++--- src/server/game/Handlers/QueryHandler.cpp | 4 +- src/server/scripts/Commands/cs_go.cpp | 6 +- src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp | 4 +- 8 files changed, 79 insertions(+), 66 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 7cadbe4d7fa..a749396ad79 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -2329,7 +2329,7 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criter return false; } - if (achievement->InstanceID != -1 && referencePlayer->GetMapId() != uint32(achievement->InstanceID)) + if (achievement->MapID != -1 && referencePlayer->GetMapId() != uint32(achievement->MapID)) { TC_LOG_TRACE("achievement", "CanUpdateCriteria: %s (Id: %u Type %s) Wrong map", criteria->name, criteria->ID, AchievementGlobalMgr::GetCriteriaTypeString(criteria->type)); @@ -3190,7 +3190,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() // Once Bitten, Twice Shy (10 player) - Icecrown Citadel if (AchievementEntry const* achievement = sAchievementMgr->GetAchievement(4539)) - const_cast(achievement)->InstanceID = 631; // Correct map requirement (currently has Ulduar) + const_cast(achievement)->MapID = 631; // Correct map requirement (currently has Ulduar) TC_LOG_INFO("server.loading", ">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index d1bf2c18fac..a9647c5d384 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -510,9 +510,9 @@ bool BattlegroundEY::SetupBattleground() TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]); continue; } - if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) - || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) - || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->Pos[0], at->Pos[1], at->Pos[2], 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) + || !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->Pos.X, at->Pos.Y, at->Pos.Z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY) ) TC_LOG_ERROR("bg.battleground", "BattlegroundEY: Cannot spawn buff"); } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index ce0b591b403..df25d288ad8 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -38,11 +38,24 @@ #pragma pack(push, 1) #endif +struct DBCPosition2D +{ + float X; + float Y; +}; + +struct DBCPosition3D +{ + float X; + float Y; + float Z; +}; + struct AchievementEntry { uint32 ID; // 0 int32 Faction; // 1 -1=all, 0=horde, 1=alliance - int32 InstanceID; // 2 MapID -1=none + int32 MapID; // 2 -1=none //uint32 Supercedes; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) char* Title_lang; // 4 //char* Description_lang; // 5 @@ -579,21 +592,21 @@ struct AreaGroupEntry struct AreaTriggerEntry { - uint32 ID; // 0 - uint32 ContinentID; // 1 MapID - float Pos[3]; // 2-4 - //uint32 PhaseUseFlags // 5 - //uint32 PhaseID // 6 - //uint32 PhaseGroupID // 7 - float Radius; // 8 - float BoxLength; // 9 - float BoxWidth; // 10 - float BoxHeight; // 11 - float BoxYaw; // 12 - //uint32 ShapeType // 13 - //uint32 ShapeID // 14 - //uint32 AreaTriggerActionSetID // 15 - //uint32 Flags // 16 + uint32 ID; // 0 + uint32 MapID; // 1 + DBCPosition3D Pos; // 2-4 + //uint32 PhaseUseFlags // 5 + //uint32 PhaseID // 6 + //uint32 PhaseGroupID // 7 + float Radius; // 8 + float BoxLength; // 9 + float BoxWidth; // 10 + float BoxHeight; // 11 + float BoxYaw; // 12 + //uint32 ShapeType // 13 + //uint32 ShapeID // 14 + //uint32 AreaTriggerActionSetID // 15 + //uint32 Flags // 16 }; struct ArmorLocationEntry @@ -1473,27 +1486,27 @@ struct MailTemplateEntry struct MapEntry { - uint32 ID; // 0 - //char* Directory; // 1 - uint32 InstanceType; // 2 - uint32 Flags; // 3 - //uint32 MapType; // 4 - //uint32 unk5; // 5 - char* MapName_lang; // 6 - uint32 AreaTableID; // 7 - //char* MapDescription0_lang; // 8 Horde - //char* MapDescription1_lang; // 9 Alliance - uint32 LoadingScreenID; // 10 LoadingScreens.dbc - //float MinimapIconScale; // 11 - int32 CorpseMapID; // 12 map_id of entrance map in ghost mode (continent always and in most cases = normal entrance) - float Corpse[2]; // 13 entrance coordinates in ghost mode (in most cases = normal entrance) - //uint32 TimeOfDayOverride; // 15 - uint32 ExpansionID; // 16 - uint32 RaidOffset; // 17 - uint32 MaxPlayers; // 18 - int32 ParentMapID; // 19 related to phasing - //uint32 CosmeticParentMapID // 20 - //uint32 TimeOffset // 21 + uint32 ID; // 0 + //char* Directory; // 1 + uint32 InstanceType; // 2 + uint32 Flags; // 3 + //uint32 MapType; // 4 + //uint32 unk5; // 5 + char* MapName_lang; // 6 + uint32 AreaTableID; // 7 + //char* MapDescription0_lang; // 8 Horde + //char* MapDescription1_lang; // 9 Alliance + uint32 LoadingScreenID; // 10 LoadingScreens.dbc + //float MinimapIconScale; // 11 + int32 CorpseMapID; // 12 map_id of entrance map in ghost mode (continent always and in most cases = normal entrance) + DBCPosition2D CorpsePos; // 13 entrance coordinates in ghost mode (in most cases = normal entrance) + //uint32 TimeOfDayOverride; // 15 + uint32 ExpansionID; // 16 + uint32 RaidOffset; // 17 + uint32 MaxPlayers; // 18 + int32 ParentMapID; // 19 related to phasing + //uint32 CosmeticParentMapID // 20 + //uint32 TimeOffset // 21 // Helpers uint32 Expansion() const { return ExpansionID; } @@ -1512,8 +1525,8 @@ struct MapEntry if (CorpseMapID < 0) return false; mapid = CorpseMapID; - x = Corpse[0]; - y = Corpse[1]; + x = CorpsePos.X; + y = CorpsePos.Y; return true; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e8905d7a006..a582f2b2afa 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -6000,7 +6000,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float if (!mapEntry || mapEntry->CorpseMapID < 0 || uint32(mapEntry->CorpseMapID) != entry->map_id - || (mapEntry->Corpse[0] == 0 && mapEntry->Corpse[1] == 0)) // Check X and Y + || (mapEntry->CorpsePos.X == 0 && mapEntry->CorpsePos.Y == 0)) // Check X and Y { // not have any corrdinates for check distance anyway entryFar = entry; @@ -6008,8 +6008,8 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float } // at entrance map calculate distance (2D); - float dist2 = (entry->x - mapEntry->Corpse[0])*(entry->x - mapEntry->Corpse[0]) - +(entry->y - mapEntry->Corpse[1])*(entry->y - mapEntry->Corpse[1]); + float dist2 = (entry->x - mapEntry->CorpsePos.X)*(entry->x - mapEntry->CorpsePos.X) + +(entry->y - mapEntry->CorpsePos.Y)*(entry->y - mapEntry->CorpsePos.Y); if (foundEntr) { if (dist2 < distEntr) @@ -6320,7 +6320,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId)) { AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first); - if (atEntry && atEntry->ContinentID == Map) + if (atEntry && atEntry->MapID == Map) return &itr->second; } return NULL; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 7e7b5aa1ab5..455f003e5df 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -867,10 +867,10 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) return; } - if (player->GetMapId() != atEntry->ContinentID) + if (player->GetMapId() != atEntry->MapID) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", - player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->ContinentID, player->GetMapId(), triggerId); + player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->MapID, player->GetMapId(), triggerId); return; } @@ -880,7 +880,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) if (atEntry->Radius > 0) { // if we have radius check it - float dist = player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]); + float dist = player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z); if (dist > atEntry->Radius + delta) { TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", @@ -900,16 +900,16 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) double sinVal = std::sin(rotation); double cosVal = std::cos(rotation); - float playerBoxDistX = player->GetPositionX() - atEntry->Pos[0]; - float playerBoxDistY = player->GetPositionY() - atEntry->Pos[1]; + float playerBoxDistX = player->GetPositionX() - atEntry->Pos.X; + float playerBoxDistY = player->GetPositionY() - atEntry->Pos.Y; - float rotPlayerX = float(atEntry->Pos[0] + playerBoxDistX * cosVal - playerBoxDistY*sinVal); - float rotPlayerY = float(atEntry->Pos[1] + playerBoxDistY * cosVal + playerBoxDistX*sinVal); + float rotPlayerX = float(atEntry->Pos.X + playerBoxDistX * cosVal - playerBoxDistY*sinVal); + float rotPlayerY = float(atEntry->Pos.Y + playerBoxDistY * cosVal + playerBoxDistX*sinVal); // box edges are parallel to coordiante axis, so we can treat every dimension independently :D - float dz = player->GetPositionZ() - atEntry->Pos[2]; - float dx = rotPlayerX - atEntry->Pos[0]; - float dy = rotPlayerY - atEntry->Pos[1]; + float dz = player->GetPositionZ() - atEntry->Pos.Z; + float dx = rotPlayerX - atEntry->Pos.X; + float dy = rotPlayerY - atEntry->Pos.Y; if ((std::fabs(dx) > atEntry->BoxLength / 2 + delta) || (std::fabs(dy) > atEntry->BoxWidth / 2 + delta) || (std::fabs(dz) > atEntry->BoxHeight / 2 + delta)) @@ -935,7 +935,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) { // set resting flag we are in the inn player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); - player->InnEnter(time(NULL), atEntry->ContinentID, atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]); + player->InnEnter(time(NULL), atEntry->MapID, atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z); player->SetRestType(REST_TYPE_IN_TAVERN); if (sWorld->IsFFAPvPRealm()) diff --git a/src/server/game/Handlers/QueryHandler.cpp b/src/server/game/Handlers/QueryHandler.cpp index d58aea3bfe9..2d7d18858cd 100644 --- a/src/server/game/Handlers/QueryHandler.cpp +++ b/src/server/game/Handlers/QueryHandler.cpp @@ -258,8 +258,8 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket& /*recvData*/) if (Map const* entranceMap = sMapMgr->CreateBaseMap(corpseMapEntry->CorpseMapID)) { mapid = corpseMapEntry->CorpseMapID; - x = corpseMapEntry->Corpse[0]; - y = corpseMapEntry->Corpse[1]; + x = corpseMapEntry->CorpsePos.X; + y = corpseMapEntry->CorpsePos.Y; z = entranceMap->GetHeight(GetPlayer()->GetPhaseMask(), x, y, MAX_HEIGHT); } } diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 9b367bab6a0..c1f4f027c60 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -391,9 +391,9 @@ public: return false; } - if (!MapManager::IsValidMapCoord(at->ContinentID, at->Pos[0], at->Pos[1], at->Pos[2])) + if (!MapManager::IsValidMapCoord(at->MapID, at->Pos.X, at->Pos.Y, at->Pos.Z)) { - handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->Pos[0], at->Pos[1], at->ContinentID); + handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, at->Pos.X, at->Pos.Y, at->MapID); handler->SetSentErrorMessage(true); return false; } @@ -408,7 +408,7 @@ public: else player->SaveRecallPosition(); - player->TeleportTo(at->ContinentID, at->Pos[0], at->Pos[1], at->Pos[2], player->GetOrientation()); + player->TeleportTo(at->MapID, at->Pos.X, at->Pos.Y, at->Pos.Z, player->GetOrientation()); return true; } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp index 3ced2ee0b90..4a99ced5d55 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -155,7 +155,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) if (atEntry) { // 5.0f is safe-distance - if (player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]) > 5.0f + atEntry->Radius) + if (player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z) > 5.0f + atEntry->Radius) { // he dropped it further, summon mound GameObject* go = new GameObject; @@ -192,7 +192,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) if (atEntry) { // 5.0f is safe-distance - if (player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]) > 5.0f + atEntry->Radius) + if (player->GetDistance(atEntry->Pos.X, atEntry->Pos.Y, atEntry->Pos.Z) > 5.0f + atEntry->Radius) { // he dropped it further, summon mound GameObject* go = new GameObject; -- cgit v1.2.3 From e289335e0afb383e30a82a8585fe8430810f35da Mon Sep 17 00:00:00 2001 From: Intel Date: Fri, 7 Nov 2014 14:32:47 +0200 Subject: Core/DataStores: Updated BattlemasterList.dbc, CharStartOutfit.dbc, CharTitle.dbc structs --- src/server/game/Achievements/AchievementMgr.cpp | 2 +- src/server/game/Battlegrounds/BattlegroundMgr.cpp | 10 ++-- src/server/game/Battlegrounds/BattlegroundMgr.h | 2 +- src/server/game/DataStores/DBCStores.cpp | 2 +- src/server/game/DataStores/DBCStructure.h | 61 ++++++++++++----------- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Entities/Player/Player.cpp | 18 +++---- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Events/GameEventMgr.cpp | 4 +- src/server/game/Globals/ObjectMgr.cpp | 8 +-- src/server/game/Groups/Group.cpp | 2 +- src/server/game/Handlers/CharacterHandler.cpp | 20 ++++---- src/server/scripts/Commands/cs_character.cpp | 8 +-- src/server/scripts/Commands/cs_lookup.cpp | 8 +-- src/server/scripts/Commands/cs_titles.cpp | 10 ++-- 15 files changed, 81 insertions(+), 78 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index a749396ad79..47424798ec0 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -370,7 +370,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_KNOWN_TITLE: { if (CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(known_title.title_id)) - return source && source->HasTitle(titleInfo->bit_index); + return source && source->HasTitle(titleInfo->MaskID); return false; } diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index eae6a831290..663530cd8ff 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -742,8 +742,8 @@ bool BattlegroundMgr::CreateBattleground(BattlegroundTemplate const* bgTemplate) AddBattleground(bg); } - bg->SetMapId(bgTemplate->BattlemasterEntry->mapid[0]); - bg->SetName(bgTemplate->BattlemasterEntry->name); + bg->SetMapId(bgTemplate->BattlemasterEntry->MapID[0]); + bg->SetName(bgTemplate->BattlemasterEntry->Name_lang); bg->SetInstanceID(0); bg->SetArenaorBGType(bgTemplate->IsArena()); bg->SetMinPlayersPerTeam(bgTemplate->MinPlayersPerTeam); @@ -852,8 +852,8 @@ void BattlegroundMgr::LoadBattlegroundTemplates() _battlegroundTemplates[bgTypeId] = bgTemplate; - if (bgTemplate.BattlemasterEntry->mapid[1] == -1) // in this case we have only one mapId - _battlegroundMapTemplates[bgTemplate.BattlemasterEntry->mapid[0]] = &_battlegroundTemplates[bgTypeId]; + if (bgTemplate.BattlemasterEntry->MapID[1] == -1) // in this case we have only one mapId + _battlegroundMapTemplates[bgTemplate.BattlemasterEntry->MapID[0]] = &_battlegroundTemplates[bgTypeId]; ++count; } @@ -1211,7 +1211,7 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId) uint32 weight = 0; BattlegroundSelectionWeightMap selectionWeights; - for (int32 mapId : bgTemplate->BattlemasterEntry->mapid) + for (int32 mapId : bgTemplate->BattlemasterEntry->MapID) { if (mapId == -1) break; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index 23689c03fba..0be6092eb4b 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -51,7 +51,7 @@ struct BattlegroundTemplate uint32 ScriptId; BattlemasterListEntry const* BattlemasterEntry; - bool IsArena() const { return BattlemasterEntry->type == MAP_ARENA; } + bool IsArena() const { return BattlemasterEntry->InstanceType == MAP_ARENA; } }; class BattlegroundMgr diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 6bf5b49b297..af24e182869 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -356,7 +356,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sCharStartOutfitStore, dbcPath, "CharStartOutfit.dbc");//15595 for (uint32 i = 0; i < sCharStartOutfitStore.GetNumRows(); ++i) if (CharStartOutfitEntry const* outfit = sCharStartOutfitStore.LookupEntry(i)) - sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit; + sCharStartOutfitMap[outfit->RaceID | (outfit->ClassID << 8) | (outfit->GenderID << 16)] = outfit; LoadDBC(availableDbcLocales, bad_dbc_files, sCharTitlesStore, dbcPath, "CharTitles.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sChatChannelsStore, dbcPath, "ChatChannels.dbc");//15595 diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index df25d288ad8..18096038b79 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -653,45 +653,48 @@ struct BarberShopStyleEntry struct BattlemasterListEntry { - uint32 id; // 0 - int32 mapid[8]; // 1-8 mapid - uint32 type; // 9 map type (3 - BG, 4 - arena) - //uint32 canJoinAsGroup; // 10 (0 or 1) - char* name; // 11 - uint32 maxGroupSize; // 12 maxGroupSize, used for checking if queue as group - uint32 HolidayWorldStateId; // 13 new 3.1 - uint32 minLevel; // 14, min level (sync with PvPDifficulty.dbc content) - uint32 maxLevel; // 15, max level (sync with PvPDifficulty.dbc content) - //uint32 maxGroupSizeRated; // 16 4.0.1 - //uint32 unk; // 17 - 4.0.6.13596 - //uint32 maxPlayers; // 18 4.0.1 - //uint32 unk1; // 19 4.0.3, value 2 for Rated Battlegrounds + uint32 ID; // 0 + uint32 MapID[16]; // 1-16 mapid + uint32 InstanceType; // 17 map type (3 - BG, 4 - arena) + //uint32 GroupsAllowed; // 18 (0 or 1) + char* Name_lang; // 19 + uint32 MaxGroupSize; // 20 maxGroupSize, used for checking if queue as group + uint32 HolidayWorldState; // 21 new 3.1 + uint32 MinLevel; // 22, min level (sync with PvPDifficulty.dbc content) + uint32 MaxLevel; // 23, max level (sync with PvPDifficulty.dbc content) + //uint32 RatedPlayers; // 24 4.0.1 + //uint32 MinPlayers; // 25 - 4.0.6.13596 + //uint32 MaxPlayers; // 26 4.0.1 + //uint32 Flags; // 27 4.0.3, value 2 for Rated Battlegrounds + //uint32 IconFileDataID; // 28 + //char* GameType_lang; // 29 + //uint32 Unk1; // 30 }; #define MAX_OUTFIT_ITEMS 24 struct CharStartOutfitEntry { - //uint32 Id; // 0 - uint8 Race; // 1 - uint8 Class; // 2 - uint8 Gender; // 3 - //uint8 Unused; // 4 - int32 ItemId[MAX_OUTFIT_ITEMS]; // 5-28 - //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 29-52 not required at server side - //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 53-76 not required at server side - uint32 PetDisplayId; // 77 Pet Model ID for starting pet - uint32 PetFamilyEntry; // 78 Pet Family Entry for starting pet + //uint32 ID; // 0 + uint8 RaceID; // 1 + uint8 ClassID; // 2 + 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 }; struct CharTitlesEntry { - uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() - //uint32 unk1; // 1 flags? - char* nameMale; // 2 m_name_lang - char* nameFemale; // 3 m_name1_lang - uint32 bit_index; // 4 m_mask_ID used in PLAYER_CHOSEN_TITLE and 1<ItemId[j] <= 0) + if (oEntry->ItemID[j] <= 0) continue; - uint32 itemId = oEntry->ItemId[j]; + uint32 itemId = oEntry->ItemID[j]; // just skip, reported in ObjectMgr::LoadItemTemplates ItemTemplate const* iProto = sObjectMgr->GetItemTemplate(itemId); @@ -9705,12 +9705,12 @@ void Player::SendBGWeekendWorldStates() for (uint32 i = 1; i < sBattlemasterListStore.GetNumRows(); ++i) { BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(i); - if (bl && bl->HolidayWorldStateId) + if (bl && bl->HolidayWorldState) { - if (BattlegroundMgr::IsBGWeekend((BattlegroundTypeId)bl->id)) - SendUpdateWorldState(bl->HolidayWorldStateId, 1); + if (BattlegroundMgr::IsBGWeekend((BattlegroundTypeId)bl->ID)) + SendUpdateWorldState(bl->HolidayWorldState, 1); else - SendUpdateWorldState(bl->HolidayWorldStateId, 0); + SendUpdateWorldState(bl->HolidayWorldState, 0); } } } @@ -24957,8 +24957,8 @@ bool Player::HasTitle(uint32 bitIndex) const void Player::SetTitle(CharTitlesEntry const* title, bool lost) { - uint32 fieldIndexOffset = title->bit_index / 32; - uint32 flag = 1 << (title->bit_index % 32); + uint32 fieldIndexOffset = title->MaskID / 32; + uint32 flag = 1 << (title->MaskID % 32); if (lost) { @@ -24976,7 +24976,7 @@ void Player::SetTitle(CharTitlesEntry const* title, bool lost) } WorldPacket data(SMSG_TITLE_EARNED, 4 + 4); - data << uint32(title->bit_index); + data << uint32(title->MaskID); data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost GetSession()->SendPacket(&data); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 8509ec2bcf1..fe8ef48d267 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2539,7 +2539,7 @@ class Player : public Unit, public GridObject void CompletedAchievement(AchievementEntry const* entry); bool HasTitle(uint32 bitIndex) const; - bool HasTitle(CharTitlesEntry const* title) const { return HasTitle(title->bit_index); } + bool HasTitle(CharTitlesEntry const* title) const { return HasTitle(title->MaskID); } void SetTitle(CharTitlesEntry const* title, bool lost = false); //bool isActiveObject() const { return true; } diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 780360dc945..f8bc5e01c7b 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -1484,10 +1484,10 @@ void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate) if (bgTypeId != BATTLEGROUND_TYPE_NONE) { BattlemasterListEntry const* bl = sBattlemasterListStore.LookupEntry(bgTypeId); - if (bl && bl->HolidayWorldStateId) + if (bl && bl->HolidayWorldState) { WorldPacket data; - sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, bl->HolidayWorldStateId, Activate ? 1 : 0); + sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, bl->HolidayWorldState, Activate ? 1 : 0); sWorld->SendGlobalMessage(&data); } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index a582f2b2afa..8ec41b82d7f 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2792,10 +2792,10 @@ void ObjectMgr::LoadItemTemplates() for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j) { - if (entry->ItemId[j] <= 0) + if (entry->ItemID[j] <= 0) continue; - uint32 item_id = entry->ItemId[j]; + uint32 item_id = entry->ItemID[j]; if (!GetItemTemplate(item_id)) notFoundOutfit.insert(item_id); @@ -3098,10 +3098,10 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3 bool found = false; for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x) { - if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId) + if (entry->ItemID[x] > 0 && uint32(entry->ItemID[x]) == itemId) { found = true; - const_cast(entry)->ItemId[x] = 0; + const_cast(entry)->ItemID[x] = 0; break; } } diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index a434df716f0..8795bd812de 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1851,7 +1851,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* // check for min / max count uint32 memberscount = GetMembersCount(); - if (memberscount > bgEntry->maxGroupSize) // no MinPlayerCount for battlegrounds + if (memberscount > bgEntry->MaxGroupSize) // no MinPlayerCount for battlegrounds return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side // get a player as reference, to compare other players' stats to (arena team id, queue id based on level, etc.) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 40f7eb98029..afbc283676d 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2113,28 +2113,28 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) // new team if (team == TEAM_ALLIANCE) { - uint32 bitIndex = htitleInfo->bit_index; - uint32 index = bitIndex / 32; - uint32 old_flag = 1 << (bitIndex % 32); - uint32 new_flag = 1 << (atitleInfo->bit_index % 32); + uint32 maskID = htitleInfo->MaskID; + uint32 index = maskID / 32; + uint32 old_flag = 1 << (maskID % 32); + uint32 new_flag = 1 << (atitleInfo->MaskID % 32); if (knownTitles[index] & old_flag) { knownTitles[index] &= ~old_flag; // use index of the new title - knownTitles[atitleInfo->bit_index / 32] |= new_flag; + knownTitles[atitleInfo->MaskID / 32] |= new_flag; } } else { - uint32 bitIndex = atitleInfo->bit_index; - uint32 index = bitIndex / 32; - uint32 old_flag = 1 << (bitIndex % 32); - uint32 new_flag = 1 << (htitleInfo->bit_index % 32); + uint32 maskID = atitleInfo->MaskID; + uint32 index = maskID / 32; + uint32 old_flag = 1 << (maskID % 32); + uint32 new_flag = 1 << (htitleInfo->MaskID % 32); if (knownTitles[index] & old_flag) { knownTitles[index] &= ~old_flag; // use index of the new title - knownTitles[htitleInfo->bit_index / 32] |= new_flag; + knownTitles[htitleInfo->MaskID / 32] |= new_flag; } } diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 0b351e310f4..058f7435713 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -277,11 +277,11 @@ public: if (titleInfo && target->HasTitle(titleInfo)) { - std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale; + std::string name = target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang; if (name.empty()) continue; - char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + char const* activeStr = target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->MaskID ? handler->GetTrinityString(LANG_ACTIVE) : ""; @@ -290,9 +290,9 @@ public: // send title in "id (idx:idx) - [namedlink locale]" format if (handler->GetSession()) - handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->MaskID, id, titleNameStr, localeNames[loc], knownStr, activeStr); else - handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->MaskID, name.c_str(), localeNames[loc], knownStr, activeStr); } } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index b4b0c2502ad..1833761ea17 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -1072,7 +1072,7 @@ public: CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id); if (titleInfo) { - std::string name = target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale; + std::string name = target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang; if (name.empty()) continue; @@ -1088,7 +1088,7 @@ public: char const* knownStr = target && target->HasTitle(titleInfo) ? handler->GetTrinityString(LANG_KNOWN) : ""; - char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index + char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->MaskID ? handler->GetTrinityString(LANG_ACTIVE) : ""; @@ -1097,9 +1097,9 @@ public: // send title in "id (idx:idx) - [namedlink locale]" format if (handler->GetSession()) - handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, "", knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->MaskID, id, titleNameStr, "", knownStr, activeStr); else - handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, "", knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->MaskID, titleNameStr, "", knownStr, activeStr); ++counter; } diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 0826e0ca476..60d376d867a 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -94,9 +94,9 @@ public: std::string tNameLink = handler->GetNameLink(target); target->SetTitle(titleInfo); // to be sure that title now known - target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->bit_index); + target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->MaskID); - handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, tNameLink.c_str()); + handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id, target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang, tNameLink.c_str()); return true; } @@ -138,7 +138,7 @@ public: std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, target->GetName().c_str()); + snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang, target->GetName().c_str()); target->SetTitle(titleInfo); handler->PSendSysMessage(LANG_TITLE_ADD_RES, id, titleNameStr, tNameLink.c_str()); @@ -186,7 +186,7 @@ public: std::string tNameLink = handler->GetNameLink(target); char titleNameStr[80]; - snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->nameMale : titleInfo->nameFemale, target->GetName().c_str()); + snprintf(titleNameStr, 80, target->getGender() == GENDER_MALE ? titleInfo->NameMale_lang : titleInfo->NameFemale_lang, target->GetName().c_str()); handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, id, titleNameStr, tNameLink.c_str()); @@ -225,7 +225,7 @@ public: for (uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i) if (CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i)) - titles2 &= ~(uint64(1) << tEntry->bit_index); + titles2 &= ~(uint64(1) << tEntry->MaskID); titles &= ~titles2; // remove not existed titles -- cgit v1.2.3 From 7c72f27b7c83b10636e57e30ca036f5b6bc5820e Mon Sep 17 00:00:00 2001 From: Intel Date: Fri, 7 Nov 2014 17:39:16 +0200 Subject: Core/DataStores: Updated ChatChannels.dbc, ChrClasses.dbc, ChrRaces.dbc structs --- src/server/game/Chat/Channels/Channel.cpp | 6 +- src/server/game/DataStores/DBCStores.cpp | 4 +- src/server/game/DataStores/DBCStructure.h | 98 ++++++++++++++++----------- src/server/game/DataStores/DBCfmt.h | 4 +- src/server/game/Entities/Player/Player.cpp | 28 ++++---- src/server/game/Entities/Unit/StatSystem.cpp | 8 +-- src/server/game/Globals/ObjectMgr.cpp | 4 +- src/server/game/Globals/ObjectMgr.h | 16 +++++ src/server/game/Guilds/GuildFinderMgr.cpp | 5 +- src/server/game/Handlers/CharacterHandler.cpp | 22 +++--- src/server/scripts/Commands/cs_learn.cpp | 2 +- src/server/scripts/Commands/cs_reset.cpp | 2 +- 12 files changed, 118 insertions(+), 81 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 8b4274022c2..73c067ddf99 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -44,13 +44,13 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 team): _flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels - if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel + if (ch->Flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel _flags |= CHANNEL_FLAG_TRADE; - if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels + if (ch->Flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels _flags |= CHANNEL_FLAG_CITY; - if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel + if (ch->Flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel _flags |= CHANNEL_FLAG_LFG; else // for all other channels _flags |= CHANNEL_FLAG_NOT_LFG; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index af24e182869..653b94ffa2f 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -914,13 +914,13 @@ AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_ char const* GetRaceName(uint8 race, uint8 /*locale*/) { ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race); - return raceEntry ? raceEntry->name : NULL; + return raceEntry ? raceEntry->Name_lang : NULL; } char const* GetClassName(uint8 class_, uint8 /*locale*/) { ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_); - return classEntry ? classEntry->name : NULL; + return classEntry ? classEntry->Name_lang : NULL; } uint32 GetAreaFlagByMapId(uint32 mapid) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 18096038b79..a099680b692 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -699,53 +699,73 @@ struct CharTitlesEntry struct ChatChannelsEntry { - uint32 ChannelID; // 0 - uint32 flags; // 1 - //uint32 // 2 m_factionGroup - char* pattern; // 3 m_name_lang - //char* name; // 4 m_shortcut_lang + uint32 ID; // 0 + uint32 Flags; // 1 + //uint32 FactionGroup // 2 + char* Name_lang; // 3 + //char* Shortcut_lang; // 4 }; struct ChrClassesEntry { - uint32 ClassID; // 0 - uint32 powerType; // 1 m_DisplayPower - // 2 m_petNameToken - char* name; // 3 m_name_lang - //char* nameFemale; // 4 m_name_female_lang - //char* nameNeutralGender; // 5 m_name_male_lang - //char* capitalizedName // 6, m_filename - uint32 spellfamily; // 7 m_spellClassSet - //uint32 flags2; // 8 m_flags (0x08 HasRelicSlot) - uint32 CinematicSequence; // 9 m_cinematicSequenceID - uint32 expansion; // 10 m_required_expansion - uint32 APPerStrenth; // 11 Attack Power bonus per point of strength - uint32 APPerAgility; // 12 Attack Power bonus per point of agility - uint32 RAPPerAgility; // 13 Ranged Attack Power bonus per point of agility + uint32 ID; // 0 + uint32 PowerType; // 1 + //char* PetNameToken // 2 + char* Name_lang; // 3 + //char* NameFemale_lang; // 4 + //char* NameMale_lang; // 5 + //char* Filename; // 6 + uint32 SpellClassSet; // 7 + //uint32 Flags; // 8 + uint32 CinematicSequenceID; // 9 + uint32 AttackPowerPerStrength; // 10 Attack Power bonus per point of strength + uint32 AttackPowerPerAgility; // 11 Attack Power bonus per point of agility + uint32 RangedAttackPowerPerAgility; // 12 Ranged Attack Power bonus per point of agility + //uint32 DefaultSpec; // 13 + //uint32 CreateScreenFileDataID; // 14 + //uint32 SelectScreenFileDataID; // 15 + //uint32 LowResScreenFileDataID; // 16 + //uint32 IconFileDataID; // 17 + //uint32 Unk1; // 18 }; struct ChrRacesEntry { - uint32 RaceID; // 0 + uint32 ID; // 0 uint32 Flags; // 1 - uint32 FactionID; // 2 facton template id - // 3 unused - uint32 model_m; // 4 - uint32 model_f; // 5 - // 6 unused - uint32 TeamID; // 7 (7-Alliance 1-Horde) - // 8-11 unused - uint32 CinematicSequence; // 12 id from CinematicSequences.dbc - //uint32 unk_322; // 13 m_alliance (0 alliance, 1 horde, 2 not available?) - char* name; // 14 m_name_lang used for DBC language detection/selection - //char* nameFemale; // 15 m_name_female_lang - //char* nameNeutralGender; // 16 m_name_male_lang - // 17-18 m_facialHairCustomization[2] - // 19 m_hairCustomization - uint32 expansion; // 20 m_required_expansion - //uint32 // 21 (23 for worgens) - //uint32 // 22 4.0.0 - //uint32 // 23 4.0.0 + uint32 FactionID; // 2 faction template id + //uint32 ExplorationSoundID; // 3 + uint32 MaleDisplayID; // 4 + uint32 FemaleDisplayID; // 5 + //char* ClientPrefix; // 6 + //uint32 BaseLanguage; // 7 + //uint32 CreatureType; // 8 + //uint32 ResSicknessSpellID; // 9 + //uint32 SplashSoundID; // 10 + //char* ClientFileString; // 11 + uint32 CinematicSequenceID; // 12 + uint32 TeamID; // 13 m_alliance (0 alliance, 1 horde, 2 neutral) + char* Name_lang; // 14 + //char* NameFemale_lang; // 15 + //char* NameMale_lang; // 16 + //char* FacialHairCustomization[2]; // 17-18 + //char* HairCustomization; // 19 + //uint32 RaceRelated; // 20 + //uint32 UnalteredVisualRaceID; // 21 + //uint32 UAMaleCreatureSoundDataID; // 22 + //uint32 UAFemaleCreatureSoundDataID; // 23 + //uint32 CharComponentTextureLayoutID; // 24 + //uint32 DefaultClassID; // 25 + //uint32 CreateScreenFileDataID; // 26 + //uint32 SelectScreenFileDataID; // 27 + //float MaleCustomizeOffset[3]; // 28-30 + //float FemaleCustomizeOffset[3]; // 31-33 + //uint32 NeutralRaceID; // 34 + //uint32 LowResScreenFileDataID; // 35 + //uint32 HighResMaleDisplayID; // 36 + //uint32 HighResFemaleDisplayID; // 37 + //uint32 CharComponentTexLayoutHiResID; // 38 + //uint32 Unk; // 39 }; struct ChrPowerTypesEntry @@ -1535,7 +1555,7 @@ struct MapEntry bool IsContinent() const { - return ID == 0 || ID == 1 || ID == 530 || ID == 571 || ID == 1116; + return ID == 0 || ID == 1 || ID == 530 || ID == 571 || ID == 870 || ID == 1116; } bool IsDynamicDifficultyMap() const { return (Flags & MAP_FLAG_DYNAMIC_DIFFICULTY) != 0; } diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 92de682017c..0f12fd0f220 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -38,8 +38,8 @@ char const BattlemasterListEntryfmt[] = "niiiiiiiiiiiiiiiiixsiiiixxxxxxx"; char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxii"; char const CharTitlesEntryfmt[] = "nxssix"; char const ChatChannelsEntryfmt[] = "nixsx"; -char const ChrClassesEntryfmt[] = "nixsxxxixiiiii"; -char const ChrRacesEntryfmt[] = "niixiixixxxxixsxxxxxixxx"; +char const ChrClassesEntryfmt[] = "nixsxxxixiiiixxxxx"; +char const ChrRacesEntryfmt[] = "niixiixxxxxxiisxxxxxxxxxxxxxxxxxxxxxxxxx"; char const ChrClassesXPowerTypesfmt[] = "nii"; char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxx"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 985d03bd539..1d322cf61eb 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -965,7 +965,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac SetMap(sMapMgr->CreateMap(info->mapId, this)); - uint8 powertype = cEntry->powerType; + uint8 powertype = cEntry->PowerType; SetObjectScale(1.0f); @@ -5329,13 +5329,13 @@ void Player::RepopAtGraveyard() bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone) { - if (channel->flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->flags & AREA_FLAG_ARENA_INSTANCE) + if (channel->Flags & CHANNEL_DBC_FLAG_ZONE_DEP && zone->flags & AREA_FLAG_ARENA_INSTANCE) return false; - if ((channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL))) + if ((channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY) && (!(zone->flags & AREA_FLAG_SLAVE_CAPITAL))) return false; - if ((channel->flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId()) + if ((channel->Flags & CHANNEL_DBC_FLAG_GUILD_REQ) && GetGuildId()) return false; return true; @@ -5400,22 +5400,22 @@ void Player::UpdateLocalChannels(uint32 newZone) if (CanJoinConstantChannelInZone(channel, current_zone)) { - if (!(channel->flags & CHANNEL_DBC_FLAG_GLOBAL)) + if (!(channel->Flags & CHANNEL_DBC_FLAG_GLOBAL)) { - if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel) + if (channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel) continue; // Already on the channel, as city channel names are not changing char new_channel_name_buf[100]; char const* currentNameExt; - if (channel->flags & CHANNEL_DBC_FLAG_CITY_ONLY) + if (channel->Flags & CHANNEL_DBC_FLAG_CITY_ONLY) currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY); else currentNameExt = current_zone_name.c_str(); - snprintf(new_channel_name_buf, 100, channel->pattern, currentNameExt); + snprintf(new_channel_name_buf, 100, channel->Name_lang, currentNameExt); - joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ChannelID); + joinChannel = cMgr->GetJoinChannel(new_channel_name_buf, channel->ID); if (usedChannel) { if (joinChannel != usedChannel) @@ -5428,7 +5428,7 @@ void Player::UpdateLocalChannels(uint32 newZone) } } else - joinChannel = cMgr->GetJoinChannel(channel->pattern, channel->ChannelID); + joinChannel = cMgr->GetJoinChannel(channel->Name_lang, channel->ID); } else removeChannel = usedChannel; @@ -6617,8 +6617,8 @@ uint32 Player::TeamForRace(uint8 race) { switch (rEntry->TeamID) { + case 0: return ALLIANCE; case 1: return HORDE; - case 7: return ALLIANCE; } TC_LOG_ERROR("entities.player", "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID); } @@ -21612,8 +21612,8 @@ void Player::InitDataForForm(bool reapplyMods) default: // 0, for example { ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass()); - if (cEntry && cEntry->powerType < MAX_POWERS && uint32(getPowerType()) != cEntry->powerType) - setPowerType(Powers(cEntry->powerType)); + if (cEntry && cEntry->PowerType < MAX_POWERS && uint32(getPowerType()) != cEntry->PowerType) + setPowerType(Powers(cEntry->PowerType)); break; } } @@ -23378,7 +23378,7 @@ void Player::ResetSpells(bool myClassOnly) ChrClassesEntry const* clsEntry = sChrClassesStore.LookupEntry(getClass()); if (!clsEntry) return; - family = clsEntry->spellfamily; + family = clsEntry->SpellClassSet; for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) { diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 541a7c711ec..729cd4f1a41 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -318,17 +318,17 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) if (ranged) { index = UNIT_FIELD_RANGED_ATTACK_POWER; - val2 = (level + std::max(GetStat(STAT_AGILITY) - 10.0f, 0.0f)) * entry->RAPPerAgility; + val2 = (level + std::max(GetStat(STAT_AGILITY) - 10.0f, 0.0f)) * entry->RangedAttackPowerPerAgility; } else { - float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->APPerStrenth, 0.0f); - float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerAgility, 0.0f); + float strengthValue = std::max((GetStat(STAT_STRENGTH) - 10.0f) * entry->AttackPowerPerStrength, 0.0f); + float agilityValue = std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->AttackPowerPerAgility, 0.0f); SpellShapeshiftFormEntry const* form = sSpellShapeshiftFormStore.LookupEntry(GetShapeshiftForm()); // Directly taken from client, SHAPESHIFT_FLAG_AP_FROM_STRENGTH ? if (form && form->flags1 & 0x20) - agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->APPerStrenth, 0.0f); + agilityValue += std::max((GetStat(STAT_AGILITY) - 10.0f) * entry->AttackPowerPerStrength, 0.0f); val2 = strengthValue + agilityValue; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 8ec41b82d7f..c46131270b4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3188,8 +3188,8 @@ void ObjectMgr::LoadPlayerInfo() info->positionY = positionY; info->positionZ = positionZ; info->orientation = orientation; - info->displayId_m = rEntry->model_m; - info->displayId_f = rEntry->model_f; + info->displayId_m = rEntry->MaleDisplayID; + info->displayId_f = rEntry->FemaleDisplayID; _playerInfo[current_race][current_class] = info; ++count; diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 045e8705f19..b56500a1a10 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -1353,8 +1353,24 @@ class ObjectMgr void LoadRealmNames(); std::string GetRealmName(uint32 realm) const; + ExpansionRequirementContainer const& GetRaceExpansionRequirements() const { return _raceExpansionRequirementStore; } + uint8 const GetRaceExpansionRequirement(uint8 race) + { + auto itr = _raceExpansionRequirementStore.find(race); + if (itr != _raceExpansionRequirementStore.end()) + return itr->second; + return EXPANSION_CLASSIC; + } + ExpansionRequirementContainer const& GetClassExpansionRequirements() const { return _classExpansionRequirementStore; } + uint8 const GetClassExpansionRequirement(uint8 race) + { + auto itr = _classExpansionRequirementStore.find(race); + if (itr != _classExpansionRequirementStore.end()) + return itr->second; + return EXPANSION_CLASSIC; + } private: // first free id for selected id type diff --git a/src/server/game/Guilds/GuildFinderMgr.cpp b/src/server/game/Guilds/GuildFinderMgr.cpp index 81a16a5d2f1..67a00d3dff8 100644 --- a/src/server/game/Guilds/GuildFinderMgr.cpp +++ b/src/server/game/Guilds/GuildFinderMgr.cpp @@ -62,10 +62,9 @@ void GuildFinderMgr::LoadGuildSettings() bool listed = (fields[5].GetUInt8() != 0); std::string comment = fields[6].GetString(); - TeamId guildTeam = TEAM_ALLIANCE; + TeamId guildTeam = TEAM_NEUTRAL; if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(fields[7].GetUInt8())) - if (raceEntry->TeamID == 1) - guildTeam = TEAM_HORDE; + guildTeam = (TeamId)raceEntry->TeamID; LFGuildSettings settings(listed, guildTeam, guildId, classRoles, availability, interests, level, comment); _guildSettings[guildId] = settings; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index afbc283676d..d868cd1bd13 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -356,17 +356,19 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CharacterCrea } // prevent character creating Expansion race without Expansion account - if (raceEntry->expansion > Expansion()) + uint8 raceExpansionRequirement = sObjectMgr->GetRaceExpansionRequirement(charCreate.CreateInfo->Race); + if (raceExpansionRequirement > Expansion()) { - TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, charCreate.CreateInfo->Race); + TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceExpansionRequirement, charCreate.CreateInfo->Race); SendCharCreate(CHAR_CREATE_EXPANSION); return; } // prevent character creating Expansion class without Expansion account - if (classEntry->expansion > Expansion()) + uint8 classExpansionRequirement = sObjectMgr->GetClassExpansionRequirement(charCreate.CreateInfo->Class); + if (classExpansionRequirement > Expansion()) { - TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, charCreate.CreateInfo->Class); + TC_LOG_ERROR("network", "Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classExpansionRequirement, charCreate.CreateInfo->Class); SendCharCreate(CHAR_CREATE_EXPANSION_CLASS); return; } @@ -940,10 +942,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) if (ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(pCurrChar->getClass())) { - if (cEntry->CinematicSequence) - pCurrChar->SendCinematicStart(cEntry->CinematicSequence); + if (cEntry->CinematicSequenceID) + pCurrChar->SendCinematicStart(cEntry->CinematicSequenceID); else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace())) - pCurrChar->SendCinematicStart(rEntry->CinematicSequence); + pCurrChar->SendCinematicStart(rEntry->CinematicSequenceID); // send new char string if not empty if (!sWorld->GetNewCharString().empty()) @@ -2241,10 +2243,10 @@ void WorldSession::HandleOpeningCinematic(WorldPacket& /*recvData*/) if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass())) { - if (classEntry->CinematicSequence) - _player->SendCinematicStart(classEntry->CinematicSequence); + if (classEntry->CinematicSequenceID) + _player->SendCinematicStart(classEntry->CinematicSequenceID); else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace())) - _player->SendCinematicStart(raceEntry->CinematicSequence); + _player->SendCinematicStart(raceEntry->CinematicSequenceID); } } diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 60523428e6f..886e866d66a 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -152,7 +152,7 @@ public: ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->getClass()); if (!classEntry) return true; - uint32 family = classEntry->spellfamily; + uint32 family = classEntry->SpellClassSet; for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i) { diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index 46fe0c64330..9d2621c0010 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -93,7 +93,7 @@ public: return false; } - uint8 powerType = classEntry->powerType; + uint8 powerType = classEntry->PowerType; // reset m_form if no aura if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) -- cgit v1.2.3 From 4fc832c09903cb9e6d46c1101590585b41e6ff2f Mon Sep 17 00:00:00 2001 From: Intel Date: Sat, 8 Nov 2014 16:55:02 +0200 Subject: Core/DataStores: Updated CreatureFamily.dbc, CreatureModelData.dbc, CreatureSpellData.dbc, CreatureType.dbc, CurrencyTypes.dbc, DestructibleModelData.dbc structs --- src/server/game/DataStores/DBCStores.cpp | 4 +- src/server/game/DataStores/DBCStructure.h | 164 ++++++++++++--------- src/server/game/DataStores/DBCfmt.h | 8 +- src/server/game/Entities/GameObject/GameObject.cpp | 12 +- src/server/game/Entities/Pet/Pet.cpp | 22 +-- src/server/game/Entities/Player/Player.cpp | 16 +- src/server/game/Spells/SpellMgr.cpp | 10 +- src/server/scripts/Commands/cs_learn.cpp | 4 +- 8 files changed, 132 insertions(+), 108 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index a636c28b4ee..c1eb056ec98 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -596,7 +596,7 @@ void LoadDBCStores(const std::string& dataPath) if (!cFamily) continue; - if (skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1]) + if (skillLine->skillId != cFamily->SkillLine[0] && skillLine->skillId != cFamily->SkillLine[1]) continue; if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) @@ -854,7 +854,7 @@ char const* GetPetName(uint32 petfamily, uint32 /*dbclang*/) CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(petfamily); if (!pet_family) return NULL; - return pet_family->Name ? pet_family->Name : NULL; + return pet_family->Name_lang ? pet_family->Name_lang : NULL; } TalentSpellPos const* GetTalentSpellPos(uint32 spellId) diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 6e3b468d917..f00cbc55d3a 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -822,55 +822,67 @@ struct CreatureDisplayInfoExtraEntry struct CreatureFamilyEntry { - uint32 ID; // 0 m_ID - float minScale; // 1 m_minScale - uint32 minScaleLevel; // 2 m_minScaleLevel - float maxScale; // 3 m_maxScale - uint32 maxScaleLevel; // 4 m_maxScaleLevel - uint32 skillLine[2]; // 5-6 m_skillLine - uint32 petFoodMask; // 7 m_petFoodMask - int32 petTalentType; // 8 m_petTalentType - // 9 m_categoryEnumID - char* Name; // 10 m_name_lang - // 11 m_iconFile + uint32 ID; // 0 + float MinScale; // 1 + uint32 MinScaleLevel; // 2 + float MaxScale; // 3 + uint32 MaxScaleLevel; // 4 + uint32 SkillLine[2]; // 5-6 + uint32 PetFoodMask; // 7 + uint32 PetTalentType; // 8 + //uint32 CategoryEnumID; // 9 + char* Name_lang; // 10 + //char* IconFile; // 11 }; struct CreatureModelDataEntry { - uint32 Id; - uint32 Flags; - //char* ModelPath - //uint32 Unk1; - //float Scale; // Used in calculation of unit collision data - //int32 Unk2 - //int32 Unk3 - //uint32 Unk4 - //uint32 Unk5 - //float Unk6 - //uint32 Unk7 - //float Unk8 - //uint32 Unk9 - //uint32 Unk10 - //float CollisionWidth; - float CollisionHeight; - float MountHeight; // Used in calculation of unit collision data when mounted - //float Unks[11] + uint32 ID; // 0 + uint32 Flags; // 1 + //uint32 FileDataID; // 2 + //uint32 SizeClass; // 3 + //float ModelScale; // 4 + //uint32 BloodID; // 5 + //uint32 FootprintTextureID; // 6 + //float FootprintTextureLength; // 7 + //float FootprintTextureWidth; // 8 + //float FootprintParticleScale; // 9 + //uint32 FoleyMaterialID; // 10 + //uint32 FootstepShakeSize; // 11 + //uint32 DeathThudShakeSize; // 12 + //uint32 SoundID; // 13 + //float CollisionWidth; // 14 + float CollisionHeight; // 15 + float MountHeight; // 16 + //float GeoBoxMin[3]; // 17-19 + //float GeoBoxMax[3]; // 20-22 + //float WorldEffectScale; // 23 + //float AttachedEffectScale; // 24 + //float MissileCollisionRadius; // 25 + //float MissileCollisionPush; // 26 + //float MissileCollisionRaise; // 27 + //float OverrideLootEffectScale; // 28 + //float OverrideNameScale; // 29 + //float OverrideSelectionRadius; // 30 + //float TamedPetBaseScale; // 31 + //uint32 CreatureGeosetDataID; // 32 + //float HoverHeight; // 33 }; #define MAX_CREATURE_SPELL_DATA_SLOT 4 struct CreatureSpellDataEntry { - uint32 ID; // 0 m_ID - uint32 spellId[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 m_spells[4] - //uint32 availability[MAX_CREATURE_SPELL_DATA_SLOT]; // 4-7 m_availability[4] + uint32 ID; // 0 + uint32 Spells[MAX_CREATURE_SPELL_DATA_SLOT]; // 1-4 + //uint32 Availability[MAX_CREATURE_SPELL_DATA_SLOT]; // 4-7 }; struct CreatureTypeEntry { - uint32 ID; // 0 m_ID - //char* Name; // 1 m_name_lang - //uint32 no_expirience; // 2 m_flags no exp? critters, non-combat pets, gas cloud. + uint32 ID; // 0 + //char* Name_lang; // 1 + //uint32 Flags; // 2 no exp? critters, non-combat pets, gas cloud. }; /* not used @@ -885,45 +897,57 @@ struct CurrencyCategoryEntry struct CurrencyTypesEntry { - uint32 ID; // 0 not used - uint32 Category; // 1 may be category - //char* name; // 2 - //char* iconName; // 3 - //uint32 unk4; // 4 all 0 - uint32 HasSubstitution; // 5 archaeology-related (?) - uint32 SubstitutionId; // 6 - uint32 TotalCap; // 7 - uint32 WeekCap; // 8 - uint32 Flags; // 9 - //char* description; // 10 + uint32 ID; // 0 + uint32 CategoryID; // 1 + //char* Name_lang; // 2 + //char* InventoryIcon[2]; // 3-4 + //uint32 SpellWeight; // 5 archaeology-related (?) + //uint32 SpellCategory; // 6 + uint32 MaxQty; // 7 + uint32 MaxEarnablePerWeek; // 8 + uint32 Flags; // 9 + //uint32 Quality; // 10 + //char* Description_lang; // 11 }; struct DestructibleModelDataEntry { - uint32 Id; - uint32 DamagedDisplayId; - //uint32 DamagedUnk1; - //uint32 DamagedUnk2; - //uint32 DamagedUnk3; - uint32 DestroyedDisplayId; - //uint32 DestroyedUnk1; - //uint32 DestroyedUnk2; - //uint32 DestroyedUnk3; - //uint32 DestroyedUnk4; - uint32 RebuildingDisplayId; - //uint32 RebuildingUnk1; - //uint32 RebuildingUnk2; - //uint32 RebuildingUnk3; - //uint32 RebuildingUnk4; - uint32 SmokeDisplayId; - //uint32 SmokeUnk1; - //uint32 SmokeUnk2; - //uint32 SmokeUnk3; - //uint32 SmokeUnk4; - //uint32 UnkDisplayid; - //uint32 Unk6; - //uint32 Unk7; - //uint32 Unk8; + uint32 ID; // 0 + struct + { + uint32 DisplayID; // 1 + //uint32 ImpactEffectDoodadSet; // 2 + //uint32 AmbientDoodadSet; // 3 + //uint32 NameSet; // 4 + } StateDamaged; + struct + { + uint32 DisplayID; // 5 + //uint32 DestructionDoodadSet; // 6 + //uint32 ImpactEffectDoodadSet; // 7 + //uint32 AmbientDoodadSet; // 8 + //uint32 NameSet; // 9 + } StateDestroyed; + struct + { + uint32 DisplayID; // 10 + //uint32 DestructionDoodadSet; // 11 + //uint32 ImpactEffectDoodadSet; // 12 + //uint32 AmbientDoodadSet; // 13 + //uint32 NameSet; // 14 + } StateRebuilding; + struct + { + //uint32 DisplayID; // 15 + //uint32 InitDoodadSet; // 16 + //uint32 AmbientDoodadSet; // 17 + //uint32 NameSet; // 18 + } StateSmoke; + //uint32 EjectDirection; // 19 + //uint32 RepairGroundFx; // 20 + //uint32 DoNotHighlight; // 21 + //uint32 HealEffect; // 22 + //uint32 HealEffectSpeed; // 23 }; struct DungeonEncounterEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 70ef56e8401..c6c6f9667f3 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -44,12 +44,12 @@ char const ChrClassesXPowerTypesfmt[] = "nii"; char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxxxxxx"; char const CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxx"; -char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxffxxxxxxxxxxxxxxx"; -char const CreatureFamilyfmt[] = "nfifiiiiixsx"; +char const CreatureFamilyfmt[] = "nfifiiiiixix"; +char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx"; char const CreatureSpellDatafmt[] = "niiiixxxx"; char const CreatureTypefmt[] = "nxx"; -char const CurrencyTypesfmt[] = "nixxxiiiiix"; -char const DestructibleModelDatafmt[] = "ixxixxxixxxixxxixxxxxxxx"; +char const CurrencyTypesfmt[] = "nixxxxxixixx"; +char const DestructibleModelDatafmt[] = "nixxxixxxxixxxxxxxxxxxxx"; char const DungeonEncounterfmt[] = "niixisxx"; char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; char const DurabilityQualityfmt[] = "nf"; diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 716ee946778..c010e3f1506 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -2017,8 +2017,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* uint32 modelId = m_goInfo->displayId; if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec)) - if (modelData->DamagedDisplayId) - modelId = modelData->DamagedDisplayId; + if (modelData->StateDamaged.DisplayID) + modelId = modelData->StateDamaged.DisplayID; SetDisplayId(modelId); if (setHealth) @@ -2045,8 +2045,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* uint32 modelId = m_goInfo->displayId; if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec)) - if (modelData->DestroyedDisplayId) - modelId = modelData->DestroyedDisplayId; + if (modelData->StateDestroyed.DisplayID) + modelId = modelData->StateDestroyed.DisplayID; SetDisplayId(modelId); if (setHealth) @@ -2064,8 +2064,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* uint32 modelId = m_goInfo->displayId; if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec)) - if (modelData->RebuildingDisplayId) - modelId = modelData->RebuildingDisplayId; + if (modelData->StateRebuilding.DisplayID) + modelId = modelData->StateRebuilding.DisplayID; SetDisplayId(modelId); // restores to full health diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index e9799a3c648..9d8d0d1f6e9 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -747,7 +747,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) SetDisplayId(creature->GetDisplayId()); if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) - SetName(cFamily->Name); + SetName(cFamily->Name_lang); else SetName(creature->GetNameForLocaleIdx(sObjectMgr->GetDBCLocaleIndex())); @@ -760,7 +760,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner) return false; if (CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family)) - SetName(cFamily->Name); + SetName(cFamily->Name_lang); Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation()); @@ -834,15 +834,15 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) //scale CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family); - if (cFamily && cFamily->minScale > 0.0f && petType == HUNTER_PET) + if (cFamily && cFamily->MinScale > 0.0f && petType == HUNTER_PET) { float scale; - if (getLevel() >= cFamily->maxScaleLevel) - scale = cFamily->maxScale; - else if (getLevel() <= cFamily->minScaleLevel) - scale = cFamily->minScale; + if (getLevel() >= cFamily->MaxScaleLevel) + scale = cFamily->MaxScale; + else if (getLevel() <= cFamily->MinScaleLevel) + scale = cFamily->MinScale; else - scale = cFamily->minScale + float(getLevel() - cFamily->minScaleLevel) / cFamily->maxScaleLevel * (cFamily->maxScale - cFamily->minScale); + scale = cFamily->MinScale + float(getLevel() - cFamily->MinScaleLevel) / cFamily->MaxScaleLevel * (cFamily->MaxScale - cFamily->MinScale); SetObjectScale(scale); } @@ -1045,7 +1045,7 @@ bool Pet::HaveInDiet(ItemTemplate const* item) const if (!cFamily) return false; - uint32 diet = cFamily->petFoodMask; + uint32 diet = cFamily->PetFoodMask; uint32 FoodMask = 1 << (item->FoodType-1); return (diet & FoodMask) != 0; } @@ -1633,7 +1633,7 @@ bool Pet::resetTalents() return false; // Check pet talent type CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family); - if (!pet_family || pet_family->petTalentType < 0) + if (!pet_family || pet_family->PetTalentType < 0) return false; uint8 level = getLevel(); @@ -1658,7 +1658,7 @@ bool Pet::resetTalents() continue; // unlearn only talents for pets family talent type - if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)) + if (!((1 << pet_family->PetTalentType) & talentTabInfo->petTalentMask)) continue; for (uint8 j = 0; j < MAX_TALENT_RANK; ++j) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d97bc4da22d..f3d91be14cb 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7114,7 +7114,7 @@ void Player::SendCurrencies() const CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(itr->first); // not send init meta currencies. - if (!entry || entry->Category == CURRENCY_CATEGORY_META_CONQUEST) + if (!entry || entry->CategoryID == CURRENCY_CATEGORY_META_CONQUEST) continue; uint32 precision = (entry->Flags & CURRENCY_FLAG_HIGH_PRECISION) ? CURRENCY_PRECISION : 1; @@ -7263,7 +7263,7 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo if (count > 0) UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CURRENCY, id, count); - if (currency->Category == CURRENCY_CATEGORY_META_CONQUEST) + if (currency->CategoryID == CURRENCY_CATEGORY_META_CONQUEST) { // count was changed to week limit, now we can modify original points. ModifyCurrency(CURRENCY_TYPE_CONQUEST_POINTS, count, printLog); @@ -7349,12 +7349,12 @@ uint32 Player::GetCurrencyWeekCap(CurrencyTypesEntry const* currency) const return Trinity::Currency::BgConquestRatingCalculator(GetRBGPersonalRating()) * CURRENCY_PRECISION; } - return currency->WeekCap; + return currency->MaxEarnablePerWeek; } uint32 Player::GetCurrencyTotalCap(CurrencyTypesEntry const* currency) const { - uint32 cap = currency->TotalCap; + uint32 cap = currency->MaxQty; switch (currency->ID) { @@ -25814,11 +25814,11 @@ void Player::LearnPetTalent(ObjectGuid petGuid, uint32 talentId, uint32 talentRa if (!pet_family) return; - if (pet_family->petTalentType < 0) // not hunter pet + if (pet_family->PetTalentType < 0) // not hunter pet return; // prevent learn talent for different family (cheating) - if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)) + if (!((1 << pet_family->PetTalentType) & talentTabInfo->petTalentMask)) return; // find current max talent rank (0~5) @@ -26076,7 +26076,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) return; CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family); - if (!pet_family || pet_family->petTalentType < 0) + if (!pet_family || pet_family->PetTalentType < 0) return; for (uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId) @@ -26085,7 +26085,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket* data) if (!talentTabInfo) continue; - if (!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask)) + if (!((1 << pet_family->PetTalentType) & talentTabInfo->petTalentMask)) continue; for (uint32 talentId = 0; talentId < sTalentStore.GetNumRows(); ++talentId) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 46fac6340a8..7aebc202d81 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2432,7 +2432,7 @@ void SpellMgr::LoadPetLevelupSpellMap() for (uint8 j = 0; j < 2; ++j) { - if (!creatureFamily->skillLine[j]) + if (!creatureFamily->SkillLine[j]) continue; for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k) @@ -2441,11 +2441,11 @@ void SpellMgr::LoadPetLevelupSpellMap() if (!skillLine) continue; - //if (skillLine->skillId != creatureFamily->skillLine[0] && - // (!creatureFamily->skillLine[1] || skillLine->skillId != creatureFamily->skillLine[1])) + //if (skillLine->skillId != creatureFamily->SkillLine[0] && + // (!creatureFamily->SkillLine[1] || skillLine->skillId != creatureFamily->SkillLine[1])) // continue; - if (skillLine->skillId != creatureFamily->skillLine[j]) + if (skillLine->skillId != creatureFamily->SkillLine[j]) continue; if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) @@ -2543,7 +2543,7 @@ void SpellMgr::LoadPetDefaultSpells() int32 petSpellsId = -int32(itr->second.PetSpellDataId); PetDefaultSpellsEntry petDefSpells; for (uint8 j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j) - petDefSpells.spellid[j] = spellDataEntry->spellId[j]; + petDefSpells.spellid[j] = spellDataEntry->Spells[j]; if (LoadPetDefaultSpells_helper(&itr->second, petDefSpells)) { diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 886e866d66a..bed6715fec1 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -266,7 +266,7 @@ public: return false; } - if (petFamily->petTalentType < 0) // not hunter pet + if (petFamily->PetTalentType < 0) // not hunter pet { handler->SendSysMessage(LANG_WRONG_PET_TYPE); handler->SetSentErrorMessage(true); @@ -284,7 +284,7 @@ public: continue; // prevent learn talent for different family (cheating) - if (((1 << petFamily->petTalentType) & talentTabInfo->petTalentMask) == 0) + if (((1 << petFamily->PetTalentType) & talentTabInfo->petTalentMask) == 0) continue; // search highest talent rank -- cgit v1.2.3 From 4e684f74a8cc7007fbfa5fa06ec822c1b07e2109 Mon Sep 17 00:00:00 2001 From: Intel Date: Sat, 8 Nov 2014 19:26:20 +0200 Subject: Core/DataStores: Updated DungeonEncounter.dbc, DurabilityCosts.dbc, DurabilityQuality.dbc, EmotesEntry.dbc, EmotesText.dbc, Faction.dbc, FactionTemplate.dbc structs --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 8 +- src/server/game/Combat/HostileRefManager.cpp | 2 +- src/server/game/DataStores/DBCStores.cpp | 4 +- src/server/game/DataStores/DBCStructure.h | 121 ++++++++++++----------- src/server/game/DataStores/DBCfmt.h | 8 +- src/server/game/Entities/Creature/Creature.cpp | 2 +- src/server/game/Entities/Item/ItemPrototype.h | 10 -- src/server/game/Entities/Player/Player.cpp | 19 ++-- src/server/game/Entities/Unit/Unit.cpp | 28 +++--- src/server/game/Globals/ObjectMgr.cpp | 32 +++--- src/server/game/Handlers/ChatHandler.cpp | 2 +- src/server/game/Instances/InstanceScript.cpp | 4 +- src/server/game/Reputation/ReputationMgr.cpp | 60 +++++------ src/server/game/Reputation/ReputationMgr.h | 4 +- src/server/scripts/Commands/cs_character.cpp | 2 +- src/server/scripts/Commands/cs_lookup.cpp | 2 +- src/server/scripts/Commands/cs_modify.cpp | 6 +- src/server/scripts/World/go_scripts.cpp | 2 +- 18 files changed, 158 insertions(+), 158 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 7f67926bef4..e853ce1671f 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -54,9 +54,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId) FactionTemplateEntry const* uEntry = sFactionTemplateStore.LookupEntry(factionTemplateId); if (!uEntry) return &mNeutralAuctions; - else if (uEntry->ourMask & FACTION_MASK_ALLIANCE) + else if (uEntry->Mask & FACTION_MASK_ALLIANCE) return &mAllianceAuctions; - else if (uEntry->ourMask & FACTION_MASK_HORDE) + else if (uEntry->Mask & FACTION_MASK_HORDE) return &mHordeAuctions; else return &mNeutralAuctions; @@ -413,9 +413,9 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(factionTemplateId); if (!u_entry) houseid = 7; // goblin auction house - else if (u_entry->ourMask & FACTION_MASK_ALLIANCE) + else if (u_entry->Mask & FACTION_MASK_ALLIANCE) houseid = 1; // human auction house - else if (u_entry->ourMask & FACTION_MASK_HORDE) + else if (u_entry->Mask & FACTION_MASK_HORDE) houseid = 6; // orc auction house else houseid = 7; // goblin auction house diff --git a/src/server/game/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp index e359727ecb7..738982d035c 100644 --- a/src/server/game/Combat/HostileRefManager.cpp +++ b/src/server/game/Combat/HostileRefManager.cpp @@ -133,7 +133,7 @@ void HostileRefManager::deleteReferencesForFaction(uint32 faction) while (ref) { HostileReference* nextRef = ref->next(); - if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->faction == faction) + if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->Faction == faction) { ref->removeReference(); delete ref; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index c1eb056ec98..cfe595b3140 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -398,9 +398,9 @@ void LoadDBCStores(const std::string& dataPath) for (uint32 i=0; iteam) + if (faction && faction->ParentFactionID) { - SimpleFactionsList &flist = sFactionTeamMap[faction->team]; + SimpleFactionsList &flist = sFactionTeamMap[faction->ParentFactionID]; flist.push_back(i); } } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index f00cbc55d3a..beadfad83a9 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -938,7 +938,7 @@ struct DestructibleModelDataEntry } StateRebuilding; struct { - //uint32 DisplayID; // 15 + uint32 DisplayID; // 15 //uint32 InitDoodadSet; // 16 //uint32 AmbientDoodadSet; // 17 //uint32 NameSet; // 18 @@ -952,67 +952,72 @@ struct DestructibleModelDataEntry struct DungeonEncounterEntry { - uint32 id; // 0 unique id - uint32 mapId; // 1 map id - int32 difficulty; // 2 instance mode - //uint32 unk0; // 3 - uint32 encounterIndex; // 4 encounter index for creating completed mask - char* encounterName; // 5 encounter name - //uint32 nameFlags; // 21 - //uint32 unk1; // 22 + uint32 ID; // 0 + uint32 MapID; // 1 + uint32 DifficultyID; // 2 + uint32 OrderIndex; // 3 + //uint32 Bit; // 4 + char* Name_lang; // 5 + //uint32 CreatureDisplayID; // 6 + //uint32 Flags; // 7 }; struct DurabilityCostsEntry { - uint32 Itemlvl; // 0 - uint32 multiplier[29]; // 1-29 + uint32 ID; // 0 + uint32 WeaponSubClassCost[21]; // 1-22 + uint32 ArmorSubClassCost[8]; // 23-30 }; struct DurabilityQualityEntry { - uint32 Id; // 0 - float quality_mod; // 1 + uint32 ID; // 0 + float QualityMod; // 1 }; struct EmotesEntry { - uint32 Id; // 0 - //char* Name; // 1, internal name - //uint32 AnimationId; // 2, ref to animationData - uint32 Flags; // 3, bitmask, may be unit_flags - uint32 EmoteType; // 4, Can be 0, 1 or 2 (determine how emote are shown) - uint32 UnitStandState; // 5, uncomfirmed, may be enum UnitStandStateType - //uint32 SoundId; // 6, ref to soundEntries - //uint32 unk7 // 7 + uint32 ID; // 0 + //char* EmoteSlashCommand; // 1 + //uint32 AnimID; // 2 ref to animationData + uint32 EmoteFlags; // 3 bitmask, may be unit_flags + uint32 EmoteSpecProc; // 4 Can be 0, 1 or 2 (determine how emote are shown) + uint32 EmoteSpecProcParam; // 5 uncomfirmed, may be enum UnitStandStateType + //uint32 EmoteSoundID; // 6 ref to soundEntries + //uint32 SpellVisualKitID // 7 }; struct EmotesTextEntry { - uint32 Id; - uint32 textid; + uint32 ID; // 0 + //char* Name_lang; // 1 + uint32 EmoteID; // 2 + //uint32 EmoteText[16]; // 3-18 }; struct FactionEntry { - uint32 ID; // 0 m_ID - int32 reputationListID; // 1 m_reputationIndex - uint32 BaseRepRaceMask[4]; // 2-5 m_reputationRaceMask - uint32 BaseRepClassMask[4]; // 6-9 m_reputationClassMask - int32 BaseRepValue[4]; // 10-13 m_reputationBase - uint32 ReputationFlags[4]; // 14-17 m_reputationFlags - uint32 team; // 18 m_parentFactionID - float spilloverRateIn; // 19 Faction gains incoming rep * spilloverRateIn - float spilloverRateOut; // 20 Faction outputs rep * spilloverRateOut as spillover reputation - uint32 spilloverMaxRankIn; // 21 The highest rank the faction will profit from incoming spillover - //uint32 spilloverRank_unk; // 22 It does not seem to be the max standing at which a faction outputs spillover ...so no idea - char* name; // 23 m_name_lang - //char* description; // 24 m_description_lang - uint32 GroupExpansion; // 25 m_factionGroupExpansion + uint32 ID; // 0 + int32 ReputationIndex; // 1 + uint32 ReputationRaceMask[4]; // 2-5 + uint32 ReputationClassMask[4]; // 6-9 + int32 ReputationBase[4]; // 10-13 + uint32 ReputationFlags[4]; // 14-17 + uint32 ParentFactionID; // 18 + float ParentFactionModIn; // 19 Faction gains incoming rep * ParentFactionModIn + float ParentFactionModOut; // 20 Faction outputs rep * ParentFactionModOut as spillover reputation + uint32 ParentFactionCapIn; // 21 The highest rank the faction will profit from incoming spillover + //uint32 ParentFactionCapOut; // 22 + char* Name_lang; // 23 + //char* Description_lang; // 24 + uint32 Expansion; // 25 + //uint32 Flags; // 26 + //uint32 FriendshipRepID; // 27 // helpers bool CanHaveReputation() const { - return reputationListID >= 0; + return ReputationIndex >= 0; } }; @@ -1020,14 +1025,14 @@ struct FactionEntry struct FactionTemplateEntry { - uint32 ID; // 0 m_ID - uint32 faction; // 1 m_faction - uint32 factionFlags; // 2 m_flags - uint32 ourMask; // 3 m_factionGroup - uint32 friendlyMask; // 4 m_friendGroup - uint32 hostileMask; // 5 m_enemyGroup - uint32 enemyFaction[MAX_FACTION_RELATIONS]; // 6 m_enemies[MAX_FACTION_RELATIONS] - uint32 friendFaction[MAX_FACTION_RELATIONS]; // 10 m_friend[MAX_FACTION_RELATIONS] + uint32 ID; // 0 + uint32 Faction; // 1 + uint32 Flags; // 2 + uint32 Mask; // 3 m_factionGroup + uint32 FriendMask; // 4 m_friendGroup + uint32 EnemyMask; // 5 m_enemyGroup + uint32 Enemies[MAX_FACTION_RELATIONS]; // 6 + uint32 Friends[MAX_FACTION_RELATIONS]; // 10 //------------------------------------------------------- end structure // helpers @@ -1035,41 +1040,41 @@ struct FactionTemplateEntry { if (ID == entry.ID) return true; - if (entry.faction) + if (entry.Faction) { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] == entry.faction) + if (Enemies[i] == entry.Faction) return false; for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (friendFaction[i] == entry.faction) + if (Friends[i] == entry.Faction) return true; } - return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask); + return (FriendMask & entry.Mask) || (Mask & entry.FriendMask); } bool IsHostileTo(FactionTemplateEntry const& entry) const { if (ID == entry.ID) return false; - if (entry.faction) + if (entry.Faction) { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] == entry.faction) + if (Enemies[i] == entry.Faction) return true; for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (friendFaction[i] == entry.faction) + if (Friends[i] == entry.Faction) return false; } - return (hostileMask & entry.ourMask) != 0; + return (EnemyMask & entry.Mask) != 0; } - bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; } + bool IsHostileToPlayers() const { return (EnemyMask & FACTION_MASK_PLAYER) !=0; } bool IsNeutralToAll() const { for (int i = 0; i < MAX_FACTION_RELATIONS; ++i) - if (enemyFaction[i] != 0) + if (Enemies[i] != 0) return false; - return hostileMask == 0 && friendlyMask == 0; + return EnemyMask == 0 && FriendMask == 0; } - bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } + bool IsContestedGuardFaction() const { return (Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } }; struct GameObjectDisplayInfoEntry diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index c6c6f9667f3..725e0f51b42 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -44,13 +44,13 @@ char const ChrClassesXPowerTypesfmt[] = "nii"; char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxxxxxx"; char const CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxx"; -char const CreatureFamilyfmt[] = "nfifiiiiixix"; +char const CreatureFamilyfmt[] = "nfifiiiiixsx"; char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx"; char const CreatureSpellDatafmt[] = "niiiixxxx"; char const CreatureTypefmt[] = "nxx"; -char const CurrencyTypesfmt[] = "nixxxxxixixx"; -char const DestructibleModelDatafmt[] = "nixxxixxxxixxxxxxxxxxxxx"; -char const DungeonEncounterfmt[] = "niixisxx"; +char const CurrencyTypesfmt[] = "nixxxxxiiixx"; +char const DestructibleModelDatafmt[] = "nixxxixxxxixxxxixxxxxxxx"; +char const DungeonEncounterfmt[] = "niiixsxx"; char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii"; char const DurabilityQualityfmt[] = "nf"; char const EmotesEntryfmt[] = "nxxiiixx"; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 3a27207b833..7fb3822c888 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -409,7 +409,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/) // checked and error show at loading templates if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction)) { - if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP) + if (factionTemplate->Flags & FACTION_TEMPLATE_FLAG_PVP) SetPvP(true); else SetPvP(false); diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index d8e999bbc86..32781f68e34 100644 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -573,16 +573,6 @@ const uint32 MaxItemSubclassValues[MAX_ITEM_CLASS] = MAX_ITEM_SUBCLASS_GLYPH }; -inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemSubClass) -{ - switch (ItemClass) - { - case ITEM_CLASS_WEAPON: return ItemSubClass; - case ITEM_CLASS_ARMOR: return ItemSubClass + 21; - } - return 0; -} - // GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack(1) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f3d91be14cb..3dec68360da 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2638,9 +2638,9 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask) // not unfriendly if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction())) - if (factionTemplate->faction) - if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) - if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) + if (factionTemplate->Faction) + if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->Faction)) + if (faction->ReputationIndex >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) return NULL; // not too far @@ -5234,8 +5234,13 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g return TotalCost; } - uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class, ditemProto->SubClass)]; - uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->quality_mod)); + uint32 dmultiplier = 0; + if (ditemProto->Class == ITEM_CLASS_WEAPON) + dmultiplier = dcost->WeaponSubClassCost[ditemProto->SubClass]; + else if (ditemProto->Class == ITEM_CLASS_ARMOR) + dmultiplier = dcost->ArmorSubClassCost[ditemProto->SubClass]; + + uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->QualityMod)); costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST)); @@ -23870,10 +23875,10 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const float Player::GetReputationPriceDiscount(Creature const* creature) const { FactionTemplateEntry const* vendor_faction = creature->GetFactionTemplateEntry(); - if (!vendor_faction || !vendor_faction->faction) + if (!vendor_faction || !vendor_faction->Faction) return 1.0f; - ReputationRank rank = GetReputationRank(vendor_faction->faction); + ReputationRank rank = GetReputationRank(vendor_faction->Faction); if (rank <= REP_NEUTRAL) return 1.0f; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6013e02c11a..786595c5077 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7323,12 +7323,12 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const return *repRank; if (!selfPlayerOwner->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION)) { - if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->faction)) + if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->Faction)) { if (targetFactionEntry->CanHaveReputation()) { // check contested flags - if (targetFactionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD + if (targetFactionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD && selfPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) return REP_HOSTILE; @@ -7360,14 +7360,14 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem if (Player const* targetPlayerOwner = target->GetAffectingPlayer()) { // check contested flags - if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD + if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD && targetPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) return REP_HOSTILE; if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry)) return *repRank; if (!target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION)) { - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction)) { if (factionEntry->CanHaveReputation()) { @@ -7388,7 +7388,7 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem return REP_FRIENDLY; if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry)) return REP_FRIENDLY; - if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT) + if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT) return REP_HOSTILE; // neutral by default return REP_NEUTRAL; @@ -7407,11 +7407,11 @@ bool Unit::IsFriendlyTo(Unit const* unit) const bool Unit::IsHostileToPlayers() const { FactionTemplateEntry const* my_faction = GetFactionTemplateEntry(); - if (!my_faction || !my_faction->faction) + if (!my_faction || !my_faction->Faction) return false; - FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction); - if (raw_faction && raw_faction->reputationListID >= 0) + FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction); + if (raw_faction && raw_faction->ReputationIndex >= 0) return false; return my_faction->IsHostileToPlayers(); @@ -7420,11 +7420,11 @@ bool Unit::IsHostileToPlayers() const bool Unit::IsNeutralToAll() const { FactionTemplateEntry const* my_faction = GetFactionTemplateEntry(); - if (!my_faction || !my_faction->faction) + if (!my_faction || !my_faction->Faction) return true; - FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction); - if (raw_faction && raw_faction->reputationListID >= 0) + FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction); + if (raw_faction && raw_faction->ReputationIndex >= 0) return false; return my_faction->IsNeutralToAll(); @@ -10322,7 +10322,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry()) { if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate))) - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->Faction)) if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry)) if (!(repState->Flags & FACTION_FLAG_AT_WAR)) return false; @@ -16037,7 +16037,7 @@ void Unit::StopAttackFaction(uint32 faction_id) { if (Unit* victim = GetVictim()) { - if (victim->GetFactionTemplateEntry()->faction == faction_id) + if (victim->GetFactionTemplateEntry()->Faction == faction_id) { AttackStop(); if (IsNonMeleeSpellCast(false)) @@ -16052,7 +16052,7 @@ void Unit::StopAttackFaction(uint32 faction_id) AttackerSet const& attackers = getAttackers(); for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();) { - if ((*itr)->GetFactionTemplateEntry()->faction == faction_id) + if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id) { (*itr)->AttackStop(); itr = attackers.begin(); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 07d134be0fa..91f9a686eb4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5303,7 +5303,7 @@ void ObjectMgr::LoadInstanceEncounters() if (lastEncounterDungeon && !sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon)) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName, lastEncounterDungeon); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->Name_lang, lastEncounterDungeon); continue; } @@ -5312,7 +5312,7 @@ void ObjectMgr::LoadInstanceEncounters() { if (itr != dungeonLastBosses.end()) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName, itr->second->id, itr->second->encounterName); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->Name_lang, itr->second->ID, itr->second->Name_lang); continue; } @@ -5326,7 +5326,7 @@ void ObjectMgr::LoadInstanceEncounters() CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry); if (!creatureInfo) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name_lang); continue; } const_cast(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS; @@ -5335,29 +5335,29 @@ void ObjectMgr::LoadInstanceEncounters() case ENCOUNTER_CREDIT_CAST_SPELL: if (!sSpellMgr->GetSpellInfo(creditEntry)) { - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name_lang); continue; } break; default: - TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName); + TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->Name_lang); continue; } - if (dungeonEncounter->difficulty == -1) + if (dungeonEncounter->DifficultyID == -1) { for (uint32 i = 0; i < MAX_DIFFICULTY; ++i) { - if (GetMapDifficultyData(dungeonEncounter->mapId, Difficulty(i))) + if (GetMapDifficultyData(dungeonEncounter->MapID, Difficulty(i))) { - DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, i)]; + DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, i)]; encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon)); } } } else { - DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, dungeonEncounter->difficulty)]; + DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, dungeonEncounter->DifficultyID)]; encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon)); } @@ -7079,7 +7079,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() continue; } - if (factionEntry->team == 0) + if (factionEntry->ParentFactionID == 0) { TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId); continue; @@ -7097,7 +7097,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate() continue; } - if (factionSpillover->reputationListID < 0) + if (factionSpillover->ReputationIndex < 0) { TC_LOG_ERROR("sql.sql", "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId); continue; @@ -7853,11 +7853,11 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac for (int i = 0; i < 4; i++) { - if ((!factionEntry->BaseRepClassMask[i] || - factionEntry->BaseRepClassMask[i] & classMask) && - (!factionEntry->BaseRepRaceMask[i] || - factionEntry->BaseRepRaceMask[i] & raceMask)) - return factionEntry->BaseRepValue[i]; + if ((!factionEntry->ReputationClassMask[i] || + factionEntry->ReputationClassMask[i] & classMask) && + (!factionEntry->ReputationRaceMask[i] || + factionEntry->ReputationRaceMask[i] & raceMask)) + return factionEntry->ReputationBase[i]; } return 0; diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2798a81a7c5..a2fc248bb61 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -741,7 +741,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData) if (!em) return; - uint32 emote_anim = em->textid; + uint32 emote_anim = em->EmoteID; switch (emote_anim) { diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index bb02b114e48..a8255d62777 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -600,11 +600,11 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi DungeonEncounter const* encounter = *itr; if (encounter->creditType == type && encounter->creditEntry == creditEntry) { - completedEncounters |= 1 << encounter->dbcEntry->encounterIndex; + completedEncounters |= 1 << encounter->dbcEntry->OrderIndex; if (encounter->lastEncounterDungeon) { dungeonId = encounter->lastEncounterDungeon; - TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->encounterName, dungeonId); + TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->Name_lang, dungeonId); break; } } diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index b2b029e1df2..d5ca307344d 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -86,13 +86,13 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const uint32 classMask = _player->getClassMask(); for (int i=0; i < 4; i++) { - if ((factionEntry->BaseRepRaceMask[i] & raceMask || - (factionEntry->BaseRepRaceMask[i] == 0 && - factionEntry->BaseRepClassMask[i] != 0)) && - (factionEntry->BaseRepClassMask[i] & classMask || - factionEntry->BaseRepClassMask[i] == 0)) + if ((factionEntry->ReputationRaceMask[i] & raceMask || + (factionEntry->ReputationRaceMask[i] == 0 && + factionEntry->ReputationClassMask[i] != 0)) && + (factionEntry->ReputationClassMask[i] & classMask || + factionEntry->ReputationClassMask[i] == 0)) - return factionEntry->BaseRepValue[i]; + return factionEntry->ReputationBase[i]; } // in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i] == 0 @@ -140,11 +140,11 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con uint32 classMask = _player->getClassMask(); for (int i=0; i < 4; i++) { - if ((factionEntry->BaseRepRaceMask[i] & raceMask || - (factionEntry->BaseRepRaceMask[i] == 0 && - factionEntry->BaseRepClassMask[i] != 0)) && - (factionEntry->BaseRepClassMask[i] & classMask || - factionEntry->BaseRepClassMask[i] == 0)) + if ((factionEntry->ReputationRaceMask[i] & raceMask || + (factionEntry->ReputationRaceMask[i] == 0 && + factionEntry->ReputationClassMask[i] != 0)) && + (factionEntry->ReputationClassMask[i] & classMask || + factionEntry->ReputationClassMask[i] == 0)) return factionEntry->ReputationFlags[i]; } @@ -263,11 +263,11 @@ void ReputationMgr::Initialize() { FactionEntry const* factionEntry = sFactionStore.LookupEntry(i); - if (factionEntry && (factionEntry->reputationListID >= 0)) + if (factionEntry && (factionEntry->ReputationIndex >= 0)) { FactionState newFaction; newFaction.ID = factionEntry->ID; - newFaction.ReputationListID = factionEntry->reputationListID; + newFaction.ReputationListID = factionEntry->ReputationIndex; newFaction.Standing = 0; newFaction.Flags = GetDefaultStateFlags(factionEntry); newFaction.needSend = true; @@ -309,12 +309,12 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi // check for sub-factions that receive spillover SimpleFactionsList const* flist = GetFactionTeamList(factionEntry->ID); // if has no sub-factions, check for factions with same parent - if (!flist && factionEntry->team && factionEntry->spilloverRateOut != 0.0f) + if (!flist && factionEntry->ParentFactionID && factionEntry->ParentFactionModOut != 0.0f) { - spillOverRepOut *= factionEntry->spilloverRateOut; - if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->team)) + spillOverRepOut *= factionEntry->ParentFactionModOut; + if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->ParentFactionID)) { - FactionStateList::iterator parentState = _factions.find(parent->reputationListID); + FactionStateList::iterator parentState = _factions.find(parent->ReputationIndex); // some team factions have own reputation standing, in this case do not spill to other sub-factions if (parentState != _factions.end() && (parentState->second.Flags & FACTION_FLAG_SPECIAL)) { @@ -322,7 +322,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi } else // spill to "sister" factions { - flist = GetFactionTeamList(factionEntry->team); + flist = GetFactionTeamList(factionEntry->ParentFactionID); } } } @@ -333,9 +333,9 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi { if (FactionEntry const* factionEntryCalc = sFactionStore.LookupEntry(*itr)) { - if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->spilloverMaxRankIn)) + if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->ParentFactionCapOut)) continue; - int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn); + int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->ParentFactionModIn); if (spilloverRep != 0 || !incremental) res = SetOneFactionReputation(factionEntryCalc, spilloverRep, incremental); } @@ -344,7 +344,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi } // spillover done, update faction itself - FactionStateList::iterator faction = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator faction = _factions.find(factionEntry->ReputationIndex); if (faction != _factions.end()) { res = SetOneFactionReputation(factionEntry, standing, incremental); @@ -356,7 +356,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental) { - FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex); if (itr != _factions.end()) { int32 BaseRep = GetBaseReputation(factionEntry); @@ -402,23 +402,23 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in return false; } -void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry) +void ReputationMgr::SetVisible(FactionTemplateEntry const* factionTemplateEntry) { - if (!factionTemplateEntry->faction) + if (!factionTemplateEntry->Faction) return; - if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction)) + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction)) // Never show factions of the opposing team - if (!(factionEntry->BaseRepRaceMask[1] & _player->getRaceMask() && factionEntry->BaseRepValue[1] == Reputation_Bottom)) + if (!(factionEntry->ReputationRaceMask[1] & _player->getRaceMask() && factionEntry->ReputationBase[1] == Reputation_Bottom)) SetVisible(factionEntry); } void ReputationMgr::SetVisible(FactionEntry const* factionEntry) { - if (factionEntry->reputationListID < 0) + if (factionEntry->ReputationIndex < 0) return; - FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID); + FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex); if (itr == _factions.end()) return; @@ -519,9 +519,9 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result) Field* fields = result->Fetch(); FactionEntry const* factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt16()); - if (factionEntry && (factionEntry->reputationListID >= 0)) + if (factionEntry && (factionEntry->ReputationIndex >= 0)) { - FactionState* faction = &_factions[factionEntry->reputationListID]; + FactionState* faction = &_factions[factionEntry->ReputationIndex]; // update standing to current faction->Standing = fields[1].GetInt32(); diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index b624bc95011..68f6ae6ca0b 100644 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -86,7 +86,7 @@ class ReputationMgr FactionState const* GetState(FactionEntry const* factionEntry) const { - return factionEntry->CanHaveReputation() ? GetState(factionEntry->reputationListID) : NULL; + return factionEntry->CanHaveReputation() ? GetState(factionEntry->ReputationIndex) : NULL; } FactionState const* GetState(RepListID id) const @@ -111,7 +111,7 @@ class ReputationMgr ReputationRank const* GetForcedRankIfAny(FactionTemplateEntry const* factionTemplateEntry) const { - ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->faction); + ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->Faction); return forceItr != _forcedReactions.end() ? &forceItr->second : NULL; } diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 058f7435713..ec435e0bb2f 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -566,7 +566,7 @@ public: { FactionState const& faction = itr->second; FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID); - char const* factionName = factionEntry ? factionEntry->name : "#Not found#"; + char const* factionName = factionEntry ? factionEntry->Name_lang : "#Not found#"; ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry); std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]); std::ostringstream ss; diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 1833761ea17..96806bc3d70 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -299,7 +299,7 @@ public: { FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL; - std::string name = factionEntry->name; + std::string name = factionEntry->Name_lang; if (name.empty()) continue; diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 0075891ba5f..24283dca7ac 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -1233,16 +1233,16 @@ public: return false; } - if (factionEntry->reputationListID < 0) + if (factionEntry->ReputationIndex < 0) { - handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name, factionId); + handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name_lang, factionId); handler->SetSentErrorMessage(true); return false; } target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false); target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry)); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId, + handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name_lang, factionId, handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); return true; } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 752ea2feb1c..800b533d216 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -236,7 +236,7 @@ public: { uint32 Spell = 0; - switch (pFaction->faction) + switch (pFaction->Faction) { case 1011: Spell = SPELL_REP_LC; break; case 935: Spell = SPELL_REP_SHAT; break; -- cgit v1.2.3 From b0f898ea8e7a659e9f1288a47a484f371476fc57 Mon Sep 17 00:00:00 2001 From: Intel Date: Sat, 8 Nov 2014 21:58:26 +0200 Subject: Core/DataStores: Updated item dbcs --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 4 +- src/server/game/Chat/ChatLink.cpp | 2 +- src/server/game/DataStores/DBCStores.cpp | 16 ++- src/server/game/DataStores/DBCStores.h | 2 + src/server/game/DataStores/DBCStructure.h | 126 +++++++++++----------- src/server/game/DataStores/DBCfmt.h | 7 +- src/server/game/Entities/Item/Item.cpp | 41 ++++--- src/server/game/Entities/Player/Player.cpp | 26 ++--- src/server/game/Globals/ObjectMgr.cpp | 10 +- src/server/game/Handlers/ItemHandler.cpp | 2 +- src/server/game/Loot/LootMgr.cpp | 2 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 +- src/server/scripts/Commands/cs_lookup.cpp | 2 +- 13 files changed, 129 insertions(+), 115 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index e853ce1671f..e5b9079f019 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -599,13 +599,13 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player { const ItemRandomSuffixEntry* itemRandSuffix = sItemRandomSuffixStore.LookupEntry(-propRefID); if (itemRandSuffix) - suffix = itemRandSuffix->nameSuffix; + suffix = itemRandSuffix->Name_lang; } else { const ItemRandomPropertiesEntry* itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID); if (itemRandProp) - suffix = itemRandProp->nameSuffix; + suffix = itemRandProp->Name_lang; } // dbc local name diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index 4077c875511..ea6df4c984c 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -183,7 +183,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context) { ChatLink::ValidateName(buffer, context); - char* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL); + char* suffixStrings = _suffix ? _suffix->Name_lang : (_property ? _property->Name_lang : NULL); bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer); if (!res) diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 1ce2252e310..1baa3441226 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -140,11 +140,13 @@ DBCStorage sItemDamageTwoHandStore(ItemDamagefmt) DBCStorage sItemDamageTwoHandCasterStore(ItemDamagefmt); DBCStorage sItemDamageWandStore(ItemDamagefmt); DBCStorage sItemDisenchantLootStore(ItemDisenchantLootfmt); -//DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently -DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); -DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); -DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); -DBCStorage sItemSetStore(ItemSetEntryfmt); +//DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently +DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); +DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); +DBCStorage sItemRandomSuffixStore(ItemRandomSuffixfmt); +DBCStorage sItemSetStore(ItemSetEntryfmt); +DBCStorage sItemSetSpellStore(ItemSetSpellEntryfmt); +ItemSetSpellsStore sItemSetSpellsStore; DBCStorage sLFGDungeonStore(LFGDungeonEntryfmt); DBCStorage sLightStore(LightEntryfmt); @@ -454,6 +456,10 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemRandomSuffixStore, dbcPath, "ItemRandomSuffix.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetStore, dbcPath, "ItemSet.dbc");//15595 + LoadDBC(availableDbcLocales, bad_dbc_files, sItemSetSpellStore, dbcPath, "ItemSetSpell.dbc");//15595 + for (uint32 i = 0; i < sItemSetSpellStore.GetNumRows(); ++i) + if (ItemSetSpellEntry const* entry = sItemSetSpellStore.LookupEntry(i)) + sItemSetSpellsStore[entry->ItemSetID].push_back(entry); LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorQualityStore, dbcPath, "ItemArmorQuality.dbc");//15595 LoadDBC(availableDbcLocales, bad_dbc_files, sItemArmorShieldStore, dbcPath, "ItemArmorShield.dbc");//15595 diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 3fc688d23ff..bc514374157 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -170,6 +170,8 @@ extern DBCStorage sItemLimitCategoryStore; extern DBCStorage sItemRandomPropertiesStore; extern DBCStorage sItemRandomSuffixStore; extern DBCStorage sItemSetStore; +extern DBCStorage sItemSetSpellStore; +extern ItemSetSpellsStore sItemSetSpellsStore; extern DBCStorage sLFGDungeonStore; extern DBCStorage sLiquidTypeStore; extern DBCStorage sLockStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index cd462e5f5ee..125a74b3190 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1306,117 +1306,123 @@ struct ItemReforgeEntry // ItemDamageWand.dbc struct ItemDamageEntry { - uint32 Id; // 0 item level - float DPS[7]; // 1-7 multiplier for item quality - uint32 Id2; // 8 item level + uint32 ID; // 0 item level + float DPS[7]; // 1-7 multiplier for item quality + uint32 ItemLevel; // 8 item level }; struct ItemArmorQualityEntry { - uint32 Id; // 0 item level - float Value[7]; // 1-7 multiplier for item quality - uint32 Id2; // 8 item level + uint32 ID; // 0 item level + float QualityMod[7]; // 1-7 multiplier for item quality + uint32 ItemLevel; // 8 item level }; struct ItemArmorShieldEntry { - uint32 Id; // 0 item level - uint32 Id2; // 1 item level - float Value[7]; // 2-8 multiplier for item quality + uint32 ID; // 0 item level + uint32 ItemLevel; // 1 item level + float Quality[7]; // 2-8 quality }; struct ItemArmorTotalEntry { - uint32 Id; // 0 item level - uint32 Id2; // 1 item level - float Value[4]; // 2-5 multiplier for armor types (cloth...plate) + uint32 ID; // 0 item level + uint32 ItemLevel; // 1 item level + float Value[4]; // 2-5 multiplier for armor types (cloth...plate) }; // ItemClass.dbc struct ItemClassEntry { - uint32 Class; // 1 item class id - //uint32 Unk; // 2 unk - //uint32 IsWeapon; // 3 1 for weapon, 0 for everything else - float PriceFactor; // 4 used to calculate certain prices - //char* Name; // class name + uint32 ID; // 0 item class id + //uint32 Flags; // 1 Weapon - 1, others - 0 + float PriceMod; // 2 used to calculate certain prices + //char* Name_lang; // 3 class name }; struct ItemBagFamilyEntry { - uint32 ID; // 0 - //char* name; // 1 m_name_lang + uint32 ID; // 0 + //char* Name_lang; // 1 m_name_lang }; struct ItemDisplayInfoEntry { - uint32 ID; // 0 m_ID - // 1 m_modelName[2] - // 2 m_modelTexture[2] - // 3 m_inventoryIcon - // 4 m_geosetGroup[3] - // 5 m_flags - // 6 m_spellVisualID - // 7 m_groupSoundIndex - // 8 m_helmetGeosetVis[2] - // 9 m_texture[2] - // 10 m_itemVisual[8] - // 11 m_particleColorID + uint32 ID; // 0 + //char* ModelName[2]; // 1-2 + //char* ModelTexture[2]; // 3-4 + //uint32 GeoSetGroup[3]; // 5-7 + //uint32 Flags; // 8 + //uint32 SpellVisualID; // 9 + //uint32 HelmetGeosetVis[2]; // 10-11 + //char* Texture[9]; // 12-20 + //uint32 ItemVisual; // 21 + //uint32 ParticleColorID; // 22 }; struct ItemDisenchantLootEntry { - uint32 Id; - uint32 ItemClass; - int32 ItemSubClass; - uint32 ItemQuality; - uint32 MinItemLevel; - uint32 MaxItemLevel; - uint32 RequiredDisenchantSkill; + uint32 ID; // 0 + uint32 ItemClass; // 1 + int32 ItemSubClass; // 2 + uint32 ItemQuality; // 3 + uint32 MinItemLevel; // 4 + uint32 MaxItemLevel; // 5 + uint32 RequiredDisenchantSkill; // 6 }; struct ItemLimitCategoryEntry { uint32 ID; // 0 Id - //char* name; // 1 m_name_lang - uint32 maxCount; // 2, m_quantity max allowed equipped as item or in gem slot - uint32 mode; // 3, m_flags 0 = have, 1 = equip (enum ItemLimitCategoryMode) + //char* Name_lang; // 1 m_name_lang + uint32 Quantity; // 2, m_quantity max allowed equipped as item or in gem slot + uint32 Flags; // 3, m_flags 0 = have, 1 = equip (enum ItemLimitCategoryMode) }; -#define MAX_ITEM_ENCHANTMENT_EFFECTS 3 +#define MAX_ITEM_ENCHANTMENT_EFFECTS 5 struct ItemRandomPropertiesEntry { - uint32 ID; // 0 m_ID - //char* internalName // 1 m_Name - uint32 enchant_id[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-4 m_Enchantment - // 5-6 unused - char* nameSuffix; // 7 m_name_lang + uint32 ID; // 0 + //char* Name; // 1 + uint32 Enchantment[MAX_ITEM_ENCHANTMENT_EFFECTS]; // 2-6 + char* Name_lang; // 7 }; struct ItemRandomSuffixEntry { - uint32 ID; // 0 m_ID - char* nameSuffix; // 1 m_name_lang - // 2 m_internalName - uint32 enchant_id[5]; // 3-7 m_enchantment - uint32 prefix[5]; // 8-12 m_allocationPct + 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 }; -#define MAX_ITEM_SET_ITEMS 10 +#define MAX_ITEM_SET_ITEMS 17 #define MAX_ITEM_SET_SPELLS 8 struct ItemSetEntry { - //uint32 id // 0 m_ID - char* name; // 1 m_name_lang - uint32 itemId[MAX_ITEM_SET_ITEMS]; // 2-18 m_itemID - uint32 spells[MAX_ITEM_SET_SPELLS]; // 19-26 m_setSpellID - uint32 items_to_triggerspell[MAX_ITEM_SET_SPELLS]; // 27-34 m_setThreshold - uint32 required_skill_id; // 35 m_requiredSkill - uint32 required_skill_value; // 36 m_requiredSkillRank + uint32 ID; // 0 + char* Name_lang; // 1 + uint32 ItemID[MAX_ITEM_SET_ITEMS]; // 2-18 + uint32 RequiredSkill; // 19 + uint32 RequiredSkillRank; // 20 +}; + +struct ItemSetSpellEntry +{ + uint32 ID; // 0 + uint32 ItemSetID; // 1 + uint32 SpellID; // 2 + uint32 Threshold; // 3 + uint32 ChrSpecID; // 4 }; +typedef std::vector ItemSetSpells; +typedef std::unordered_map ItemSetSpellsStore; + struct LFGDungeonEntry { uint32 ID; // 0 diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 327acec4982..75cf0c4b2e5 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -88,14 +88,15 @@ char const ItemBagFamilyfmt[] = "nx"; char const ItemArmorQualityfmt[] = "nfffffffi"; char const ItemArmorShieldfmt[] = "nifffffff"; char const ItemArmorTotalfmt[] = "niffff"; -char const ItemClassfmt[] = "dixxfx"; +char const ItemClassfmt[] = "nxfx"; char const ItemDamagefmt[] = "nfffffffi"; char const ItemDisenchantLootfmt[] = "niiiiii"; //char const ItemDisplayTemplateEntryfmt[] = "nxxxxxxxxxxixxxxxxxxxxx"; char const ItemLimitCategoryEntryfmt[] = "nxii"; -char const ItemRandomPropertiesfmt[] = "nxiiixxs"; +char const ItemRandomPropertiesfmt[] = "nxiiiiis"; char const ItemRandomSuffixfmt[] = "nsxiiiiiiiiii"; -char const ItemSetEntryfmt[] = "dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; +char const ItemSetEntryfmt[] = "nsiiiiiiiiiiiiiiiiiii"; +char const ItemSetSpellEntryfmt[] = "niiii"; char const LFGDungeonEntryfmt[] = "nsiiiiiiiiixxixixixxx"; char const LightEntryfmt[] = "nifffxxxxxxxxxx"; char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 0fd97b41f00..c98ea4b2911 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -43,7 +43,7 @@ void AddItemsSetItem(Player* player, Item* item) return; } - if (set->required_skill_id && player->GetSkillValue(set->required_skill_id) < set->required_skill_value) + if (set->RequiredSkill && player->GetSkillValue(set->RequiredSkill) < set->RequiredSkillRank) return; ItemSetEffect* eff = NULL; @@ -74,18 +74,18 @@ void AddItemsSetItem(Player* player, Item* item) } ++eff->item_count; + + ItemSetSpells& spells = sItemSetSpellsStore[setid]; - for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; ++x) + for (uint32 x = 0; x < spells.size(); ++x) { - if (!set->spells [x]) - continue; //not enough for spell - if (set->items_to_triggerspell[x] > eff->item_count) + if (spells[x]->Threshold > eff->item_count) continue; uint32 z = 0; for (; z < MAX_ITEM_SET_SPELLS; ++z) - if (eff->spells[z] && eff->spells[z]->Id == set->spells[x]) + if (eff->spells[z] && eff->spells[z]->Id == spells[x]->SpellID) break; if (z < MAX_ITEM_SET_SPELLS) @@ -96,10 +96,10 @@ void AddItemsSetItem(Player* player, Item* item) { if (!eff->spells[y]) // free slot { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(set->spells[x]); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spells[x]->SpellID); if (!spellInfo) { - TC_LOG_ERROR("entities.player.items", "WORLD: unknown spell id %u in items set %u effects", set->spells[x], setid); + TC_LOG_ERROR("entities.player.items", "WORLD: unknown spell id %u in items set %u effects", spells[x]->SpellID, setid); break; } @@ -140,19 +140,18 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto) return; --eff->item_count; + + ItemSetSpells& spells = sItemSetSpellsStore[setid]; - for (uint32 x = 0; x < MAX_ITEM_SET_SPELLS; x++) + for (uint32 x = 0; x < spells.size(); x++) { - if (!set->spells[x]) - continue; - // enough for spell - if (set->items_to_triggerspell[x] <= eff->item_count) + if (spells[x]->Threshold <= eff->item_count) continue; for (uint32 z = 0; z < MAX_ITEM_SET_SPELLS; z++) { - if (eff->spells[z] && eff->spells[z]->Id == set->spells[x]) + if (eff->spells[z] && eff->spells[z]->Id == spells[x]->SpellID) { // spell can be not active if not fit form requirement player->ApplyEquipSpell(eff->spells[z], NULL, false); @@ -626,7 +625,7 @@ void Item::SetItemRandomProperties(int32 randomPropId) SetState(ITEM_CHANGED, GetOwner()); } for (uint32 i = PROP_ENCHANTMENT_SLOT_1; i < PROP_ENCHANTMENT_SLOT_1 + 3; ++i) - SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_1], 0, 0); + SetEnchantment(EnchantmentSlot(i), item_rand->Enchantment[i - PROP_ENCHANTMENT_SLOT_1], 0, 0); } } else @@ -643,7 +642,7 @@ void Item::SetItemRandomProperties(int32 randomPropId) } for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i <= PROP_ENCHANTMENT_SLOT_4; ++i) - SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0], 0, 0); + SetEnchantment(EnchantmentSlot(i), item_rand->Enchantment[i - PROP_ENCHANTMENT_SLOT_0], 0, 0); } } } @@ -1459,7 +1458,7 @@ uint32 Item::GetSpecialPrice(ItemTemplate const* proto, uint32 minimumPrice /*= { ItemClassEntry const* classEntry = sItemClassStore.LookupEntry(proto->Class); if (classEntry) - cost *= classEntry->PriceFactor; + cost *= classEntry->PriceMod; else cost = 0; } @@ -1497,9 +1496,9 @@ int32 Item::GetReforgableStat(ItemModType statType) const if (SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(GetEnchantmentId(EnchantmentSlot(e)))) for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f) if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType) - for (int k = 0; k < 5; ++k) - if (randomSuffix->enchant_id[k] == enchant->ID) - return int32((randomSuffix->prefix[k] * GetItemSuffixFactor()) / 10000); + for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) + if (randomSuffix->Enchantment[k] == enchant->ID) + return int32((randomSuffix->AllocationPct[k] * GetItemSuffixFactor()) / 10000); } else { @@ -1512,7 +1511,7 @@ int32 Item::GetReforgableStat(ItemModType statType) const for (uint32 f = 0; f < MAX_ITEM_ENCHANTMENT_EFFECTS; ++f) if (enchant->type[f] == ITEM_ENCHANTMENT_TYPE_STAT && ItemModType(enchant->spellid[f]) == statType) for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) - if (randomProp->enchant_id[k] == enchant->ID) + if (randomProp->Enchantment[k] == enchant->ID) return int32(enchant->amount[k]); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 711b4030465..47f6906ef78 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -10496,13 +10496,13 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item return EQUIP_ERR_NOT_EQUIPPABLE; } - if (limitEntry->mode == ITEM_LIMIT_CATEGORY_MODE_HAVE) + if (limitEntry->Flags == ITEM_LIMIT_CATEGORY_MODE_HAVE) { uint32 curcount = GetItemCountWithLimitCategory(pProto->ItemLimitCategory, pItem); - if (curcount + count > uint32(limitEntry->maxCount)) + if (curcount + count > uint32(limitEntry->Quantity)) { if (no_space_count) - *no_space_count = count + curcount - limitEntry->maxCount; + *no_space_count = count + curcount - limitEntry->Quantity; if (itemLimitCategory) *itemLimitCategory = pProto->ItemLimitCategory; return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS; @@ -13761,11 +13761,11 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool if (item_rand) { // Search enchant_amount - for (int k = 0; k < 5; ++k) + for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) { - if (item_rand->enchant_id[k] == enchant_id) + if (item_rand->Enchantment[k] == enchant_id) { - basepoints = int32((item_rand->prefix[k] * item->GetItemSuffixFactor()) / 10000); + basepoints = int32((item_rand->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000); break; } } @@ -13789,9 +13789,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool { for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) { - if (item_rand->enchant_id[k] == enchant_id) + if (item_rand->Enchantment[k] == enchant_id) { - enchant_amount = uint32((item_rand->prefix[k] * item->GetItemSuffixFactor()) / 10000); + enchant_amount = uint32((item_rand->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000); break; } } @@ -13807,11 +13807,11 @@ 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 < 5; ++k) + for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k) { - if (item_rand_suffix->enchant_id[k] == enchant_id) + if (item_rand_suffix->Enchantment[k] == enchant_id) { - enchant_amount = uint32((item_rand_suffix->prefix[k] * item->GetItemSuffixFactor()) / 10000); + enchant_amount = uint32((item_rand_suffix->AllocationPct[k] * item->GetItemSuffixFactor()) / 10000); break; } } @@ -25521,11 +25521,11 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 // NOTE: limitEntry->mode not checked because if item have have-limit then it applied and to equip case - if (limit_count > limitEntry->maxCount) + if (limit_count > limitEntry->Quantity) return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS; // there is an equip limit on this item - if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot)) + if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->Quantity - limit_count + 1, except_slot)) return EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 91f9a686eb4..0e5c82510b4 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2373,7 +2373,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui if (itemSubclass < ITEM_SUBCLASS_ARMOR_CLOTH || itemSubclass > ITEM_SUBCLASS_ARMOR_PLATE) return 0; - return uint32(armorQuality->Value[quality] * armorTotal->Value[itemSubclass - 1] * location->Modifier[itemSubclass - 1] + 0.5f); + return uint32(armorQuality->QualityMod[quality] * armorTotal->Value[itemSubclass - 1] * location->Modifier[itemSubclass - 1] + 0.5f); } // shields @@ -2381,7 +2381,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui if (!shield) return 0; - return uint32(shield->Value[quality] + 0.5f); + return uint32(shield->Quality[quality] + 0.5f); } uint32 FillMaxDurability(uint32 itemClass, uint32 itemSubClass, uint32 inventoryType, uint32 quality, uint32 itemLevel) @@ -2490,18 +2490,18 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill, disenchant->MinItemLevel <= itemTemplate.ItemLevel && disenchant->MaxItemLevel >= itemTemplate.ItemLevel) { - if (disenchant->Id == 60 || disenchant->Id == 61) // epic item disenchant ilvl range 66-99 (classic) + if (disenchant->ID == 60 || disenchant->ID == 61) // epic item disenchant ilvl range 66-99 (classic) { if (itemTemplate.RequiredLevel > 60 || itemTemplate.RequiredSkillRank > 300) continue; // skip to epic item disenchant ilvl range 90-199 (TBC) } - else if (disenchant->Id == 66 || disenchant->Id == 67) // epic item disenchant ilvl range 90-199 (TBC) + else if (disenchant->ID == 66 || disenchant->ID == 67) // epic item disenchant ilvl range 90-199 (TBC) { if (itemTemplate.RequiredLevel <= 60 || (itemTemplate.RequiredSkill && itemTemplate.RequiredSkillRank <= 300)) continue; } - *disenchantID = disenchant->Id; + *disenchantID = disenchant->ID; *requiredDisenchantSkill = disenchant->RequiredDisenchantSkill; return; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 69c8ffb143c..87d17a8fc7c 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1211,7 +1211,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) } } - if (limit_newcount > 0 && uint32(limit_newcount) > limitEntry->maxCount) + if (limit_newcount > 0 && uint32(limit_newcount) > limitEntry->Quantity) { _player->SendEquipError(EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED, itemTarget, NULL); return; diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 6d41d669dcf..bde2f17b132 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -1568,7 +1568,7 @@ void LoadLootTemplates_Disenchant() if (!disenchant) continue; - uint32 lootid = disenchant->Id; + uint32 lootid = disenchant->ID; if (lootIdSet.find(lootid) == lootIdSet.end()) LootTemplates_Disenchant.ReportNonExistingId(lootid); else diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 64a0c92d107..1142240a3af 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -498,13 +498,13 @@ int32 AuraEffect::CalculateAmount(Unit* caster) { for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; k++) { - SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->enchant_id[k]); + SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k]); if (pEnchant) { for (int t = 0; t < MAX_ITEM_ENCHANTMENT_EFFECTS; t++) if (pEnchant->spellid[t] == m_spellInfo->Id) { - amount = uint32((item_rand_suffix->prefix[k] * castItem->GetItemSuffixFactor()) / 10000); + amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000); break; } } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 96806bc3d70..67505e713de 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -461,7 +461,7 @@ public: ItemSetEntry const* set = sItemSetStore.LookupEntry(id); if (set) { - std::string name = set->name; + std::string name = set->Name_lang; if (name.empty()) continue; -- cgit v1.2.3 From 2a4f56107f6e066211eebfe85ee70a9f5a9735fb Mon Sep 17 00:00:00 2001 From: Intel Date: Sun, 9 Nov 2014 02:51:35 +0200 Subject: Core/DataStores: Even more converted dbcs --- src/server/game/Achievements/AchievementMgr.cpp | 4 +- src/server/game/Battlegrounds/Battleground.cpp | 2 +- .../game/Battlegrounds/BattlegroundQueue.cpp | 4 +- src/server/game/Chat/ChatLink.cpp | 8 +- src/server/game/DataStores/DBCStores.cpp | 37 ++--- src/server/game/DataStores/DBCStructure.h | 179 +++++++++++---------- src/server/game/DataStores/DBCfmt.h | 18 +-- src/server/game/Entities/Player/Player.cpp | 74 ++++----- src/server/game/Globals/ObjectMgr.cpp | 8 +- src/server/game/Groups/Group.cpp | 2 +- src/server/game/Maps/MapInstanced.cpp | 11 +- src/server/game/Skills/SkillDiscovery.cpp | 4 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 +- src/server/game/Spells/SpellEffects.cpp | 4 +- src/server/game/Spells/SpellInfo.cpp | 6 +- src/server/game/Spells/SpellMgr.cpp | 14 +- src/server/scripts/Commands/cs_learn.cpp | 34 ++-- src/server/scripts/Commands/cs_lookup.cpp | 2 +- src/server/scripts/Commands/cs_misc.cpp | 2 +- 19 files changed, 205 insertions(+), 212 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 47424798ec0..fed0a00d0dc 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1342,7 +1342,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) { - if (skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine) + if (skillIter->second->SkillLine == achievementCriteria->learn_skillline_spell.skillLine) spellCount++; } } @@ -1367,7 +1367,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, { SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellIter->first); for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) - if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine) + if (skillIter->second->SkillLine == achievementCriteria->learn_skill_line.skillLine) spellCount++; } SetCriteriaProgress(achievementCriteria, spellCount, referencePlayer); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 396b549c0bc..ee3cb147b9f 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1902,7 +1902,7 @@ void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uin void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry) { m_BracketId = bracketEntry->GetBracketId(); - SetLevelRange(bracketEntry->minLevel, bracketEntry->maxLevel); + SetLevelRange(bracketEntry->MinLevel, bracketEntry->MaxLevel); } void Battleground::RewardXPAtKill(Player* killer, Player* victim) diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 095446bf627..65ae7de2d8c 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -201,8 +201,8 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, Battlegr uint32 MinPlayers = bg->GetMinPlayersPerTeam(); uint32 qHorde = 0; uint32 qAlliance = 0; - uint32 q_min_level = bracketEntry->minLevel; - uint32 q_max_level = bracketEntry->maxLevel; + uint32 q_min_level = bracketEntry->MinLevel; + uint32 q_max_level = bracketEntry->MaxLevel; GroupsQueueType::const_iterator itr; for (itr = m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[bracketId][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr) if (!(*itr)->IsInvitedToBGInstanceGUID) diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index ea6df4c984c..e671713c643 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -299,15 +299,15 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line ability not found for spell %u", context, _spell->Id); return false; } - SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId); + SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->SkillLine); if (!skillLine) { - TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->skillId); + TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->SkillLine); return false; } - uint32 skillLineNameLength = strlen(skillLine->name); - if (skillLineNameLength > 0 && strncmp(skillLine->name, buffer, skillLineNameLength) == 0) + uint32 skillLineNameLength = strlen(skillLine->DisplayName_lang); + if (skillLineNameLength > 0 && strncmp(skillLine->DisplayName_lang, buffer, skillLineNameLength) == 0) { // found the prefix, remove it to perform spellname validation below // -2 = strlen(": ") diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 1acb88b9ae5..18965178656 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -515,7 +515,7 @@ void LoadDBCStores(const std::string& dataPath) for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) - if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS) + if (entry->BracketID > MAX_BATTLEGROUND_BRACKETS) ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data"); LoadDBC(availableDbcLocales, bad_dbc_files, sQuestXPStore, dbcPath, "QuestXP.dbc");//15595 @@ -531,8 +531,8 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sSkillRaceClassInfoStore, dbcPath, "SkillRaceClassInfo.dbc"); for (uint32 i = 0; i < sSkillRaceClassInfoStore.GetNumRows(); ++i) if (SkillRaceClassInfoEntry const* entry = sSkillRaceClassInfoStore.LookupEntry(i)) - if (sSkillLineStore.LookupEntry(entry->SkillId)) - SkillRaceClassInfoBySkill.emplace(entry->SkillId, entry); + if (sSkillLineStore.LookupEntry(entry->SkillID)) + SkillRaceClassInfoBySkill.emplace(entry->SkillID, entry); LoadDBC(availableDbcLocales, bad_dbc_files, sSkillTiersStore, dbcPath, "SkillTiers.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSoundEntriesStore, dbcPath, "SoundEntries.dbc");//15595 @@ -584,7 +584,7 @@ void LoadDBCStores(const std::string& dataPath) if (!skillLine) continue; - SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->spellId); + SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->SpellID); if (!spellInfo) continue; @@ -600,10 +600,10 @@ void LoadDBCStores(const std::string& dataPath) if (!cFamily) continue; - if (skillLine->skillId != cFamily->SkillLine[0] && skillLine->skillId != cFamily->SkillLine[1]) + if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1]) continue; - if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (skillLine->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; sPetFamilySpellsStore[i].insert(spellInfo->Id); @@ -1081,15 +1081,15 @@ PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 lev if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) { // skip unrelated and too-high brackets - if (entry->mapId != mapid || entry->minLevel > level) + if (entry->MapID != mapid || entry->MinLevel > level) continue; // exactly fit - if (entry->maxLevel >= level) + if (entry->MaxLevel >= level) return entry; // remember for possible out-of-range case (search higher from existed) - if (!maxEntry || maxEntry->maxLevel < entry->maxLevel) + if (!maxEntry || maxEntry->MaxLevel < entry->MaxLevel) maxEntry = entry; } } @@ -1101,7 +1101,7 @@ PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundB { for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) - if (entry->mapId == mapid && entry->GetBracketId() == id) + if (entry->MapID == mapid && entry->GetBracketId() == id) return entry; return NULL; @@ -1203,7 +1203,6 @@ uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType) case INVTYPE_FINGER: case INVTYPE_TRINKET: case INVTYPE_WEAPON: - case INVTYPE_SHIELD: case INVTYPE_RANGED: case INVTYPE_2HWEAPON: case INVTYPE_BAG: @@ -1227,7 +1226,9 @@ uint32 ScalingStatValuesEntry::GetArmor(uint32 inventoryType, uint32 armorType) case INVTYPE_WRISTS: return Armor[7][armorType]; case INVTYPE_CLOAK: - return CloakArmor; + return ArmorBack; + case INVTYPE_SHIELD: + return ArmorShield; default: break; } @@ -1247,7 +1248,7 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i case ITEM_SUBCLASS_WEAPON_DAGGER: case ITEM_SUBCLASS_WEAPON_THROWN: *damageMultiplier = 0.3f; - return dpsMod[0]; + return DPSMod[0]; case ITEM_SUBCLASS_WEAPON_AXE2: case ITEM_SUBCLASS_WEAPON_MACE2: case ITEM_SUBCLASS_WEAPON_POLEARM: @@ -1255,12 +1256,12 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i case ITEM_SUBCLASS_WEAPON_STAFF: case ITEM_SUBCLASS_WEAPON_FISHING_POLE: *damageMultiplier = 0.2f; - return dpsMod[1]; + return DPSMod[1]; case ITEM_SUBCLASS_WEAPON_BOW: case ITEM_SUBCLASS_WEAPON_GUN: case ITEM_SUBCLASS_WEAPON_CROSSBOW: *damageMultiplier = 0.3f; - return dpsMod[4]; + return DPSMod[4]; case ITEM_SUBCLASS_WEAPON_Obsolete: case ITEM_SUBCLASS_WEAPON_EXOTIC: case ITEM_SUBCLASS_WEAPON_EXOTIC2: @@ -1280,17 +1281,17 @@ uint32 ScalingStatValuesEntry::GetDPSAndDamageMultiplier(uint32 subClass, bool i if (mask & 0x562) { *damageMultiplier = 0.2f; - return dpsMod[3]; + return DPSMod[3]; } if (mask & (1 << ITEM_SUBCLASS_WEAPON_WAND)) { *damageMultiplier = 0.3f; - return dpsMod[5]; + return DPSMod[5]; } } *damageMultiplier = 0.3f; - return dpsMod[2]; + return DPSMod[2]; } return 0; } diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index b9a891ccec4..22bf5f20317 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -1628,80 +1628,80 @@ struct NameGenEntry struct OverrideSpellDataEntry { - uint32 id; // 0 - uint32 spellId[MAX_OVERRIDE_SPELL]; // 1-10 - //uint32 unk0; // 11 - //char* SpellBarName; // 12 + uint32 ID; // 0 + uint32 SpellID[MAX_OVERRIDE_SPELL]; // 1-10 + //uint32 Flags; // 11 + //char* PlayerActionbarFileDataID; // 12 }; struct PowerDisplayEntry { - uint32 Id; // 0 - uint32 PowerType; // 1 - //char* Name; // 2 - //uint32 R; // 3 - //uint32 G; // 4 - //uint32 B; // 5 + uint32 ID; // 0 + uint32 PowerType; // 1 + //char* GlobalStringBaseTag; // 2 + //uint8 Red; // 3 + //uint8 Green; // 3 + //uint8 Blue; // 3 + //uint8 _padding0; // 3 }; struct PvPDifficultyEntry { - //uint32 id; // 0 m_ID - uint32 mapId; // 1 - uint32 bracketId; // 2 - uint32 minLevel; // 3 - uint32 maxLevel; // 4 - uint32 difficulty; // 5 + //uint32 ID; // 0 + uint32 MapID; // 1 + uint32 BracketID; // 2 m_rangeIndex + uint32 MinLevel; // 3 + uint32 MaxLevel; // 4 // helpers - BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(bracketId); } + BattlegroundBracketId GetBracketId() const { return BattlegroundBracketId(BracketID); } }; struct QuestSortEntry { - uint32 id; // 0 m_ID - //char* name; // 1 m_SortName_lang + uint32 ID; // 0 + //char* SortName_lang; // 1 }; struct QuestXPEntry { - uint32 id; - uint32 Exp[10]; + uint32 ID; // 0 + uint32 Exp[10]; // 1 }; struct QuestFactionRewEntry { - uint32 id; - int32 QuestRewFactionValue[10]; + uint32 ID; // 0 + int32 QuestRewFactionValue[10]; // 1-10 }; struct RandomPropertiesPointsEntry { - //uint32 Id; // 0 hidden key - uint32 itemLevel; // 1 - uint32 EpicPropertiesPoints[5]; // 2-6 - uint32 RarePropertiesPoints[5]; // 7-11 - uint32 UncommonPropertiesPoints[5]; // 12-16 + uint32 ItemLevel; // 0 + uint32 EpicPropertiesPoints[5]; // 1-5 + uint32 RarePropertiesPoints[5]; // 6-10 + uint32 UncommonPropertiesPoints[5]; // 11-15 }; struct ScalingStatDistributionEntry { - uint32 Id; // 0 - int32 StatMod[10]; // 1-10 - uint32 Modifier[10]; // 11-20 - //uint32 unk1; // 21 - uint32 MaxLevel; // 22 m_maxlevel + uint32 ID; // 0 + int32 StatID[10]; // 1-10 + uint32 Modifier[10]; // 11-20 + //uint32 MinLevel; // 21 + uint32 MaxLevel; // 22 m_maxlevel }; struct ScalingStatValuesEntry { - uint32 Id; // 0 - uint32 Level; // 1 - uint32 dpsMod[6]; // 2-7 DPS mod for level - uint32 Spellpower; // 8 spell power for level - uint32 StatMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution - uint32 Armor[8][4]; // 14-46 Armor for level - uint32 CloakArmor; // 47 armor for cloak + uint32 ID; // 0 + uint32 CharLevel; // 1 + uint32 DPSMod[6]; // 2-7 DPS mod for level + uint32 SpellPower; // 8 spell power for level + uint32 StatMultiplier[5]; // 9-13 Multiplier for ScalingStatDistribution + uint32 Armor[8][4]; // 14-46 Armor for level + uint32 ArmorBack; // 47 + uint32 ArmorShield; // 48 uint32 GetStatMultiplier(uint32 inventoryType) const; uint32 GetArmor(uint32 inventoryType, uint32 armorType) const; @@ -1717,73 +1717,74 @@ struct ScalingStatValuesEntry struct SkillLineEntry { - uint32 id; // 0 m_ID - int32 categoryId; // 1 m_categoryID - //uint32 skillCostID; // 2 m_skillCostsID - char* name; // 3 m_displayName_lang - //char* description; // 4 m_description_lang - uint32 spellIcon; // 5 m_spellIconID - //char* alternateVerb; // 6 m_alternateVerb_lang - uint32 canLink; // 7 m_canLink (prof. with recipes) + uint32 ID; // 0 m_ID + int32 CategoryID; // 1 m_categoryID + char* DisplayName_lang; // 2 m_displayName_lang + //char* Description_lang; // 3 m_description_lang + uint32 SpellIconID; // 4 m_spellIconID + //char* AlternateVerb_lang; // 5 m_alternateVerb_lang + uint32 CanLink; // 6 m_canLink (prof. with recipes) + //uint32 ParentSkillLineID; // 7 + //uint32 Flags; // 8 }; struct SkillLineAbilityEntry { - uint32 id; // 0 m_ID - uint32 skillId; // 1 m_skillLine - uint32 spellId; // 2 m_spell - uint32 racemask; // 3 m_raceMask - uint32 classmask; // 4 m_classMask - //uint32 racemaskNot; // 5 m_excludeRace - //uint32 classmaskNot; // 6 m_excludeClass - uint32 req_skill_value; // 7 m_minSkillLineRank - uint32 forward_spellid; // 8 m_supercededBySpell - uint32 AutolearnType; // 9 m_acquireMethod - uint32 max_value; // 10 m_trivialSkillLineRankHigh - uint32 min_value; // 11 m_trivialSkillLineRankLow - uint32 character_points[2]; // 12-13 m_characterPoints + uint32 ID; // 0 + uint32 SkillLine; // 1 + uint32 SpellID; // 2 + uint32 RaceMask; // 3 + uint32 ClassMask; // 4 + uint32 MinSkillLineRank; // 7 + uint32 SupercedesSpell; // 8 + uint32 AquireMethod; // 9 + uint32 TrivialSkillLineRankHigh; // 10 + uint32 TrivialSkillLineRankLow; // 11 + uint32 NumSkillUps; // 12 + uint32 UniqueBit; // 13 + uint32 TradeSkillCategoryID; // 14 }; struct SkillRaceClassInfoEntry { - //uint32 Id; // 0 m_ID - uint32 SkillId; // 1 m_skillID - uint32 RaceMask; // 2 m_raceMask - uint32 ClassMask; // 3 m_classMask - uint32 Flags; // 4 m_flags - //uint32 Unk; // 5 m_unk - //uint32 MinLevel; // 6 m_minLevel - uint32 SkillTier; // 7 m_skillTierID - //uint32 SkillCostType; // 8 m_skillCostIndex + //uint32 ID; // 0 + uint32 SkillID; // 1 + uint32 RaceMask; // 2 + uint32 ClassMask; // 3 + uint32 Flags; // 4 + //uint32 Availability; // 5 + //uint32 MinLevel; // 6 + uint32 SkillTierID; // 7 }; #define MAX_SKILL_STEP 16 struct SkillTiersEntry { - uint32 Id; // 0 m_ID - //uint32 StepCost[MAX_SKILL_STEP]; // 1-16 m_cost - uint32 MaxSkill[MAX_SKILL_STEP]; // 17-32 m_valueMax + uint32 ID; // 0 + uint32 Value[MAX_SKILL_STEP]; // 1-16 }; struct SoundEntriesEntry { - uint32 Id; // 0 m_ID - //uint32 Type; // 1 m_soundType - //char* InternalName; // 2 m_name - //char* FileName[10]; // 3-12 m_File[10] - //uint32 Unk13[10]; // 13-22 m_Freq[10] - //char* Path; // 23 m_DirectoryBase - // 24 m_volumeFloat - // 25 m_flags - // 26 m_minDistance - // 27 m_distanceCutoff - // 28 m_EAXDef - // 29 m_soundEntriesAdvancedID, new in 3.1 - //unk // 30 4.0.0 - //unk // 31 4.0.0 - //unk // 32 4.0.0 - //unk // 33 4.0.0 + uint32 ID; // 0 + //uint32 SoundType; // 1 + //char* Name; // 2 + //uint32 FileDataID[20]; // 3-22 + //uint32 Freq[20]; // 23-42 + //float VolumeFloat; // 43 + //uint32 Flags; // 44 + //float MinDistance; // 45 + //float DistanceCutoff; // 46 + //uint32 EAXDef; // 47 + //uint32 SoundEntriesAdvancedID; // 48 + //float VolumeVariationPlus; // 49 + //float VolumeVariationMinus; // 50 + //float PitchVariationPlus; // 51 + //float PitchVariationMinus; // 52 + //float PitchAdjust; // 53 + //uint32 DialogType; // 54 + //uint32 BusOverwriteID; // 55 }; // SpellEffect.dbc diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index d01d33ac685..84e98751a28 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -115,16 +115,16 @@ char const OverrideSpellDatafmt[] = "niiiiiiiiiixx"; char const QuestFactionRewardfmt[] = "niiiiiiiiii"; char const QuestSortEntryfmt[] = "nx"; char const QuestXPfmt[] = "niiiiiiiiii"; -char const PowerDisplayfmt[] = "nixxxx"; -char const PvPDifficultyfmt[] = "diiiii"; -char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiiii"; +char const PowerDisplayfmt[] = "nixx"; +char const PvPDifficultyfmt[] = "diiii"; +char const RandomPropertiesPointsfmt[] = "niiiiiiiiiiiiii"; char const ScalingStatDistributionfmt[] = "niiiiiiiiiiiiiiiiiiiixi"; -char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; -char const SkillLinefmt[] = "nisxixi"; -char const SkillLineAbilityfmt[] = "niiiixxiiiiiii"; -char const SkillRaceClassInfofmt[] = "diiiixxix"; -char const SkillTiersfmt[] = "nxxxxxxxxxxxxxxxxiiiiiiiiiiiiiiii"; -char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; +char const ScalingStatValuesfmt[] = "iniiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii"; +char const SkillLinefmt[] = "nisxixixx"; +char const SkillLineAbilityfmt[] = "niiiiiiiiiiii"; +char const SkillRaceClassInfofmt[] = "diiiixxi"; +char const SkillTiersfmt[] = "niiiiiiiiiiiiiiii"; +char const SoundEntriesfmt[] = "nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const SpellCastTimefmt[] = "nixx"; char const SpellCategoriesEntryfmt[] = "diiiiii"; char const SpellCategoryfmt[] = "nixx"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b01b602449e..139b36a35da 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -3687,13 +3687,13 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent // not ranked skills for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx) { - SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId); + SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->SkillLine); if (!pSkill) continue; ///@todo: confirm if rogues start with lockpicking skill at level 1 but only receive the spell to use it at level 16 - if ((_spell_idx->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->id)) || (pSkill->id == SKILL_LOCKPICKING && _spell_idx->second->max_value == 0)) - LearnDefaultSkill(pSkill->id, 0); + if ((_spell_idx->second->AquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->ID)) || (pSkill->ID == SKILL_LOCKPICKING && _spell_idx->second->TrivialSkillLineRankHigh == 0)) + LearnDefaultSkill(pSkill->ID, 0); } } } @@ -3717,8 +3717,8 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent // not ranked skills for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx) { - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->SkillLine); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->SkillLine); } UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId); @@ -5858,24 +5858,24 @@ bool Player::UpdateCraftSkill(uint32 spellid) for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { - if (_spell_idx->second->skillId) + if (_spell_idx->second->SkillLine) { - uint32 SkillValue = GetPureSkillValue(_spell_idx->second->skillId); + uint32 SkillValue = GetPureSkillValue(_spell_idx->second->SkillLine); // Alchemy Discoveries here SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(spellid); if (spellEntry && spellEntry->Mechanic == MECHANIC_DISCOVERY) { - if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->skillId, spellid, this)) + if (uint32 discoveredSpell = GetSkillDiscoverySpell(_spell_idx->second->SkillLine, spellid, this)) LearnSpell(discoveredSpell, false); } uint32 craft_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING); - return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue, - _spell_idx->second->max_value, - (_spell_idx->second->max_value + _spell_idx->second->min_value)/2, - _spell_idx->second->min_value), + return UpdateSkillPro(_spell_idx->second->SkillLine, SkillGainChance(SkillValue, + _spell_idx->second->TrivialSkillLineRankHigh, + (_spell_idx->second->TrivialSkillLineRankHigh + _spell_idx->second->TrivialSkillLineRankLow)/2, + _spell_idx->second->TrivialSkillLineRankLow), craft_skill_gain); } } @@ -6015,7 +6015,7 @@ void Player::UpdateSkillsForLevel() if (GetSkillRangeType(rcEntry) != SKILL_RANGE_LEVEL) continue; - if (IsWeaponSkill(rcEntry->SkillId)) + if (IsWeaponSkill(rcEntry->SkillID)) continue; uint16 field = itr->second.pos / 2; @@ -6047,10 +6047,10 @@ void Player::UpdateSkillsToMaxSkillsForLevel() if (!rcEntry) continue; - if (IsProfessionOrRidingSkill(rcEntry->SkillId)) + if (IsProfessionOrRidingSkill(rcEntry->SkillID)) continue; - if (IsWeaponSkill(rcEntry->SkillId)) + if (IsWeaponSkill(rcEntry->SkillID)) continue; uint16 field = itr->second.pos / 2; @@ -6128,8 +6128,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) // remove all spells that related to this skill for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) if (SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j)) - if (pAbility->skillId == id) - RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->spellId)); + if (pAbility->SkillLine == id) + RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->SpellID)); // Clear profession lines if (GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1) == id) @@ -6156,7 +6156,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) } SetUInt16Value(PLAYER_SKILL_LINEID + SKILL_ID_OFFSET + field, offset, id); - if (skillEntry->categoryId == SKILL_CATEGORY_PROFESSION) + if (skillEntry->CategoryID == SKILL_CATEGORY_PROFESSION) { if (!GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1)) SetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1, id); @@ -7882,9 +7882,9 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply // If set ScalingStatDistribution need get stats and values from it if (ssd && ssv) { - if (ssd->StatMod[i] < 0) + if (ssd->StatID[i] < 0) continue; - statType = ssd->StatMod[i]; + statType = ssd->StatID[i]; val = (ssv->GetStatMultiplier(proto->InventoryType) * ssd->Modifier[i]) / 10000; } else @@ -8060,7 +8060,7 @@ void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply // Apply Spell Power from ScalingStatValue if set if (ssv && proto->Flags2 & ITEM_FLAGS_EXTRA_CASTER_WEAPON) - if (int32 spellbonus = int32(ssv->Spellpower)) + if (int32 spellbonus = int32(ssv->SpellPower)) ApplySpellPowerBonus(spellbonus, apply); // If set ScalingStatValue armor get it or use item armor @@ -23490,8 +23490,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank) if (!rank) break; - SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTier); - uint16 maxValue = tier->MaxSkill[std::max(rank - 1, 0)]; + SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcInfo->SkillTierID); + uint16 maxValue = tier->Value[std::max(rank - 1, 0)]; uint16 skillValue = 1; if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE) skillValue = maxValue; @@ -23606,31 +23606,31 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) { SkillLineAbilityEntry const* ability = sSkillLineAbilityStore.LookupEntry(j); - if (!ability || ability->skillId != skillId) + if (!ability || ability->SkillLine != skillId) continue; - if (!sSpellMgr->GetSpellInfo(ability->spellId)) + if (!sSpellMgr->GetSpellInfo(ability->SpellID)) continue; - if (ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (ability->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; // Check race if set - if (ability->racemask && !(ability->racemask & raceMask)) + if (ability->RaceMask && !(ability->RaceMask & raceMask)) continue; // Check class if set - if (ability->classmask && !(ability->classmask & classMask)) + if (ability->ClassMask && !(ability->ClassMask & classMask)) continue; // need unlearn spell - if (skillValue < ability->req_skill_value && ability->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) - RemoveSpell(ability->spellId); + if (skillValue < ability->MinSkillLineRank && ability->AquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) + RemoveSpell(ability->SpellID); // need learn else if (!IsInWorld()) - AddSpell(ability->spellId, true, true, true, false, false, true); + AddSpell(ability->SpellID, true, true, true, false, false, true); else - LearnSpell(ability->spellId, true, true); + LearnSpell(ability->SpellID, true, true); } } @@ -23897,11 +23897,11 @@ bool Player::IsSpellFitByClassAndRace(uint32 spell_id) const for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { // skip wrong race skills - if (_spell_idx->second->racemask && (_spell_idx->second->racemask & racemask) == 0) + if (_spell_idx->second->RaceMask && (_spell_idx->second->RaceMask & racemask) == 0) continue; // skip wrong class skills - if (_spell_idx->second->classmask && (_spell_idx->second->classmask & classmask) == 0) + if (_spell_idx->second->ClassMask && (_spell_idx->second->ClassMask & classmask) == 0) continue; return true; @@ -25418,13 +25418,13 @@ void Player::_LoadSkills(PreparedQueryResult result) SetUInt16Value(PLAYER_SKILL_LINEID + SKILL_ID_OFFSET + field, offset, skill); uint16 step = 0; - SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(rcEntry->SkillId); + SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(rcEntry->SkillID); if (skillLine) { - if (skillLine->categoryId == SKILL_CATEGORY_SECONDARY) + if (skillLine->CategoryID == SKILL_CATEGORY_SECONDARY) step = max / 75; - if (skillLine->categoryId == SKILL_CATEGORY_PROFESSION) + if (skillLine->CategoryID == SKILL_CATEGORY_PROFESSION) { step = max / 75; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 0e5c82510b4..97e2a40a02f 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7865,17 +7865,17 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry) { - SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillId); + SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID); if (!skill) return SKILL_RANGE_NONE; - if (sSkillTiersStore.LookupEntry(rcEntry->SkillTier)) + if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID)) return SKILL_RANGE_RANK; - if (rcEntry->SkillId == SKILL_RUNEFORGING) + if (rcEntry->SkillID == SKILL_RUNEFORGING) return SKILL_RANGE_MONO; - switch (skill->categoryId) + switch (skill->CategoryID) { case SKILL_CATEGORY_ARMOR: return SKILL_RANGE_MONO; diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 8795bd812de..2aa40942171 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1881,7 +1881,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (member->GetTeam() != team) return ERR_BATTLEGROUND_JOIN_TIMED_OUT; // not in the same battleground level braket, don't let join - PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId, member->getLevel()); + PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->MapID, member->getLevel()); if (memberBracketEntry != bracketEntry) return ERR_BATTLEGROUND_JOIN_RANGE_INDEX; // don't let join rated matches if the arena team id doesn't match diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 498c669ba01..8dfa4449e12 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -227,16 +227,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun TC_LOG_DEBUG("maps", "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel()); - - uint8 spawnMode; - - if (bracketEntry) - spawnMode = bracketEntry->difficulty; - else - spawnMode = REGULAR_DIFFICULTY; - - BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode); + BattlegroundMap* map = new BattlegroundMap(GetId(), GetGridExpiry(), InstanceId, this, REGULAR_DIFFICULTY); ASSERT(map->IsBattlegroundOrArena()); map->SetBG(bg); bg->SetBgMap(map); diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index e8a89039031..4d9800acedd 100644 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -122,7 +122,7 @@ void LoadSkillDiscoveryTable() } for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - SkillDiscoveryStore[-int32(_spell_idx->second->skillId)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance)); + SkillDiscoveryStore[-int32(_spell_idx->second->SkillLine)].push_back(SkillDiscoveryEntry(spellId, reqSkillValue, chance)); } else { @@ -164,7 +164,7 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) return 0; SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); - uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : uint32(0); + uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->SkillLine) : uint32(0); float full_chance = 0; for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index c8fbbcbec53..ef83bdced50 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5293,7 +5293,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, overrideId); if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId)) for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i) - if (uint32 spellId = overrideSpells->spellId[i]) + if (uint32 spellId = overrideSpells->SpellID[i]) target->AddTemporarySpell(spellId); } else @@ -5301,7 +5301,7 @@ void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 m target->SetUInt16Value(PLAYER_FIELD_BYTES2, 0, 0); if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId)) for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i) - if (uint32 spellId = overrideSpells->spellId[i]) + if (uint32 spellId = overrideSpells->SpellID[i]) target->RemoveTemporarySpell(spellId); } } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0f84226cf06..c441bd9b3f7 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2447,12 +2447,12 @@ void Spell::EffectLearnSkill(SpellEffIndex effIndex) if (!rcEntry) return; - SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTier); + SkillTiersEntry const* tier = sSkillTiersStore.LookupEntry(rcEntry->SkillTierID); if (!tier) return; uint16 skillval = unitTarget->ToPlayer()->GetPureSkillValue(skillid); - unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max(skillval, 1), tier->MaxSkill[damage - 1]); + unitTarget->ToPlayer()->SetSkill(skillid, m_spellInfo->Effects[effIndex].CalcValue(), std::max(skillval, 1), tier->Value[damage - 1]); } void Spell::EffectPlayMovie(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 8eb358cdcbb..917f69547a1 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1131,10 +1131,10 @@ bool SpellInfo::IsAbilityLearnedWithProfession() const for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) { SkillLineAbilityEntry const* pAbility = _spell_idx->second; - if (!pAbility || pAbility->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) + if (!pAbility || pAbility->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE) continue; - if (pAbility->req_skill_value > 0) + if (pAbility->MinSkillLineRank > 0) return true; } @@ -1146,7 +1146,7 @@ bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id); for (SkillLineAbilityMap::const_iterator _spell_idx = bounds.first; _spell_idx != bounds.second; ++_spell_idx) - if (_spell_idx->second->skillId == uint32(skillType)) + if (_spell_idx->second->SkillLine == uint32(skillType)) return true; return false; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7aebc202d81..4463fc0da75 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -35,20 +35,20 @@ bool IsPrimaryProfessionSkill(uint32 skill) { SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); - return pSkill && pSkill->categoryId == SKILL_CATEGORY_PROFESSION; + return pSkill && pSkill->CategoryID == SKILL_CATEGORY_PROFESSION; } bool IsWeaponSkill(uint32 skill) { SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(skill); - return pSkill && pSkill->categoryId == SKILL_CATEGORY_WEAPON; + return pSkill && pSkill->CategoryID == SKILL_CATEGORY_WEAPON; } bool IsPartOfSkillLine(uint32 skillId, uint32 spellId) { SkillLineAbilityMapBounds skillBounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); for (SkillLineAbilityMap::const_iterator itr = skillBounds.first; itr != skillBounds.second; ++itr) - if (itr->second->skillId == skillId) + if (itr->second->SkillLine == skillId) return true; return false; @@ -2207,7 +2207,7 @@ void SpellMgr::LoadSkillLineAbilityMap() if (!SkillInfo) continue; - mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId, SkillInfo)); + mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->SpellID, SkillInfo)); ++count; } @@ -2445,13 +2445,13 @@ void SpellMgr::LoadPetLevelupSpellMap() // (!creatureFamily->SkillLine[1] || skillLine->skillId != creatureFamily->SkillLine[1])) // continue; - if (skillLine->skillId != creatureFamily->SkillLine[j]) + if (skillLine->SkillLine != creatureFamily->SkillLine[j]) continue; - if (skillLine->AutolearnType != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) + if (skillLine->AquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; - SpellInfo const* spell = GetSpellInfo(skillLine->spellId); + SpellInfo const* spell = GetSpellInfo(skillLine->SpellID); if (!spell) // not exist or triggered or talent continue; diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index bed6715fec1..eb5be0950aa 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -160,7 +160,7 @@ public: if (!entry) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(entry->SpellID); if (!spellInfo) continue; @@ -352,10 +352,10 @@ public: if (!skillInfo) continue; - if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) && - skillInfo->canLink) // only prof. with recipes have + if ((skillInfo->CategoryID == SKILL_CATEGORY_PROFESSION || skillInfo->CategoryID == SKILL_CATEGORY_SECONDARY) && + skillInfo->CanLink) // only prof. with recipes have { - HandleLearnSkillRecipesHelper(target, skillInfo->id); + HandleLearnSkillRecipesHelper(target, skillInfo->ID); } } @@ -395,12 +395,12 @@ public: if (!skillInfo) continue; - if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION && - skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) || - !skillInfo->canLink) // only prof with recipes have set + if ((skillInfo->CategoryID != SKILL_CATEGORY_PROFESSION && + skillInfo->CategoryID != SKILL_CATEGORY_SECONDARY) || + !skillInfo->CanLink) // only prof with recipes have set continue; - name = skillInfo->name; + name = skillInfo->DisplayName_lang; if (name.empty()) continue; @@ -413,10 +413,10 @@ public: if (!targetSkillInfo) return false; - HandleLearnSkillRecipesHelper(target, targetSkillInfo->id); + HandleLearnSkillRecipesHelper(target, targetSkillInfo->ID); - uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->id); - target->SetSkill(targetSkillInfo->id, target->GetSkillStep(targetSkillInfo->id), maxLevel, maxLevel); + uint16 maxLevel = target->GetPureMaxSkillValue(targetSkillInfo->ID); + target->SetSkill(targetSkillInfo->ID, target->GetSkillStep(targetSkillInfo->ID), maxLevel, maxLevel); handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_RECIPES, name.c_str()); return true; } @@ -432,26 +432,26 @@ public: continue; // wrong skill - if (skillLine->skillId != skillId) + if (skillLine->SkillLine != skillId) continue; // not high rank - if (skillLine->forward_spellid) + if (skillLine->SupercedesSpell) continue; // skip racial skills - if (skillLine->racemask != 0) + if (skillLine->RaceMask != 0) continue; // skip wrong class skills - if (skillLine->classmask && (skillLine->classmask & classmask) == 0) + if (skillLine->ClassMask && (skillLine->ClassMask & classmask) == 0) continue; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->spellId); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(skillLine->SpellID); if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo, player, false)) continue; - player->LearnSpell(skillLine->spellId, false); + player->LearnSpell(skillLine->SpellID, false); } } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 67505e713de..7d8fec52143 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -724,7 +724,7 @@ public: SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(id); if (skillInfo) { - std::string name = skillInfo->name; + std::string name = skillInfo->DisplayName_lang; if (name.empty()) continue; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d51150edb66..4c2b7d40a89 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1359,7 +1359,7 @@ public: // add the skill to the player's book with step 1 (which is the first rank, in most cases something // like 'Apprentice '. target->SetSkill(skill, targetHasSkill ? target->GetSkillStep(skill) : 1, level, max); - handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name, handler->GetNameLink(target).c_str(), level, max); + handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->DisplayName_lang, handler->GetNameLink(target).c_str(), level, max); return true; } -- cgit v1.2.3