Merge branch 'master' into questXPHook

This commit is contained in:
郑佩茹
2022-03-13 16:37:06 -06:00
74 changed files with 1851 additions and 1006 deletions
@@ -64,7 +64,7 @@ void SmartWaypointMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -136,7 +136,7 @@ void SmartAIMgr::LoadSmartAIFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 SmartAI scripts. DB table `smart_scripts` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 SmartAI scripts. DB table `smart_scripts` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2455,7 +2455,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
if (sAchievementCriteriaStore.GetNumRows() == 0)
{
LOG_INFO("server.loading", ">> Loaded 0 achievement criteria.");
LOG_WARN("server.loading", ">> Loaded 0 achievement criteria.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2604,7 +2604,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
if (sAchievementStore.GetNumRows() == 0)
{
LOG_INFO("server.loading", ">> Loaded 0 achievement references.");
LOG_WARN("server.loading", ">> Loaded 0 achievement references.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2635,7 +2635,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 additional achievement criteria data. DB table `achievement_criteria_data` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2776,7 +2776,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 completed achievements. DB table `character_achievement` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 completed achievements. DB table `character_achievement` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2818,7 +2818,7 @@ void AchievementGlobalMgr::LoadRewards()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2939,7 +2939,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 achievement reward locale strings. DB table `achievement_reward_locale` is empty");
LOG_WARN("server.loading", ">> Loaded 0 achievement reward locale strings. DB table `achievement_reward_locale` is empty");
LOG_INFO("server.loading", " ");
return;
}
+1 -1
View File
@@ -42,7 +42,7 @@ namespace AddonMgr
QueryResult result = CharacterDatabase.Query("SELECT name, crc FROM addons");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 known addons. DB table `addons` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 known addons. DB table `addons` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -493,7 +493,7 @@ void AuctionHouseMgr::LoadAuctionItems()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 auction items. DB table `auctionhouse` or `item_instance` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -538,7 +538,7 @@ void AuctionHouseMgr::LoadAuctions()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 auctions. DB table `auctionhouse` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -157,7 +157,7 @@ void ArenaTeamMgr::LoadArenaTeams()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 arena teams. DB table `arena_team` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 arena teams. DB table `arena_team` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -663,7 +663,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -662,10 +662,7 @@ enum BG_AV_CreaturePlace
AV_CPLACE_TRIGGER18 = 319,
AV_CPLACE_TRIGGER19 = 320,
AV_CPLACE_MAX = 321,
AV_CPLACE_A_BOSS = 381,
AV_CPLACE_H_BOSS = 445
AV_CPLACE_MAX = 321
};
//x, y, z, o
+2 -2
View File
@@ -56,7 +56,7 @@ void ChannelMgr::LoadChannels()
QueryResult result = CharacterDatabase.Query("SELECT channelId, name, team, announce, ownership, password FROM channels ORDER BY channelId ASC");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 channels. DB table `channels` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 channels. DB table `channels` is empty.");
return;
}
@@ -171,7 +171,7 @@ void ChannelMgr::LoadChannelRights()
QueryResult result = CharacterDatabase.Query("SELECT name, flags, speakdelay, joinmessage, delaymessage, moderators FROM channels_rights");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 Channel Rights!");
LOG_WARN("server.loading", ">> Loaded 0 Channel Rights!");
LOG_INFO("server.loading", " ");
return;
}
+1 -1
View File
@@ -935,7 +935,7 @@ void ConditionMgr::LoadConditions(bool isReload)
if (!result)
{
LOG_ERROR("server.loading", ">> Loaded 0 conditions. DB table `conditions` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 conditions. DB table `conditions` is empty!");
return;
}
+1 -1
View File
@@ -63,7 +63,7 @@ namespace DisableMgr
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 disables. DB table `disables` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 disables. DB table `disables` is empty!");
LOG_INFO("server.loading", " ");
return;
}
-272
View File
@@ -25,8 +25,6 @@
#include "SpellMgr.h"
#include "TransportMgr.h"
#include "World.h"
#include <fstream>
#include <iostream>
#include <map>
typedef std::map<uint16, uint32> AreaFlagByAreaID;
@@ -190,8 +188,6 @@ DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore(WMOAreaTableEntryfmt);
DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore(WorldMapAreaEntryfmt);
DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore(WorldMapOverlayEntryfmt);
std::unordered_map<uint32, FlyByCameraCollection> sFlyByCameraStore;
typedef std::list<std::string> StoreProblemList;
uint32 DBCFileCount = 0;
@@ -635,278 +631,10 @@ void LoadDBCStores(const std::string& dataPath)
exit(1);
}
LoadM2Cameras(dataPath);
LOG_INFO("server.loading", ">> Initialized {} data stores in {} ms", DBCFileCount, GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", " ");
}
// Convert the geomoetry from a spline value, to an actual WoW XYZ
G3D::Vector3 TranslateLocation(G3D::Vector4 const* DBCPosition, G3D::Vector3 const* basePosition, G3D::Vector3 const* splineVector)
{
G3D::Vector3 work;
float x = basePosition->x + splineVector->x;
float y = basePosition->y + splineVector->y;
float z = basePosition->z + splineVector->z;
float const distance = std::sqrt((x * x) + (y * y));
float angle = std::atan2(x, y) - DBCPosition->w;
if (angle < 0)
{
angle += 2 * float(M_PI);
}
work.x = DBCPosition->x + (distance * std::sin(angle));
work.y = DBCPosition->y + (distance * cos(angle));
work.z = DBCPosition->z + z;
return work;
}
// Number of cameras not used. Multiple cameras never used in 3.3.5
bool readCamera(M2Camera const* cam, uint32 buffSize, M2Header const* header, CinematicCameraEntry const* dbcentry)
{
char const* buffer = reinterpret_cast<char const*>(header);
FlyByCameraCollection cameras;
FlyByCameraCollection targetcam;
G3D::Vector4 DBCData;
DBCData.x = dbcentry->base_x;
DBCData.y = dbcentry->base_y;
DBCData.z = dbcentry->base_z;
DBCData.w = dbcentry->base_o;
// Read target locations, only so that we can calculate orientation
for (uint32 k = 0; k < cam->target_positions.timestamps.number; ++k)
{
// Extract Target positions
if (cam->target_positions.timestamps.offset_elements + sizeof(M2Array) > buffSize)
{
return false;
}
M2Array const* targTsArray = reinterpret_cast<M2Array const*>(buffer + cam->target_positions.timestamps.offset_elements);
if (targTsArray->offset_elements + sizeof(uint32) > buffSize || cam->target_positions.values.offset_elements + sizeof(M2Array) > buffSize)
{
return false;
}
uint32 const* targTimestamps = reinterpret_cast<uint32 const*>(buffer + targTsArray->offset_elements);
M2Array const* targArray = reinterpret_cast<M2Array const*>(buffer + cam->target_positions.values.offset_elements);
if (targArray->offset_elements + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
{
return false;
}
M2SplineKey<G3D::Vector3> const* targPositions = reinterpret_cast<M2SplineKey<G3D::Vector3> const*>(buffer + targArray->offset_elements);
// Read the data for this set
uint32 currPos = targArray->offset_elements;
for (uint32 i = 0; i < targTsArray->number; ++i)
{
if (currPos + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
{
return false;
}
// Translate co-ordinates
G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->target_position_base, &targPositions->p0);
// Add to vector
FlyByCamera thisCam;
thisCam.timeStamp = targTimestamps[i];
thisCam.locations.x = newPos.x;
thisCam.locations.y = newPos.y;
thisCam.locations.z = newPos.z;
thisCam.locations.w = 0.0f;
targetcam.push_back(thisCam);
targPositions++;
currPos += sizeof(M2SplineKey<G3D::Vector3>);
}
}
// Read camera positions and timestamps (translating first position of 3 only, we don't need to translate the whole spline)
for (uint32 k = 0; k < cam->positions.timestamps.number; ++k)
{
// Extract Camera positions for this set
if (cam->positions.timestamps.offset_elements + sizeof(M2Array) > buffSize)
{
return false;
}
M2Array const* posTsArray = reinterpret_cast<M2Array const*>(buffer + cam->positions.timestamps.offset_elements);
if (posTsArray->offset_elements + sizeof(uint32) > buffSize || cam->positions.values.offset_elements + sizeof(M2Array) > buffSize)
{
return false;
}
uint32 const* posTimestamps = reinterpret_cast<uint32 const*>(buffer + posTsArray->offset_elements);
M2Array const* posArray = reinterpret_cast<M2Array const*>(buffer + cam->positions.values.offset_elements);
if (posArray->offset_elements + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
{
return false;
}
M2SplineKey<G3D::Vector3> const* positions = reinterpret_cast<M2SplineKey<G3D::Vector3> const*>(buffer + posArray->offset_elements);
// Read the data for this set
uint32 currPos = posArray->offset_elements;
for (uint32 i = 0; i < posTsArray->number; ++i)
{
if (currPos + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
{
return false;
}
// Translate co-ordinates
G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->position_base, &positions->p0);
// Add to vector
FlyByCamera thisCam;
thisCam.timeStamp = posTimestamps[i];
thisCam.locations.x = newPos.x;
thisCam.locations.y = newPos.y;
thisCam.locations.z = newPos.z;
if (targetcam.size() > 0)
{
// Find the target camera before and after this camera
FlyByCamera lastTarget;
FlyByCamera nextTarget;
// Pre-load first item
lastTarget = targetcam[0];
nextTarget = targetcam[0];
for (uint32 j = 0; j < targetcam.size(); ++j)
{
nextTarget = targetcam[j];
if (targetcam[j].timeStamp > posTimestamps[i])
{
break;
}
lastTarget = targetcam[j];
}
float x = lastTarget.locations.x;
float y = lastTarget.locations.y;
// float z = lastTarget.locations.z;
// Now, the timestamps for target cam and position can be different. So, if they differ we interpolate
if (lastTarget.timeStamp != posTimestamps[i])
{
uint32 timeDiffTarget = nextTarget.timeStamp - lastTarget.timeStamp;
uint32 timeDiffThis = posTimestamps[i] - lastTarget.timeStamp;
float xDiff = nextTarget.locations.x - lastTarget.locations.x;
float yDiff = nextTarget.locations.y - lastTarget.locations.y;
// float zDiff = nextTarget.locations.z - lastTarget.locations.z;
x = lastTarget.locations.x + (xDiff * (float(timeDiffThis) / float(timeDiffTarget)));
y = lastTarget.locations.y + (yDiff * (float(timeDiffThis) / float(timeDiffTarget)));
// z = lastTarget.locations.z + (zDiff * (float(timeDiffThis) / float(timeDiffTarget)));
}
float xDiff = x - thisCam.locations.x;
float yDiff = y - thisCam.locations.y;
thisCam.locations.w = std::atan2(yDiff, xDiff);
if (thisCam.locations.w < 0)
{
thisCam.locations.w += 2 * float(M_PI);
}
}
cameras.push_back(thisCam);
positions++;
currPos += sizeof(M2SplineKey<G3D::Vector3>);
}
}
sFlyByCameraStore[dbcentry->id] = cameras;
return true;
}
void LoadM2Cameras(const std::string& dataPath)
{
sFlyByCameraStore.clear();
LOG_INFO("server.loading", ">> Loading Cinematic Camera files");
uint32 oldMSTime = getMSTime();
for (uint32 i = 0; i < sCinematicCameraStore.GetNumRows(); ++i)
{
if (CinematicCameraEntry const* dbcentry = sCinematicCameraStore.LookupEntry(i))
{
std::string filename = dataPath.c_str();
filename.append(dbcentry->filename);
// Replace slashes
size_t loc = filename.find("\\");
while (loc != std::string::npos)
{
filename.replace(loc, 1, "/");
loc = filename.find("\\");
}
// Replace mdx to .m2
loc = filename.find(".mdx");
if (loc != std::string::npos)
{
filename.replace(loc, 4, ".m2");
}
std::ifstream m2file(filename.c_str(), std::ios::in | std::ios::binary);
if (!m2file.is_open())
{
continue;
}
// Get file size
m2file.seekg(0, std::ios::end);
std::streamoff const fileSize = m2file.tellg();
// Reject if not at least the size of the header
if (static_cast<uint32>(fileSize) < sizeof(M2Header))
{
LOG_ERROR("dbc", "Camera file {} is damaged. File is smaller than header size", filename);
m2file.close();
continue;
}
// Read 4 bytes (signature)
m2file.seekg(0, std::ios::beg);
char fileCheck[5];
m2file.read(fileCheck, 4);
fileCheck[4] = 0;
// Check file has correct magic (MD20)
if (strcmp(fileCheck, "MD20"))
{
LOG_ERROR("dbc", "Camera file {} is damaged. File identifier not found", filename);
m2file.close();
continue;
}
// Now we have a good file, read it all into a vector of char's, then close the file.
std::vector<char> buffer(fileSize);
m2file.seekg(0, std::ios::beg);
if (!m2file.read(buffer.data(), fileSize))
{
m2file.close();
continue;
}
m2file.close();
// Read header
M2Header const* header = reinterpret_cast<M2Header const*>(buffer.data());
if (header->ofsCameras + sizeof(M2Camera) > static_cast<uint32>(fileSize))
{
LOG_ERROR("dbc", "Camera file {} is damaged. Camera references position beyond file end", filename);
continue;
}
// Get camera(s) - Main header, then dump them.
M2Camera const* cam = reinterpret_cast<M2Camera const*>(buffer.data() + header->ofsCameras);
if (!readCamera(cam, fileSize, header, dbcentry))
{
LOG_ERROR("dbc", "Camera file {} is damaged. Camera references position beyond file end", filename);
}
}
}
LOG_INFO("server.loading", ">> Loaded {} cinematic waypoint sets in {} ms", (uint32)sFlyByCameraStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
SimpleFactionsList const* GetFactionTeamList(uint32 faction)
{
FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
-3
View File
@@ -26,7 +26,6 @@
#include <unordered_set>
typedef std::list<uint32> SimpleFactionsList;
typedef std::vector<FlyByCamera> FlyByCameraCollection;
SimpleFactionsList const* GetFactionTeamList(uint32 faction);
@@ -183,9 +182,7 @@ extern DBCStorage <VehicleSeatEntry> sVehicleSeatStore;
extern DBCStorage <WMOAreaTableEntry> sWMOAreaTableStore;
//extern DBCStorage <WorldMapAreaEntry> sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates
extern DBCStorage <WorldMapOverlayEntry> sWorldMapOverlayStore;
extern std::unordered_map<uint32, FlyByCameraCollection> sFlyByCameraStore;
void LoadDBCStores(const std::string& dataPath);
void LoadM2Cameras(const std::string& dataPath);
#endif
+259
View File
@@ -0,0 +1,259 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "DBCStores.h"
#include "Common.h"
#include "Containers.h"
#include "Log.h"
#include "M2Structure.h"
#include "M2Stores.h"
#include "World.h"
#include <boost/filesystem/path.hpp>
#include <fstream>
#include <iostream>
#include <iomanip>
typedef std::vector<FlyByCamera> FlyByCameraCollection;
std::unordered_map<uint32, FlyByCameraCollection> sFlyByCameraStore;
// Convert the geomoetry from a spline value, to an actual WoW XYZ
G3D::Vector3 TranslateLocation(G3D::Vector4 const* DBCPosition, G3D::Vector3 const* basePosition, G3D::Vector3 const* splineVector)
{
G3D::Vector3 work;
float x = basePosition->x + splineVector->x;
float y = basePosition->y + splineVector->y;
float z = basePosition->z + splineVector->z;
float const distance = std::sqrt((x * x) + (y * y));
float angle = std::atan2(x, y) - DBCPosition->w;
if (angle < 0)
angle += 2 * float(M_PI);
work.x = DBCPosition->x + (distance * sin(angle));
work.y = DBCPosition->y + (distance * cos(angle));
work.z = DBCPosition->z + z;
return work;
}
// Number of cameras not used. Multiple cameras never used in 3.3.5
bool readCamera(M2Camera const* cam, uint32 buffSize, M2Header const* header, CinematicCameraEntry const* dbcentry)
{
char const* buffer = reinterpret_cast<char const*>(header);
FlyByCameraCollection cameras;
FlyByCameraCollection targetcam;
G3D::Vector4 DBCData;
DBCData.x = dbcentry->Origin.X;
DBCData.y = dbcentry->Origin.Y;
DBCData.z = dbcentry->Origin.Z;
DBCData.w = dbcentry->OriginFacing;
// Read target locations, only so that we can calculate orientation
for (uint32 k = 0; k < cam->target_positions.timestamps.number; ++k)
{
// Extract Target positions
if (cam->target_positions.timestamps.offset_elements + sizeof(M2Array) > buffSize)
return false;
M2Array const* targTsArray = reinterpret_cast<M2Array const*>(buffer + cam->target_positions.timestamps.offset_elements);
if (targTsArray->offset_elements + sizeof(uint32) > buffSize || cam->target_positions.values.offset_elements + sizeof(M2Array) > buffSize)
return false;
uint32 const* targTimestamps = reinterpret_cast<uint32 const*>(buffer + targTsArray->offset_elements);
M2Array const* targArray = reinterpret_cast<M2Array const*>(buffer + cam->target_positions.values.offset_elements);
if (targArray->offset_elements + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
return false;
M2SplineKey<G3D::Vector3> const* targPositions = reinterpret_cast<M2SplineKey<G3D::Vector3> const*>(buffer + targArray->offset_elements);
// Read the data for this set
uint32 currPos = targArray->offset_elements;
for (uint32 i = 0; i < targTsArray->number; ++i)
{
if (currPos + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
return false;
// Translate co-ordinates
G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->target_position_base, &targPositions->p0);
// Add to vector
FlyByCamera thisCam;
thisCam.timeStamp = targTimestamps[i];
thisCam.locations.Relocate(newPos.x, newPos.y, newPos.z, 0.0f);
targetcam.push_back(thisCam);
targPositions++;
currPos += sizeof(M2SplineKey<G3D::Vector3>);
}
}
// Read camera positions and timestamps (translating first position of 3 only, we don't need to translate the whole spline)
for (uint32 k = 0; k < cam->positions.timestamps.number; ++k)
{
// Extract Camera positions for this set
if (cam->positions.timestamps.offset_elements + sizeof(M2Array) > buffSize)
return false;
M2Array const* posTsArray = reinterpret_cast<M2Array const*>(buffer + cam->positions.timestamps.offset_elements);
if (posTsArray->offset_elements + sizeof(uint32) > buffSize || cam->positions.values.offset_elements + sizeof(M2Array) > buffSize)
return false;
uint32 const* posTimestamps = reinterpret_cast<uint32 const*>(buffer + posTsArray->offset_elements);
M2Array const* posArray = reinterpret_cast<M2Array const*>(buffer + cam->positions.values.offset_elements);
if (posArray->offset_elements + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
return false;
M2SplineKey<G3D::Vector3> const* positions = reinterpret_cast<M2SplineKey<G3D::Vector3> const*>(buffer + posArray->offset_elements);
// Read the data for this set
uint32 currPos = posArray->offset_elements;
for (uint32 i = 0; i < posTsArray->number; ++i)
{
if (currPos + sizeof(M2SplineKey<G3D::Vector3>) > buffSize)
return false;
// Translate co-ordinates
G3D::Vector3 newPos = TranslateLocation(&DBCData, &cam->position_base, &positions->p0);
// Add to vector
FlyByCamera thisCam;
thisCam.timeStamp = posTimestamps[i];
thisCam.locations.Relocate(newPos.x, newPos.y, newPos.z);
if (targetcam.size() > 0)
{
// Find the target camera before and after this camera
FlyByCamera lastTarget;
FlyByCamera nextTarget;
// Pre-load first item
lastTarget = targetcam[0];
nextTarget = targetcam[0];
for (uint32 j = 0; j < targetcam.size(); ++j)
{
nextTarget = targetcam[j];
if (targetcam[j].timeStamp > posTimestamps[i])
break;
lastTarget = targetcam[j];
}
float x, y, z;
lastTarget.locations.GetPosition(x, y, z);
// Now, the timestamps for target cam and position can be different. So, if they differ we interpolate
if (lastTarget.timeStamp != posTimestamps[i])
{
uint32 timeDiffTarget = nextTarget.timeStamp - lastTarget.timeStamp;
uint32 timeDiffThis = posTimestamps[i] - lastTarget.timeStamp;
float xDiff = nextTarget.locations.GetPositionX() - lastTarget.locations.GetPositionX();
float yDiff = nextTarget.locations.GetPositionY() - lastTarget.locations.GetPositionY();
x = lastTarget.locations.GetPositionX() + (xDiff * (float(timeDiffThis) / float(timeDiffTarget)));
y = lastTarget.locations.GetPositionY() + (yDiff * (float(timeDiffThis) / float(timeDiffTarget)));
}
float xDiff = x - thisCam.locations.GetPositionX();
float yDiff = y - thisCam.locations.GetPositionY();
thisCam.locations.SetOrientation(std::atan2(yDiff, xDiff));
}
cameras.push_back(thisCam);
positions++;
currPos += sizeof(M2SplineKey<G3D::Vector3>);
}
}
sFlyByCameraStore[dbcentry->ID] = cameras;
return true;
}
void LoadM2Cameras(std::string const& dataPath)
{
sFlyByCameraStore.clear();
LOG_INFO("server.loading", ">> Loading Cinematic Camera files");
uint32 oldMSTime = getMSTime();
for (CinematicCameraEntry const* dbcentry : sCinematicCameraStore)
{
std::string filenameWork = dataPath;
filenameWork.append(dbcentry->Model);
// Replace slashes (always to forward slash, because boost!)
std::replace(filenameWork.begin(), filenameWork.end(), '\\', '/');
boost::filesystem::path filename = filenameWork;
// Convert to native format
filename.make_preferred();
// Replace mdx to .m2
filename.replace_extension("m2");
std::ifstream m2file(filename.string().c_str(), std::ios::in | std::ios::binary);
if (!m2file.is_open())
continue;
// Get file size
m2file.seekg(0, std::ios::end);
std::streamoff fileSize = m2file.tellg();
// Reject if not at least the size of the header
if (static_cast<uint32>(fileSize) < sizeof(M2Header))
{
LOG_ERROR("server.loading", "Camera file %s is damaged. File is smaller than header size", filename.string().c_str());
m2file.close();
continue;
}
// Read 4 bytes (signature)
m2file.seekg(0, std::ios::beg);
char fileCheck[5];
m2file.read(fileCheck, 4);
fileCheck[4] = 0;
// Check file has correct magic (MD20)
if (strcmp(fileCheck, "MD20"))
{
LOG_ERROR("server.loading", "Camera file %s is damaged. File identifier not found", filename.string().c_str());
m2file.close();
continue;
}
// Now we have a good file, read it all into a vector of char's, then close the file.
std::vector<char> buffer(fileSize);
m2file.seekg(0, std::ios::beg);
if (!m2file.read(buffer.data(), fileSize))
{
m2file.close();
continue;
}
m2file.close();
// Read header
M2Header const* header = reinterpret_cast<M2Header const*>(buffer.data());
if (header->ofsCameras + sizeof(M2Camera) > static_cast<uint32>(fileSize))
{
LOG_ERROR("server.loading", "Camera file %s is damaged. Camera references position beyond file end", filename.string().c_str());
continue;
}
// Get camera(s) - Main header, then dump them.
M2Camera const* cam = reinterpret_cast<M2Camera const*>(buffer.data() + header->ofsCameras);
if (!readCamera(cam, fileSize, header, dbcentry))
LOG_ERROR("server.loading", "Camera file %s is damaged. Camera references position beyond file end", filename.string().c_str());
}
LOG_INFO("server.loading", ">> Loaded %u cinematic waypoint sets in %u ms", (uint32)sFlyByCameraStore.size(), GetMSTimeDiffToNow(oldMSTime));
}
std::vector<FlyByCamera> const* GetFlyByCameras(uint32 cinematicCameraId)
{
return Acore::Containers::MapGetValuePtr(sFlyByCameraStore, cinematicCameraId);
}
+35
View File
@@ -0,0 +1,35 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACORE_M2STORES_H
#define ACORE_M2STORES_H
#include "Define.h"
#include "Position.h"
#include <vector>
struct FlyByCamera
{
uint32 timeStamp;
Position locations;
};
AC_GAME_API void LoadM2Cameras(std::string const& dataPath);
AC_GAME_API std::vector<FlyByCamera> const* GetFlyByCameras(uint32 cinematicCameraId);
#endif
+133
View File
@@ -0,0 +1,133 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACORE_M2STRUCTURE_H
#define ACORE_M2STRUCTURE_H
#include <G3D/Vector3.h>
#include <G3D/AABox.h>
// Structures for M2 file. Source: https://wowdev.wiki
#pragma pack(push, 1)
template<typename T>
struct M2SplineKey
{
T p0;
T p1;
T p2;
};
struct M2Header
{
char Magic[4]; // "MD20"
uint32 Version; // The version of the format.
uint32 lName; // Length of the model's name including the trailing \0
uint32 ofsName; // Offset to the name, it seems like models can get reloaded by this name.should be unique, i guess.
uint32 GlobalModelFlags; // 0x0001: tilt x, 0x0002: tilt y, 0x0008: add 2 fields in header, 0x0020: load .phys data (MoP+), 0x0080: has _lod .skin files (MoP?+), 0x0100: is camera related.
uint32 nGlobalSequences;
uint32 ofsGlobalSequences; // A list of timestamps.
uint32 nAnimations;
uint32 ofsAnimations; // Information about the animations in the model.
uint32 nAnimationLookup;
uint32 ofsAnimationLookup; // Mapping of global IDs to the entries in the Animation sequences block.
uint32 nBones; // MAX_BONES = 0x100
uint32 ofsBones; // Information about the bones in this model.
uint32 nKeyBoneLookup;
uint32 ofsKeyBoneLookup; // Lookup table for key skeletal bones.
uint32 nVertices;
uint32 ofsVertices; // Vertices of the model.
uint32 nViews; // Views (LOD) are now in .skins.
uint32 nSubmeshAnimations;
uint32 ofsSubmeshAnimations; // Submesh color and alpha animations definitions.
uint32 nTextures;
uint32 ofsTextures; // Textures of this model.
uint32 nTransparency;
uint32 ofsTransparency; // Transparency of textures.
uint32 nUVAnimation;
uint32 ofsUVAnimation;
uint32 nTexReplace;
uint32 ofsTexReplace; // Replaceable Textures.
uint32 nRenderFlags;
uint32 ofsRenderFlags; // Blending modes / render flags.
uint32 nBoneLookupTable;
uint32 ofsBoneLookupTable; // A bone lookup table.
uint32 nTexLookup;
uint32 ofsTexLookup; // The same for textures.
uint32 nTexUnits; // possibly removed with cata?!
uint32 ofsTexUnits; // And texture units. Somewhere they have to be too.
uint32 nTransLookup;
uint32 ofsTransLookup; // Everything needs its lookup. Here are the transparencies.
uint32 nUVAnimLookup;
uint32 ofsUVAnimLookup;
G3D::AABox BoundingBox; // min/max( [1].z, 2.0277779f ) - 0.16f seems to be the maximum camera height
float BoundingSphereRadius;
G3D::AABox CollisionBox;
float CollisionSphereRadius;
uint32 nBoundingTriangles;
uint32 ofsBoundingTriangles; // Our bounding volumes. Similar structure like in the old ofsViews.
uint32 nBoundingVertices;
uint32 ofsBoundingVertices;
uint32 nBoundingNormals;
uint32 ofsBoundingNormals;
uint32 nAttachments;
uint32 ofsAttachments; // Attachments are for weapons etc.
uint32 nAttachLookup;
uint32 ofsAttachLookup; // Of course with a lookup.
uint32 nEvents;
uint32 ofsEvents; // Used for playing sounds when dying and a lot else.
uint32 nLights;
uint32 ofsLights; // Lights are mainly used in loginscreens but in wands and some doodads too.
uint32 nCameras; // Format of Cameras changed with version 271!
uint32 ofsCameras; // The cameras are present in most models for having a model in the Character-Tab.
uint32 nCameraLookup;
uint32 ofsCameraLookup; // And lookup-time again.
uint32 nRibbonEmitters;
uint32 ofsRibbonEmitters; // Things swirling around. See the CoT-entrance for light-trails.
uint32 nParticleEmitters;
uint32 ofsParticleEmitters; // Spells and weapons, doodads and loginscreens use them. Blood dripping of a blade? Particles.
uint32 nBlendMaps; // This has to deal with blending. Exists IFF (flags & 0x8) != 0. When set, textures blending is overriden by the associated array. See M2/WotLK#Blend_mode_overrides
uint32 ofsBlendMaps; // Same as above. Points to an array of uint16 of nBlendMaps entries -- From WoD information.};
};
struct M2Array
{
uint32_t number;
uint32 offset_elements;
};
struct M2Track
{
uint16_t interpolation_type;
uint16_t global_sequence;
M2Array timestamps;
M2Array values;
};
struct M2Camera
{
uint32_t type; // 0: portrait, 1: characterinfo; -1: else (flyby etc.); referenced backwards in the lookup table.
float fov; // No radians, no degrees. Multiply by 35 to get degrees.
float far_clip;
float near_clip;
M2Track positions; // How the camera's position moves. Should be 3*3 floats.
G3D::Vector3 position_base;
M2Track target_positions; // How the target moves. Should be 3*3 floats.
G3D::Vector3 target_position_base;
M2Track rolldata; // The camera can have some roll-effect. Its 0 to 2*Pi.
};
#pragma pack(pop)
#endif
@@ -86,7 +86,7 @@ void FormationMgr::LoadCreatureFormations()
QueryResult result = WorldDatabase.Query("SELECT leaderGUID, memberGUID, dist, angle, groupAI, point_1, point_2 FROM creature_formations ORDER BY leaderGUID");
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 creatures in formations. DB table `creature_formations` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -73,7 +73,7 @@ void LoadRandomEnchantmentsTable()
}
else
{
LOG_ERROR("sql.sql", ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 Item Enchantment definitions. DB table `item_enchantment_template` is empty.");
LOG_INFO("server.loading", " ");
}
}
+2 -2
View File
@@ -1621,7 +1621,7 @@ float WorldObject::GetGridActivationRange() const
{
if (ToPlayer())
{
if (ToPlayer()->IsOnCinematic())
if (ToPlayer()->GetCinematicMgr()->IsOnCinematic())
{
return DEFAULT_VISIBILITY_INSTANCE;
}
@@ -1688,7 +1688,7 @@ float WorldObject::GetSightRange(WorldObject const* target) const
{
return MAX_VISIBILITY_DISTANCE;
}
else if (ToPlayer()->IsOnCinematic())
else if (ToPlayer()->GetCinematicMgr()->IsOnCinematic())
{
return DEFAULT_VISIBILITY_INSTANCE;
}
@@ -0,0 +1,170 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CinematicMgr.h"
#include "Map.h"
#include "M2Stores.h"
#include "MotionMaster.h"
#include "Player.h"
#include "TemporarySummon.h"
CinematicMgr::CinematicMgr(Player* playerref)
{
player = playerref;
m_cinematicDiff = 0;
m_lastCinematicCheck = 0;
m_activeCinematicCameraId = 0;
m_cinematicLength = 0;
m_cinematicCamera = nullptr;
m_remoteSightPosition = Position(0.0f, 0.0f, 0.0f);
m_CinematicObject = nullptr;
}
CinematicMgr::~CinematicMgr()
{
if (m_cinematicCamera && m_activeCinematicCameraId)
EndCinematic();
}
void CinematicMgr::BeginCinematic()
{
// Sanity check for active camera set
if (m_activeCinematicCameraId == 0)
return;
if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(m_activeCinematicCameraId))
{
// Initialize diff, and set camera
m_cinematicDiff = 0;
m_cinematicCamera = flyByCameras;
auto camitr = m_cinematicCamera->begin();
if (camitr != m_cinematicCamera->end())
{
Position const& pos = camitr->locations;
if (!pos.IsPositionValid())
return;
player->GetMap()->LoadGrid(pos.GetPositionX(), pos.GetPositionY());
m_CinematicObject = player->SummonCreature(VISUAL_WAYPOINT, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 120000);
if (m_CinematicObject)
{
m_CinematicObject->setActive(true);
player->SetViewpoint(m_CinematicObject, true);
}
// Get cinematic length
m_cinematicLength = flyByCameras->back().timeStamp;
}
}
}
void CinematicMgr::EndCinematic()
{
if (m_activeCinematicCameraId == 0)
return;
m_cinematicDiff = 0;
m_cinematicCamera = nullptr;
m_activeCinematicCameraId = 0;
if (m_CinematicObject)
{
if (WorldObject* vpObject = player->GetViewpoint())
if (vpObject == m_CinematicObject)
player->SetViewpoint(m_CinematicObject, false);
m_CinematicObject->AddObjectToRemoveList();
}
}
void CinematicMgr::UpdateCinematicLocation(uint32 /*diff*/)
{
if (m_activeCinematicCameraId == 0 || !m_cinematicCamera || m_cinematicCamera->size() == 0)
return;
Position lastPosition;
uint32 lastTimestamp = 0;
Position nextPosition;
uint32 nextTimestamp = 0;
// Obtain direction of travel
for (FlyByCamera cam : *m_cinematicCamera)
{
if (cam.timeStamp > m_cinematicDiff)
{
nextPosition.Relocate(cam.locations);
nextTimestamp = cam.timeStamp;
break;
}
lastPosition.Relocate(cam.locations);
lastTimestamp = cam.timeStamp;
}
float angle = lastPosition.GetAbsoluteAngle(&nextPosition);
angle -= lastPosition.GetOrientation();
if (angle < 0)
angle += 2 * float(M_PI);
// Look for position around 2 second ahead of us.
int32 workDiff = m_cinematicDiff;
// Modify result based on camera direction (Humans for example, have the camera point behind)
workDiff += static_cast<int32>(float(CINEMATIC_LOOKAHEAD) * cos(angle));
// Get an iterator to the last entry in the cameras, to make sure we don't go beyond the end
auto endItr = m_cinematicCamera->rbegin();
if (endItr != m_cinematicCamera->rend() && workDiff > static_cast<int32>(endItr->timeStamp))
workDiff = endItr->timeStamp;
// Never try to go back in time before the start of cinematic!
if (workDiff < 0)
workDiff = m_cinematicDiff;
// Obtain the previous and next waypoint based on timestamp
for (FlyByCamera cam : *m_cinematicCamera)
{
if (static_cast<int32>(cam.timeStamp) >= workDiff)
{
nextPosition.Relocate(cam.locations);
nextTimestamp = cam.timeStamp;
break;
}
lastPosition.Relocate(cam.locations);
lastTimestamp = cam.timeStamp;
}
// Never try to go beyond the end of the cinematic
if (workDiff > static_cast<int32>(nextTimestamp))
workDiff = static_cast<int32>(nextTimestamp);
// Interpolate the position for this moment in time (or the adjusted moment in time)
uint32 timeDiff = nextTimestamp - lastTimestamp;
uint32 interDiff = workDiff - lastTimestamp;
float xDiff = nextPosition.m_positionX - lastPosition.m_positionX;
float yDiff = nextPosition.m_positionY - lastPosition.m_positionY;
float zDiff = nextPosition.m_positionZ - lastPosition.m_positionZ;
Position interPosition(lastPosition.m_positionX + (xDiff * (float(interDiff) / float(timeDiff))), lastPosition.m_positionY +
(yDiff * (float(interDiff) / float(timeDiff))), lastPosition.m_positionZ + (zDiff * (float(interDiff) / float(timeDiff))));
// Advance (at speed) to this position. The remote sight object is used
// to send update information to player in cinematic
if (m_CinematicObject && interPosition.IsPositionValid())
m_CinematicObject->MonsterMoveWithSpeed(interPosition.m_positionX, interPosition.m_positionY, interPosition.m_positionZ, 500.0f);
// If we never received an end packet 10 seconds after the final timestamp then force an end
if (m_cinematicDiff > m_cinematicLength + 10 * IN_MILLISECONDS)
EndCinematic();
}
@@ -0,0 +1,59 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CinematicMgr_h__
#define CinematicMgr_h__
#include "Define.h"
#include "Object.h"
constexpr auto CINEMATIC_UPDATEDIFF = 500;
constexpr auto CINEMATIC_LOOKAHEAD = 2000;
class Player;
struct FlyByCamera;
class AC_GAME_API CinematicMgr
{
friend class Player;
public:
explicit CinematicMgr(Player* playerref);
~CinematicMgr();
// Cinematic camera data and remote sight functions
uint32 GetActiveCinematicCamera() const { return m_activeCinematicCameraId; }
void SetActiveCinematicCamera(uint32 cinematicCameraId = 0) { m_activeCinematicCameraId = cinematicCameraId; }
bool IsOnCinematic() const { return (m_cinematicCamera != nullptr); }
void BeginCinematic();
void EndCinematic();
void UpdateCinematicLocation(uint32 diff);
private:
// Remote location information
Player* player;
protected:
uint32 m_cinematicDiff;
uint32 m_lastCinematicCheck;
uint32 m_activeCinematicCameraId;
uint32 m_cinematicLength;
std::vector<FlyByCamera> const* m_cinematicCamera;
Position m_remoteSightPosition;
TempSummon* m_CinematicObject;
};
#endif
+4 -59
View File
@@ -383,12 +383,7 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
_activeCheats = CHEAT_NONE;
m_cinematicDiff = 0;
m_lastCinematicCheck = 0;
m_activeCinematicCameraId = 0;
m_cinematicCamera = nullptr;
m_remoteSightPosition = Position(0.0f, 0.0f, 0.0f);
m_CinematicObject = nullptr;
_cinematicMgr = new CinematicMgr(this);
m_achievementMgr = new AchievementMgr(this);
m_reputationMgr = new ReputationMgr(this);
@@ -5574,14 +5569,14 @@ void Player::SendDirectMessage(WorldPacket const* data) const
m_session->SendPacket(data);
}
void Player::SendCinematicStart(uint32 CinematicSequenceId)
void Player::SendCinematicStart(uint32 CinematicSequenceId) const
{
WorldPacket data(SMSG_TRIGGER_CINEMATIC, 4);
data << uint32(CinematicSequenceId);
SendDirectMessage(&data);
if (const CinematicSequencesEntry* sequence = sCinematicSequencesStore.LookupEntry(CinematicSequenceId))
if (CinematicSequencesEntry const* sequence = sCinematicSequencesStore.LookupEntry(CinematicSequenceId))
{
SetActiveCinematicCamera(sequence->cinematicCamera);
_cinematicMgr->SetActiveCinematicCamera(sequence->cinematicCamera);
}
}
@@ -15498,56 +15493,6 @@ bool Player::SetFeatherFall(bool apply, bool packetOnly /*= false*/)
return true;
}
void Player::BeginCinematic()
{
// Sanity check for active camera set
if (m_activeCinematicCameraId == 0)
{
return;
}
auto itr = sFlyByCameraStore.find(m_activeCinematicCameraId);
if (itr != sFlyByCameraStore.end())
{
// Initialize diff, and set camera
m_cinematicDiff = 0;
m_cinematicCamera = &itr->second;
auto camitr = m_cinematicCamera->begin();
if (camitr != m_cinematicCamera->end())
{
Position pos(camitr->locations.x, camitr->locations.y, camitr->locations.z, camitr->locations.w);
if (!pos.IsPositionValid())
{
return;
}
m_mapRef->LoadGrid(camitr->locations.x, camitr->locations.y);
m_CinematicObject = SummonCreature(VISUAL_WAYPOINT, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 120000);
if (m_CinematicObject)
{
m_CinematicObject->setActive(true);
SetViewpoint(m_CinematicObject, true);
}
}
}
}
void Player::EndCinematic()
{
m_cinematicDiff = 0;
m_cinematicCamera = nullptr;
m_activeCinematicCameraId = 0;
if (m_CinematicObject)
{
if (m_seer && m_seer == m_CinematicObject)
{
SetViewpoint(m_CinematicObject, false);
}
m_CinematicObject->AddObjectToRemoveList();
}
}
Guild* Player::GetGuild() const
{
uint32 guildId = GetGuildId();
+7 -20
View File
@@ -21,6 +21,7 @@
#include "ArenaTeam.h"
#include "Battleground.h"
#include "CharacterCache.h"
#include "CinematicMgr.h"
#include "DBCStores.h"
#include "DatabaseEnvFwd.h"
#include "GroupReference.h"
@@ -1036,6 +1037,7 @@ struct EntryPointData
class Player : public Unit, public GridObject<Player>
{
friend class WorldSession;
friend class CinematicMgr;
friend void Item::AddToUpdateQueueOf(Player* player);
friend void Item::RemoveFromUpdateQueueOf(Player* player);
public:
@@ -1326,6 +1328,8 @@ public:
[[nodiscard]] TradeData* GetTradeData() const { return m_trade; }
void TradeCancel(bool sendback);
CinematicMgr* GetCinematicMgr() const { return _cinematicMgr; }
void UpdateEnchantTime(uint32 time);
void UpdateSoulboundTradeItems();
void AddTradeableItem(Item* item);
@@ -2368,7 +2372,7 @@ public:
[[nodiscard]] bool IsPetNeedBeTemporaryUnsummoned() const { return GetSession()->PlayerLogout() || !IsInWorld() || !IsAlive() || IsMounted()/*+in flight*/ || GetVehicle() || IsBeingTeleported(); }
bool CanResummonPet(uint32 spellid);
void SendCinematicStart(uint32 CinematicSequenceId);
void SendCinematicStart(uint32 CinematicSequenceId) const;
void SendMovieStart(uint32 MovieId);
uint32 DoRandomRoll(uint32 minimum, uint32 maximum);
@@ -2561,17 +2565,6 @@ public:
static std::unordered_map<int, bgZoneRef> bgZoneIdToFillWorldStates; // zoneId -> FillInitialWorldStates
// Cinematic camera data and remote sight functions
[[nodiscard]] uint32 GetActiveCinematicCamera() const { return m_activeCinematicCameraId; }
void SetActiveCinematicCamera(uint32 cinematicCameraId = 0) { m_activeCinematicCameraId = cinematicCameraId; }
[[nodiscard]] bool IsOnCinematic() const { return (m_cinematicCamera != nullptr); }
void BeginCinematic();
void EndCinematic();
void UpdateCinematicLocation(uint32 diff);
std::string GetMapAreaAndZoneString();
std::string GetCoordsMapAreaAndZoneString();
void SetFarSightDistance(float radius);
void ResetFarSightDistance();
[[nodiscard]] Optional<float> GetFarSightDistance() const;
@@ -2866,6 +2859,8 @@ private:
Item* _StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update);
Item* _LoadItem(CharacterDatabaseTransaction trans, uint32 zoneId, uint32 timeDiff, Field* fields);
CinematicMgr* _cinematicMgr;
typedef GuidSet RefundableItemsSet;
RefundableItemsSet m_refundableItems;
void SendRefundInfo(Item* item);
@@ -2931,14 +2926,6 @@ private:
uint32 m_flightSpellActivated;
// Remote location information
uint32 m_cinematicDiff;
uint32 m_lastCinematicCheck;
uint32 m_activeCinematicCameraId;
FlyByCameraCollection* m_cinematicCamera;
Position m_remoteSightPosition;
Creature* m_CinematicObject;
WorldLocation _corpseLocation;
Optional<float> _farSightDistance = { };
@@ -47,9 +47,6 @@
// Zone Interval should be 1 second
constexpr auto ZONE_UPDATE_INTERVAL = 1000;
constexpr auto CINEMATIC_UPDATEDIFF = 500;
constexpr auto CINEMATIC_LOOKAHEAD = 2000;
void Player::Update(uint32 p_time)
{
if (!IsInWorld())
@@ -70,12 +67,11 @@ void Player::Update(uint32 p_time)
// Update cinematic location, if 500ms have passed and we're doing a
// cinematic now.
m_cinematicDiff += p_time;
if (m_cinematicCamera && m_activeCinematicCameraId &&
GetMSTimeDiffToNow(m_lastCinematicCheck) > CINEMATIC_UPDATEDIFF)
_cinematicMgr->m_cinematicDiff += p_time;
if (_cinematicMgr->m_cinematicCamera && _cinematicMgr->m_activeCinematicCameraId && GetMSTimeDiffToNow(_cinematicMgr->m_lastCinematicCheck) > CINEMATIC_UPDATEDIFF)
{
m_lastCinematicCheck = getMSTime();
UpdateCinematicLocation(p_time);
_cinematicMgr->m_lastCinematicCheck = getMSTime();
_cinematicMgr->UpdateCinematicLocation(p_time);
}
// used to implement delayed far teleports
@@ -1508,107 +1504,6 @@ void Player::UpdatePotionCooldown(Spell* spell)
SetLastPotionId(0);
}
void Player::UpdateCinematicLocation(uint32 /*diff*/)
{
Position lastPosition;
uint32 lastTimestamp = 0;
Position nextPosition;
uint32 nextTimestamp = 0;
if (m_cinematicCamera->size() == 0)
{
return;
}
// Obtain direction of travel
for (FlyByCamera cam : *m_cinematicCamera)
{
if (cam.timeStamp > m_cinematicDiff)
{
nextPosition = Position(cam.locations.x, cam.locations.y,
cam.locations.z, cam.locations.w);
nextTimestamp = cam.timeStamp;
break;
}
lastPosition = Position(cam.locations.x, cam.locations.y,
cam.locations.z, cam.locations.w);
lastTimestamp = cam.timeStamp;
}
float angle = lastPosition.GetAngle(&nextPosition);
angle -= lastPosition.GetOrientation();
if (angle < 0)
{
angle += 2 * float(M_PI);
}
// Look for position around 2 second ahead of us.
int32 workDiff = m_cinematicDiff;
// Modify result based on camera direction (Humans for example, have the
// camera point behind)
workDiff += static_cast<int32>(float(CINEMATIC_LOOKAHEAD) * cos(angle));
// Get an iterator to the last entry in the cameras, to make sure we don't
// go beyond the end
FlyByCameraCollection::const_reverse_iterator endItr =
m_cinematicCamera->rbegin();
if (endItr != m_cinematicCamera->rend() &&
workDiff > static_cast<int32>(endItr->timeStamp))
{
workDiff = endItr->timeStamp;
}
// Never try to go back in time before the start of cinematic!
if (workDiff < 0)
{
workDiff = m_cinematicDiff;
}
// Obtain the previous and next waypoint based on timestamp
for (FlyByCamera cam : *m_cinematicCamera)
{
if (static_cast<int32>(cam.timeStamp) >= workDiff)
{
nextPosition = Position(cam.locations.x, cam.locations.y,
cam.locations.z, cam.locations.w);
nextTimestamp = cam.timeStamp;
break;
}
lastPosition = Position(cam.locations.x, cam.locations.y,
cam.locations.z, cam.locations.w);
lastTimestamp = cam.timeStamp;
}
// Never try to go beyond the end of the cinematic
if (workDiff > static_cast<int32>(nextTimestamp))
{
workDiff = static_cast<int32>(nextTimestamp);
}
// Interpolate the position for this moment in time (or the adjusted moment
// in time)
uint32 timeDiff = nextTimestamp - lastTimestamp;
uint32 interDiff = workDiff - lastTimestamp;
float xDiff = nextPosition.m_positionX - lastPosition.m_positionX;
float yDiff = nextPosition.m_positionY - lastPosition.m_positionY;
float zDiff = nextPosition.m_positionZ - lastPosition.m_positionZ;
Position interPosition(lastPosition.m_positionX +
(xDiff * (float(interDiff) / float(timeDiff))),
lastPosition.m_positionY +
(yDiff * (float(interDiff) / float(timeDiff))),
lastPosition.m_positionZ +
(zDiff * (float(interDiff) / float(timeDiff))));
// Advance (at speed) to this position. The remote sight object is used
// to send update information to player in cinematic
if (m_CinematicObject && interPosition.IsPositionValid())
{
m_CinematicObject->MonsterMoveWithSpeed(
interPosition.m_positionX, interPosition.m_positionY,
interPosition.m_positionZ, 200.0f);
}
}
template void Player::UpdateVisibilityOf(Player* target, UpdateData& data,
std::vector<Unit*>& visibleNow);
template void Player::UpdateVisibilityOf(Creature* target, UpdateData& data,
+17 -17
View File
@@ -246,7 +246,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
mGameEvent.clear();
LOG_ERROR("sql.sql", ">> Loaded 0 game events. DB table `game_event` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 game events. DB table `game_event` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -314,7 +314,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -359,7 +359,7 @@ void GameEventMgr::LoadFromDB()
QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -410,7 +410,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty");
LOG_WARN("server.loading", ">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty");
LOG_INFO("server.loading", " ");
}
else
@@ -458,7 +458,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -507,7 +507,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -566,7 +566,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -606,7 +606,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -646,7 +646,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -688,7 +688,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -729,7 +729,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -776,7 +776,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -815,7 +815,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 seasonal quests additions in game events. DB table `game_event_seasonal_questrelation` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -861,7 +861,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -926,7 +926,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 battleground holidays in game events. DB table `game_event_battleground_holiday` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 battleground holidays in game events. DB table `game_event_battleground_holiday` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -964,7 +964,7 @@ void GameEventMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 pools for game events. DB table `game_event_pool` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -1012,7 +1012,7 @@ void GameEventMgr::LoadHolidayDates()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 holiday dates. DB table `holiday_dates` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 holiday dates. DB table `holiday_dates` is empty.");
return;
}
+76 -76
View File
@@ -497,7 +497,7 @@ void ObjectMgr::LoadCreatureTemplates()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature template definitions. DB table `creature_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature template definitions. DB table `creature_template` is empty.");
return;
}
@@ -663,7 +663,7 @@ void ObjectMgr::LoadCreatureTemplateResistances()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature template resistance definitions. DB table `creature_template_resistance` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature template resistance definitions. DB table `creature_template_resistance` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -709,7 +709,7 @@ void ObjectMgr::LoadCreatureTemplateSpells()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature template spell definitions. DB table `creature_template_spell` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature template spell definitions. DB table `creature_template_spell` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -755,7 +755,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature template addon definitions. DB table `creature_template_addon` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1235,7 +1235,7 @@ void ObjectMgr::LoadCreatureAddons()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature addon definitions. DB table `creature_addon` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1336,7 +1336,7 @@ void ObjectMgr::LoadGameObjectAddons()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 gameobject addon definitions. DB table `gameobject_addon` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 gameobject addon definitions. DB table `gameobject_addon` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1446,7 +1446,7 @@ void ObjectMgr::LoadEquipmentTemplates()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 creature equipment templates. DB table `creature_equip_template` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -1535,7 +1535,7 @@ void ObjectMgr::LoadCreatureMovementOverrides()
"LEFT JOIN creature_template_movement AS ctm ON ctm.CreatureId = c.id1");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature movement overrides. DB table `creature_movement_override` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 creature movement overrides. DB table `creature_movement_override` is empty!");
return;
}
@@ -1660,7 +1660,7 @@ void ObjectMgr::LoadCreatureModelInfo()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature model definitions. DB table `creature_model_info` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1718,7 +1718,7 @@ void ObjectMgr::LoadLinkedRespawn()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 linked respawns. DB table `linked_respawn` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1949,7 +1949,7 @@ void ObjectMgr::LoadTempSummons()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 temp summons. DB table `creature_summon_groups` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 temp summons. DB table `creature_summon_groups` is empty.");
return;
}
@@ -2042,7 +2042,7 @@ void ObjectMgr::LoadCreatures()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 creatures. DB table `creature` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creatures. DB table `creature` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2367,7 +2367,7 @@ void ObjectMgr::LoadGameobjects()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 gameobjects. DB table `gameobject` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2617,7 +2617,7 @@ void ObjectMgr::LoadItemTemplates()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 item templates. DB table `item_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 item templates. DB table `item_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -3223,7 +3223,7 @@ void ObjectMgr::LoadItemSetNames()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 item set names. DB table `item_set_names` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 item set names. DB table `item_set_names` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -3295,7 +3295,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -3351,7 +3351,7 @@ void ObjectMgr::LoadVehicleAccessories()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 Vehicle Accessories in {} ms", GetMSTimeDiffToNow(oldMSTime));
LOG_WARN("server.loading", ">> Loaded 0 Vehicle Accessories in {} ms", GetMSTimeDiffToNow(oldMSTime));
LOG_INFO("server.loading", " ");
return;
}
@@ -3391,7 +3391,7 @@ void ObjectMgr::LoadPetLevelInfo()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 level pet stats definitions. DB table `pet_levelstats` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -3532,7 +3532,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
LOG_INFO("server.loading", " ");
LOG_ERROR("sql.sql", ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
exit(1);
}
else
@@ -3618,7 +3618,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 custom player create items. DB table `playercreateinfo_item` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -3689,7 +3689,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
LOG_ERROR("server.loading", ">> Loaded 0 player create skills. DB table `playercreateinfo_skills` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 player create skills. DB table `playercreateinfo_skills` is empty.");
}
else
{
@@ -3763,7 +3763,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 player create spells. DB table `playercreateinfo_spell_custom` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 player create spells. DB table `playercreateinfo_spell_custom` is empty.");
}
else
{
@@ -3821,7 +3821,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
LOG_ERROR("server.loading", ">> Loaded 0 player create cast spells. DB table `playercreateinfo_cast_spell` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 player create cast spells. DB table `playercreateinfo_cast_spell` is empty.");
}
else
{
@@ -3879,7 +3879,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 player create actions. DB table `playercreateinfo_action` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -4007,7 +4007,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 level stats definitions. DB table `player_levelstats` is empty.");
LOG_INFO("server.loading", " ");
exit(1);
}
@@ -4120,7 +4120,7 @@ void ObjectMgr::LoadPlayerInfo()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 xp for level definitions. DB table `player_xp_for_level` is empty.");
LOG_INFO("server.loading", " ");
exit(1);
}
@@ -4310,7 +4310,7 @@ void ObjectMgr::LoadQuests()
" FROM quest_template");
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -4352,7 +4352,7 @@ void ObjectMgr::LoadQuests()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 quest details. DB table `quest_details` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest details. DB table `quest_details` is empty.");
}
else
{
@@ -4375,7 +4375,7 @@ void ObjectMgr::LoadQuests()
if (!result)
{
LOG_ERROR("server.loading", ">> Loaded 0 quest request items. DB table `quest_request_items` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest request items. DB table `quest_request_items` is empty.");
}
else
{
@@ -4398,7 +4398,7 @@ void ObjectMgr::LoadQuests()
if (!result)
{
LOG_ERROR("server.loading", ">> Loaded 0 quest reward emotes. DB table `quest_offer_reward` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest reward emotes. DB table `quest_offer_reward` is empty.");
}
else
{
@@ -4423,7 +4423,7 @@ void ObjectMgr::LoadQuests()
if (!result)
{
LOG_ERROR("server.loading", ">> Loaded 0 quest template addons. DB table `quest_template_addon` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest template addons. DB table `quest_template_addon` is empty.");
}
else
{
@@ -5079,7 +5079,7 @@ void ObjectMgr::LoadScripts(ScriptsType type)
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 script definitions. DB table `{}` is empty!", tableName);
LOG_WARN("server.loading", ">> Loaded 0 script definitions. DB table `{}` is empty!", tableName);
LOG_INFO("server.loading", " ");
return;
}
@@ -5477,7 +5477,7 @@ void ObjectMgr::LoadSpellScriptNames()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 spell script names. DB table `spell_script_names` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -5606,7 +5606,7 @@ void ObjectMgr::LoadPageTexts()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 page texts. DB table `page_text` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 page texts. DB table `page_text` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -5685,7 +5685,7 @@ void ObjectMgr::LoadInstanceTemplate()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 instance templates. DB table `page_text` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 instance templates. DB table `page_text` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -5735,7 +5735,7 @@ void ObjectMgr::LoadInstanceEncounters()
QueryResult result = WorldDatabase.Query("SELECT entry, creditType, creditEntry, lastEncounterDungeon FROM instance_encounters");
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 instance encounters, table is empty!");
LOG_WARN("server.loading", ">> Loaded 0 instance encounters, table is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -5837,7 +5837,7 @@ void ObjectMgr::LoadGossipText()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 npc texts, table is empty!");
LOG_WARN("server.loading", ">> Loaded 0 npc texts, table is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -6064,7 +6064,7 @@ void ObjectMgr::LoadQuestAreaTriggers()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest trigger points. DB table `areatrigger_involvedrelation` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -6136,7 +6136,7 @@ void ObjectMgr::LoadQuestGreetings()
QueryResult result = WorldDatabase.Query("SELECT ID, Type, GreetEmoteType, GreetEmoteDelay, Greeting FROM quest_greeting");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 quest greetings. DB table `quest_greeting` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest greetings. DB table `quest_greeting` is empty.");
return;
}
@@ -6191,7 +6191,7 @@ void ObjectMgr::LoadQuestGreetingsLocales()
QueryResult result = WorldDatabase.Query("SELECT ID, Type, Locale, Greeting FROM quest_greeting_locale");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 quest_greeting locales. DB table `quest_greeting_locale` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest_greeting locales. DB table `quest_greeting_locale` is empty.");
return;
}
@@ -6306,7 +6306,7 @@ void ObjectMgr::LoadTavernAreaTriggers()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 tavern triggers. DB table `areatrigger_tavern` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -6344,7 +6344,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 areatrigger scripts. DB table `areatrigger_scripts` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -6485,7 +6485,7 @@ void ObjectMgr::LoadAreaTriggers()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 area trigger definitions. DB table `areatrigger` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 area trigger definitions. DB table `areatrigger` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -6536,7 +6536,7 @@ void ObjectMgr::LoadAreaTriggerTeleports()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 area trigger teleport definitions. DB table `areatrigger_teleport` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -6622,7 +6622,7 @@ void ObjectMgr::LoadAccessRequirements()
QueryResult access_template_result = WorldDatabase.Query("SELECT id, map_id, difficulty, min_level, max_level, min_avg_item_level FROM dungeon_access_template");
if (!access_template_result)
{
LOG_INFO("server.loading", ">> Loaded 0 access requirement definitions. DB table `dungeon_access_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 access requirement definitions. DB table `dungeon_access_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -7008,7 +7008,7 @@ void ObjectMgr::LoadGameObjectTemplate()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 gameobject definitions. DB table `gameobject_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -7188,7 +7188,7 @@ void ObjectMgr::LoadGameObjectTemplateAddons()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 gameobject template addon definitions. DB table `gameobject_template_addon` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 gameobject template addon definitions. DB table `gameobject_template_addon` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -7251,7 +7251,7 @@ void ObjectMgr::LoadExplorationBaseXP()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 BaseXP definitions. DB table `exploration_basexp` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -7291,7 +7291,7 @@ void ObjectMgr::LoadPetNames()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 pet name parts. DB table `pet_name_generation` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -7459,7 +7459,7 @@ void ObjectMgr::LoadReputationOnKill()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature award reputation definitions. DB table `creature_onkill_reputation` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -7640,7 +7640,7 @@ void ObjectMgr::LoadPointsOfInterest()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 Points of Interest definitions. DB table `points_of_interest` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -7688,7 +7688,7 @@ void ObjectMgr::LoadQuestPOI()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest POI definitions. DB table `quest_poi` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -7761,7 +7761,7 @@ void ObjectMgr::LoadNPCSpellClickSpells()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spellclick spells. DB table `npc_spellclick_spells` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -7850,7 +7850,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string const&
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 quest relations from `{}`, table is empty.", table);
LOG_WARN("server.loading", ">> Loaded 0 quest relations from `{}`, table is empty.", table);
LOG_INFO("server.loading", " ");
return;
}
@@ -7949,7 +7949,7 @@ void ObjectMgr::LoadReservedPlayersNames()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 reserved player names. DB table `reserved_name` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -8170,7 +8170,7 @@ void ObjectMgr::LoadGameObjectForQuests()
if (sObjectMgr->GetGameObjectTemplates()->empty())
{
LOG_INFO("server.loading", ">> Loaded 0 GameObjects for quests");
LOG_WARN("server.loading", ">> Loaded 0 GameObjects for quests");
LOG_INFO("server.loading", " ");
return;
}
@@ -8245,7 +8245,7 @@ bool ObjectMgr::LoadAcoreStrings()
QueryResult result = WorldDatabase.Query("SELECT entry, content_default, locale_koKR, locale_frFR, locale_deDE, locale_zhCN, locale_zhTW, locale_esES, locale_esMX, locale_ruRU FROM acore_string");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 acore strings. DB table `acore_strings` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 acore strings. DB table `acore_strings` is empty.");
LOG_INFO("server.loading", " ");
return false;
}
@@ -8295,7 +8295,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 areas for fishing base skill level. DB table `skill_fishing_base_level` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -8436,7 +8436,7 @@ void ObjectMgr::LoadGameTele()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 GameTeleports. DB table `game_tele` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -8576,7 +8576,7 @@ void ObjectMgr::LoadMailLevelRewards()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 level dependent mail rewards. DB table `mail_level_reward` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -8723,7 +8723,7 @@ void ObjectMgr::LoadTrainerSpell()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 Trainers. DB table `npc_trainer` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -8805,7 +8805,7 @@ void ObjectMgr::LoadVendors()
if (!result)
{
LOG_INFO("server.loading", " ");
LOG_ERROR("sql.sql", ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 Vendors. DB table `npc_vendor` is empty!");
return;
}
@@ -8851,7 +8851,7 @@ void ObjectMgr::LoadGossipMenu()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 gossip_menu entries. DB table `gossip_menu` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -8891,7 +8891,7 @@ void ObjectMgr::LoadGossipMenuItems()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 gossip_menu_option IDs. DB table `gossip_menu_option` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 gossip_menu_option IDs. DB table `gossip_menu_option` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -9157,7 +9157,7 @@ void ObjectMgr::LoadBroadcastTexts()
QueryResult result = WorldDatabase.Query("SELECT ID, LanguageID, MaleText, FemaleText, EmoteID1, EmoteID2, EmoteID3, EmoteDelay1, EmoteDelay2, EmoteDelay3, SoundEntriesID, EmotesID, Flags FROM broadcast_text");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 broadcast texts. DB table `broadcast_text` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 broadcast texts. DB table `broadcast_text` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -9241,7 +9241,7 @@ void ObjectMgr::LoadBroadcastTextLocales()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 broadcast text locales. DB table `broadcast_text_locale` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 broadcast text locales. DB table `broadcast_text_locale` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -9307,7 +9307,7 @@ void ObjectMgr::LoadCreatureClassLevelStats()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature base stats. DB table `creature_classlevelstats` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -9390,7 +9390,7 @@ void ObjectMgr::LoadFactionChangeAchievements()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 faction change achievement pairs. DB table `player_factionchange_achievement` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -9426,7 +9426,7 @@ void ObjectMgr::LoadFactionChangeItems()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 faction change item pairs. DB table `player_factionchange_items` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -9462,7 +9462,7 @@ void ObjectMgr::LoadFactionChangeQuests()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 faction change quest pairs. DB table `player_factionchange_quests` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 faction change quest pairs. DB table `player_factionchange_quests` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -9498,7 +9498,7 @@ void ObjectMgr::LoadFactionChangeReputations()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 faction change reputation pairs. DB table `player_factionchange_reputations` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -9534,7 +9534,7 @@ void ObjectMgr::LoadFactionChangeSpells()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 faction change spell pairs. DB table `player_factionchange_spells` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -9570,7 +9570,7 @@ void ObjectMgr::LoadFactionChangeTitles()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 faction change title pairs. DB table `player_factionchange_title` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 faction change title pairs. DB table `player_factionchange_title` is empty.");
return;
}
@@ -9664,7 +9664,7 @@ void ObjectMgr::LoadGameObjectQuestItems()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 gameobject quest items. DB table `gameobject_questitem` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 gameobject quest items. DB table `gameobject_questitem` is empty.");
return;
}
@@ -9694,7 +9694,7 @@ void ObjectMgr::LoadCreatureQuestItems()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creature quest items. DB table `creature_questitem` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creature quest items. DB table `creature_questitem` is empty.");
return;
}
@@ -9725,7 +9725,7 @@ void ObjectMgr::LoadQuestMoneyRewards()
QueryResult result = WorldDatabase.Query("SELECT `Level`, Money0, Money1, Money2, Money3, Money4, Money5, Money6, Money7, Money8, Money9 FROM `quest_money_reward` ORDER BY `Level`");
if (!result)
{
LOG_ERROR("server.loading", ">> Loaded 0 quest money rewards. DB table `quest_money_reward` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 quest money rewards. DB table `quest_money_reward` is empty.");
return;
}
+2 -2
View File
@@ -121,7 +121,7 @@ void GroupMgr::LoadGroups()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 group definitions. DB table `groups` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 group definitions. DB table `groups` is empty!");
LOG_INFO("server.loading", " ");
}
else
@@ -161,7 +161,7 @@ void GroupMgr::LoadGroups()
QueryResult result = CharacterDatabase.Query("SELECT guid, memberGuid, memberFlags, subgroup, roles FROM group_member ORDER BY guid");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 group members. DB table `group_member` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 group members. DB table `group_member` is empty!");
LOG_INFO("server.loading", " ");
}
else
+8 -8
View File
@@ -106,7 +106,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 guild definitions. DB table `guild` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 guild definitions. DB table `guild` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -146,7 +146,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 guild ranks. DB table `guild_rank` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -187,7 +187,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 guild members. DB table `guild_member` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 guild members. DB table `guild_member` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -223,7 +223,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 guild bank tab rights. DB table `guild_bank_right` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -257,7 +257,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 guild event logs. DB table `guild_eventlog` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -292,7 +292,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 guild bank event logs. DB table `guild_bank_eventlog` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -327,7 +327,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -364,7 +364,7 @@ void GuildMgr::LoadGuilds()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 guild bank tab items. DB table `guild_bank_item` or `item_instance` is empty.");
LOG_INFO("server.loading", " ");
}
else
+5 -7
View File
@@ -16,6 +16,7 @@
*/
#include "CreatureAI.h"
#include "CombatPackets.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "ObjectDefines.h"
@@ -70,18 +71,15 @@ void WorldSession::HandleAttackStopOpcode(WorldPacket& /*recvData*/)
GetPlayer()->AttackStop();
}
void WorldSession::HandleSetSheathedOpcode(WorldPacket& recvData)
void WorldSession::HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& packet)
{
uint32 sheathed;
recvData >> sheathed;
if (sheathed >= MAX_SHEATH_STATE)
if (packet.CurrentSheathState >= MAX_SHEATH_STATE)
{
LOG_ERROR("network.opcode", "Unknown sheath state {} ??", sheathed);
LOG_ERROR("network.opcode", "Unknown sheath state {} ??", packet.CurrentSheathState);
return;
}
GetPlayer()->SetSheath(SheathState(sheathed));
_player->SetSheath(SheathState(packet.CurrentSheathState));
}
void WorldSession::SendAttackStop(Unit const* enemy)
+2 -2
View File
@@ -958,7 +958,7 @@ void WorldSession::HandleCompleteCinematic(WorldPacket& /*recv_data*/)
LOG_DEBUG("network", "WORLD: Received CMSG_COMPLETE_CINEMATIC");
}
// If player has sight bound to visual waypoint NPC we should remove it
GetPlayer()->EndCinematic();
GetPlayer()->GetCinematicMgr()->EndCinematic();
}
void WorldSession::HandleNextCinematicCamera(WorldPacket& /*recv_data*/)
@@ -967,7 +967,7 @@ void WorldSession::HandleNextCinematicCamera(WorldPacket& /*recv_data*/)
LOG_DEBUG("network", "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA");
}
// Sent by client when cinematic actually begun. So we begin the server side process
GetPlayer()->BeginCinematic();
GetPlayer()->GetCinematicMgr()->BeginCinematic();
}
void WorldSession::HandleFeatherFallAck(WorldPacket& recv_data)
+1 -1
View File
@@ -43,7 +43,7 @@ void LootItemStorage::LoadStorageFromDB()
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 stored items!");
LOG_WARN("server.loading", ">> Loaded 0 stored items!");
LOG_INFO("server.loading", " ");
return;
}
+12 -12
View File
@@ -1923,7 +1923,7 @@ void LoadLootTemplates_Creature()
if (count)
LOG_INFO("server.loading", ">> Loaded {} creature loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 creature loot templates. DB table `creature_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -1958,7 +1958,7 @@ void LoadLootTemplates_Disenchant()
if (count)
LOG_INFO("server.loading", ">> Loaded {} disenchanting loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 disenchanting loot templates. DB table `disenchant_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -1983,7 +1983,7 @@ void LoadLootTemplates_Fishing()
if (count)
LOG_INFO("server.loading", ">> Loaded {} fishing loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 fishing loot templates. DB table `fishing_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2019,7 +2019,7 @@ void LoadLootTemplates_Gameobject()
if (count)
LOG_INFO("server.loading", ">> Loaded {} gameobject loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 gameobject loot templates. DB table `gameobject_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2045,7 +2045,7 @@ void LoadLootTemplates_Item()
if (count)
LOG_INFO("server.loading", ">> Loaded {} item loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 item loot templates. DB table `item_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2076,7 +2076,7 @@ void LoadLootTemplates_Milling()
if (count)
LOG_INFO("server.loading", ">> Loaded {} milling loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 milling loot templates. DB table `milling_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2112,7 +2112,7 @@ void LoadLootTemplates_Pickpocketing()
if (count)
LOG_INFO("server.loading", ">> Loaded {} pickpocketing loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 pickpocketing loot templates. DB table `pickpocketing_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2143,7 +2143,7 @@ void LoadLootTemplates_Prospecting()
if (count)
LOG_INFO("server.loading", ">> Loaded {} prospecting loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 prospecting loot templates. DB table `prospecting_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2169,7 +2169,7 @@ void LoadLootTemplates_Mail()
if (count)
LOG_INFO("server.loading", ">> Loaded {} mail loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 mail loot templates. DB table `mail_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2205,7 +2205,7 @@ void LoadLootTemplates_Skinning()
if (count)
LOG_INFO("server.loading", ">> Loaded {} skinning loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 skinning loot templates. DB table `skinning_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2249,7 +2249,7 @@ void LoadLootTemplates_Spell()
if (count)
LOG_INFO("server.loading", ">> Loaded {} spell loot templates in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
else
LOG_ERROR("sql.sql", ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 spell loot templates. DB table `spell_loot_template` is empty");
LOG_INFO("server.loading", " ");
}
@@ -2268,7 +2268,7 @@ void LoadLootTemplates_Player()
}
else
{
LOG_ERROR("sql.sql", ">> Loaded 0 player loot templates. DB table `player_loot_template` is empty");
LOG_WARN("server.loading", ">> Loaded 0 player loot templates. DB table `player_loot_template` is empty");
}
LOG_INFO("server.loading", " ");
+1 -1
View File
@@ -55,7 +55,7 @@ void TransportMgr::LoadTransportTemplates()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 transport templates. DB table `gameobject_template` has no transports!");
LOG_WARN("server.loading", ">> Loaded 0 transport templates. DB table `gameobject_template` has no transports!");
return;
}
+2 -2
View File
@@ -36,7 +36,7 @@ void Graveyard::LoadGraveyardFromDB()
QueryResult result = WorldDatabase.Query("SELECT ID, Map, x, y, z, Comment FROM game_graveyard");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 graveyard. Table `game_graveyard` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 graveyard. Table `game_graveyard` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -362,7 +362,7 @@ void Graveyard::LoadGraveyardZones()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 graveyard-zone links. DB table `graveyard_zone` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 graveyard-zone links. DB table `graveyard_zone` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -52,7 +52,7 @@ void WaypointMgr::Load()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 waypoints. DB table `waypoint_data` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 waypoints. DB table `waypoint_data` is empty!");
LOG_INFO("server.loading", " ");
return;
}
+1 -1
View File
@@ -52,7 +52,7 @@ void OutdoorPvPMgr::InitOutdoorPvP()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 outdoor PvP definitions. DB table `outdoorpvp_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
+2 -2
View File
@@ -45,7 +45,7 @@ void PetitionMgr::LoadPetitions()
QueryResult result = CharacterDatabase.Query("SELECT ownerguid, petitionguid, name, type FROM petition");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 Petitions!");
LOG_WARN("server.loading", ">> Loaded 0 Petitions!");
LOG_INFO("server.loading", " ");
return;
}
@@ -70,7 +70,7 @@ void PetitionMgr::LoadSignatures()
QueryResult result = CharacterDatabase.Query("SELECT petitionguid, playerguid, player_account FROM petition_sign");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 Petition signs!");
LOG_WARN("server.loading", ">> Loaded 0 Petition signs!");
LOG_INFO("server.loading", " ");
return;
}
+5 -5
View File
@@ -581,7 +581,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
mPoolTemplate.clear();
LOG_INFO("server.loading", ">> Loaded 0 object pools. DB table `pool_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 object pools. DB table `pool_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -614,7 +614,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 creatures in pools. DB table `pool_creature` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -672,7 +672,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty.");
LOG_INFO("server.loading", " ");
}
else
@@ -742,7 +742,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 pools in pools");
LOG_WARN("server.loading", ">> Loaded 0 pools in pools");
LOG_INFO("server.loading", " ");
}
else
@@ -832,7 +832,7 @@ void PoolMgr::LoadFromDB()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 quests in pools");
LOG_WARN("server.loading", ">> Loaded 0 quests in pools");
LOG_INFO("server.loading", " ");
}
else
+1 -1
View File
@@ -48,7 +48,7 @@ void SystemMgr::LoadScriptWaypoints()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -24,6 +24,7 @@
#include "ChatPackets.h"
#include "PetPackets.h"
#include "CombatLogPackets.h"
#include "CombatPackets.h"
#include "GuildPackets.h"
#include "MiscPackets.h"
#include "TotemPackets.h"
@@ -0,0 +1,23 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CombatPackets.h"
void WorldPackets::Combat::SetSheathed::Read()
{
_worldPacket >> CurrentSheathState;
}
@@ -0,0 +1,40 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CombatPackets_h__
#define CombatPackets_h__
#include "Packet.h"
#include "ObjectGuid.h"
namespace WorldPackets
{
namespace Combat
{
class SetSheathed final : public ClientPacket
{
public:
SetSheathed(WorldPacket&& packet) : ClientPacket(CMSG_SET_SHEATHED, std::move(packet)) { }
void Read() override;
uint32 CurrentSheathState = 0;
};
}
}
#endif // CombatPackets_h__
+1 -1
View File
@@ -608,7 +608,7 @@ void OpcodeTable::Initialize()
/*0x1DD*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER);
/*0x1DE*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER);
/*0x1DF*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_GAMEOBJECT_PAGETEXT, STATUS_NEVER);
/*0x1E0*/ DEFINE_HANDLER(CMSG_SETSHEATHED, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleSetSheathedOpcode );
/*0x1E0*/ DEFINE_HANDLER(CMSG_SET_SHEATHED, STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleSetSheathedOpcode );
/*0x1E1*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_NEVER);
/*0x1E2*/ DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_NEVER);
/*0x1E3*/ DEFINE_HANDLER(CMSG_QUEST_POI_QUERY, STATUS_LOGGEDIN, PROCESS_INPLACE, &WorldSession::HandleQuestPOIQuery );
+1 -1
View File
@@ -507,7 +507,7 @@ enum Opcodes : uint16
SMSG_PONG = 0x1DD,
SMSG_CLEAR_COOLDOWN = 0x1DE,
SMSG_GAMEOBJECT_PAGETEXT = 0x1DF,
CMSG_SETSHEATHED = 0x1E0,
CMSG_SET_SHEATHED = 0x1E0,
SMSG_COOLDOWN_CHEAT = 0x1E1,
SMSG_SPELL_DELAYED = 0x1E2,
CMSG_QUEST_POI_QUERY = 0x1E3,
+1 -1
View File
@@ -1363,7 +1363,7 @@ uint32 WorldSession::DosProtection::GetMaxPacketCounterAllowed(uint16 opcode) co
case CMSG_CORPSE_MAP_POSITION_QUERY: // 0 1
case CMSG_MOVE_TIME_SKIPPED: // 0 1
case MSG_QUERY_NEXT_MAIL_TIME: // 0 1
case CMSG_SETSHEATHED: // 0 1
case CMSG_SET_SHEATHED: // 0 1
case MSG_RAID_TARGET_UPDATE: // 0 1
case CMSG_PLAYER_LOGOUT: // 0 1
case CMSG_LOGOUT_REQUEST: // 0 1
+6 -1
View File
@@ -104,6 +104,11 @@ namespace WorldPackets
class BuyBankSlot;
}
namespace Combat
{
class SetSheathed;
}
namespace Guild
{
class QueryGuildInfo;
@@ -794,7 +799,7 @@ public: // opcodes handlers
void HandleAttackSwingOpcode(WorldPacket& recvPacket);
void HandleAttackStopOpcode(WorldPacket& recvPacket);
void HandleSetSheathedOpcode(WorldPacket& recvPacket);
void HandleSetSheathedOpcode(WorldPackets::Combat::SetSheathed& packet);
void HandleUseItemOpcode(WorldPacket& recvPacket);
void HandleOpenItemOpcode(WorldPacket& recvPacket);
+1 -1
View File
@@ -54,7 +54,7 @@ void LoadSkillDiscoveryTable()
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
+2 -2
View File
@@ -60,7 +60,7 @@ void LoadSkillPerfectItemTable()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell perfection definitions. DB table `skill_perfect_item_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell perfection definitions. DB table `skill_perfect_item_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -146,7 +146,7 @@ void LoadSkillExtraItemTable()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell specialization definitions. DB table `skill_extra_item_template` is empty.");
LOG_INFO("server.loading", " ");
return;
}
+15 -15
View File
@@ -1300,7 +1300,7 @@ void SpellMgr::LoadSpellRanks()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1411,7 +1411,7 @@ void SpellMgr::LoadSpellRequired()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell required records. DB table `spell_required` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell required records. DB table `spell_required` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1528,7 +1528,7 @@ void SpellMgr::LoadSpellTargetPositions()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell target coordinates. DB table `spell_target_position` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1632,7 +1632,7 @@ void SpellMgr::LoadSpellGroups()
QueryResult result = WorldDatabase.Query("SELECT id, spell_id, special_flag FROM spell_group");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1692,7 +1692,7 @@ void SpellMgr::LoadSpellGroupStackRules()
QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1743,7 +1743,7 @@ void SpellMgr::LoadSpellProcEvents()
QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, procPhase, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
return;
}
@@ -1837,7 +1837,7 @@ void SpellMgr::LoadSpellProcs()
QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -1975,7 +1975,7 @@ void SpellMgr::LoadSpellBonusess()
QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2016,7 +2016,7 @@ void SpellMgr::LoadSpellThreats()
QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2057,7 +2057,7 @@ void SpellMgr::LoadSpellMixology()
QueryResult result = WorldDatabase.Query("SELECT entry, pctMod FROM spell_mixology");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 mixology bonuses. DB table `spell_mixology` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 mixology bonuses. DB table `spell_mixology` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2115,7 +2115,7 @@ void SpellMgr::LoadSpellPetAuras()
QueryResult result = WorldDatabase.Query("SELECT spell, effectId, pet, aura FROM spell_pet_auras");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell pet auras. DB table `spell_pet_auras` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2219,7 +2219,7 @@ void SpellMgr::LoadSpellEnchantProcData()
QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2263,7 +2263,7 @@ void SpellMgr::LoadSpellLinked()
QueryResult result = WorldDatabase.Query("SELECT spell_trigger, spell_effect, type FROM spell_linked_spell");
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 linked spells. DB table `spell_linked_spell` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2505,7 +2505,7 @@ void SpellMgr::LoadSpellAreas()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell area requirements. DB table `spell_area` is empty.");
LOG_INFO("server.loading", " ");
return;
}
@@ -2776,7 +2776,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 spell custom attributes from DB. DB table `spell_custom_attr` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 spell custom attributes from DB. DB table `spell_custom_attr` is empty.");
}
else
{
+1 -1
View File
@@ -91,7 +91,7 @@ void CreatureTextMgr::LoadCreatureTexts()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_texts` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 ceature texts. DB table `creature_texts` is empty.");
LOG_INFO("server.loading", " ");
return;
}
+1 -1
View File
@@ -313,7 +313,7 @@ void TicketMgr::LoadTickets()
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 GM tickets. DB table `gm_ticket` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 GM tickets. DB table `gm_ticket` is empty!");
return;
}
+2 -2
View File
@@ -50,7 +50,7 @@ void WardenCheckMgr::LoadWardenChecks()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 Warden checks. DB table `warden_checks` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 Warden checks. DB table `warden_checks` is empty!");
LOG_INFO("server.loading", " ");
return;
}
@@ -176,7 +176,7 @@ void WardenCheckMgr::LoadWardenOverrides()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 Warden action overrides. DB table `warden_action` is empty!");
LOG_INFO("server.loading", " ");
return;
}
+1 -1
View File
@@ -96,7 +96,7 @@ namespace WeatherMgr
if (!result)
{
LOG_ERROR("sql.sql", ">> Loaded 0 weather definitions. DB table `game_weather` is empty.");
LOG_WARN("server.loading", ">> Loaded 0 weather definitions. DB table `game_weather` is empty.");
LOG_INFO("server.loading", " ");
return;
}
+6 -2
View File
@@ -62,6 +62,7 @@
#include "MMapFactory.h"
#include "MapMgr.h"
#include "Metric.h"
#include "M2Stores.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "OutdoorPvPMgr.h"
@@ -1530,6 +1531,9 @@ void World::SetInitialWorldSettings()
LoadDBCStores(m_dataPath);
DetectDBCLang();
// Load cinematic cameras
LoadM2Cameras(m_dataPath);
// Load IP Location Database
sIPLocation->Load();
@@ -2196,7 +2200,7 @@ void World::LoadAutobroadcasts()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty for this realm!");
LOG_WARN("server.loading", ">> Loaded 0 autobroadcasts definitions. DB table `autobroadcast` is empty for this realm!");
return;
}
@@ -3319,7 +3323,7 @@ void World::LoadWorldStates()
if (!result)
{
LOG_INFO("server.loading", ">> Loaded 0 world states. DB table `worldstates` is empty!");
LOG_WARN("server.loading", ">> Loaded 0 world states. DB table `worldstates` is empty!");
LOG_INFO("server.loading", " ");
return;
}
+11 -13
View File
@@ -33,6 +33,7 @@
#include "Language.h"
#include "Log.h"
#include "MapMgr.h"
#include "M2Stores.h"
#include "ObjectMgr.h"
#include "PoolMgr.h"
#include "ScriptMgr.h"
@@ -115,7 +116,8 @@ public:
// cinematicId - ID from CinematicSequences.dbc
static bool HandleDebugPlayCinematicCommand(ChatHandler* handler, uint32 cinematicId)
{
if (!sCinematicSequencesStore.LookupEntry(cinematicId))
CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId);
if (!cineSeq)
{
handler->PSendSysMessage(LANG_CINEMATIC_NOT_EXIST, cinematicId);
handler->SetSentErrorMessage(true);
@@ -123,23 +125,19 @@ public:
}
// Dump camera locations
if (CinematicSequencesEntry const* cineSeq = sCinematicSequencesStore.LookupEntry(cinematicId))
if (std::vector<FlyByCamera> const* flyByCameras = GetFlyByCameras(cineSeq->cinematicCamera))
{
auto const& itr = sFlyByCameraStore.find(cineSeq->cinematicCamera);
if (itr != sFlyByCameraStore.end())
handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera);
uint32 count = 1;
for (FlyByCamera const& cam : *flyByCameras)
{
handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera);
uint32 count = 1;
for (FlyByCamera cam : itr->second)
{
handler->PSendSysMessage("%02u - %7ums [%f, %f, %f] Facing %f (%f degrees)", count, cam.timeStamp, cam.locations.x, cam.locations.y, cam.locations.z, cam.locations.w, cam.locations.w * (180 / M_PI));
count++;
}
handler->PSendSysMessage("%lu waypoints dumped", itr->second.size());
handler->PSendSysMessage("%02u - %7ums [%s (%f degrees)]", count, cam.timeStamp, cam.locations.ToString().c_str(), cam.locations.GetOrientation() * (180 / M_PI));
++count;
}
handler->PSendSysMessage("%u waypoints dumped", flyByCameras->size());
}
handler->GetSession()->GetPlayer()->SendCinematicStart(cinematicId);
handler->GetPlayer()->SendCinematicStart(cinematicId);
return true;
}
@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "BattlegroundAV.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
@@ -59,11 +58,6 @@ enum Events
EVENT_CHECK_RESET = 6
};
enum Factions
{
FACTION_AV_ALLIANCE = 1534
};
struct SpellPair
{
uint32 npcEntry;
@@ -110,46 +104,6 @@ public:
Reset();
}
void AttackStart(Unit* victim) override
{
ScriptedAI::AttackStart(victim);
// Boss should attack as well
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
{
if (Battleground* bg = bgMap->GetBG())
{
if (Creature* mainBoss = bg->GetBGCreature((me->GetFaction() == FACTION_AV_ALLIANCE ? AV_CPLACE_A_BOSS : AV_CPLACE_H_BOSS)))
{
if (mainBoss->IsAIEnabled && !mainBoss->IsInCombat())
{
mainBoss->AI()->AttackStart(victim);
}
}
}
}
}
void EnterEvadeMode() override
{
ScriptedAI::EnterEvadeMode();
// Evade boss
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
{
if (Battleground* bg = bgMap->GetBG())
{
if (Creature* mainBoss = bg->GetBGCreature((me->GetFaction() == FACTION_AV_ALLIANCE ? AV_CPLACE_A_BOSS : AV_CPLACE_H_BOSS)))
{
if (mainBoss->IsAIEnabled && !mainBoss->IsInEvadeMode())
{
mainBoss->AI()->EnterEvadeMode();
}
}
}
}
}
void UpdateAI(uint32 diff) override
{
// I have a feeling this isn't blizzlike, but owell, I'm only passing by and cleaning up.
@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "BattlegroundAV.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
@@ -65,7 +64,7 @@ public:
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS); //20 to 30 seconds
}
void EnterCombat(Unit* /*victim*/) override
void EnterCombat(Unit* /*who*/) override
{
Talk(YELL_AGGRO);
}
@@ -76,52 +75,6 @@ public:
Talk(YELL_RESPAWN);
}
void AttackStart(Unit* victim) override
{
ScriptedAI::AttackStart(victim);
// Mini bosses should attack as well
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
{
if (Battleground* bg = bgMap->GetBG())
{
for (uint8 i = AV_CPLACE_H_MARSHAL_ICE; i <= AV_CPLACE_H_MARSHAL_WTOWER; ++i)
{
if (Creature* marshall = bg->GetBGCreature(i))
{
if (marshall->IsAIEnabled && !marshall->IsInCombat())
{
marshall->AI()->AttackStart(victim);
}
}
}
}
}
}
void EnterEvadeMode() override
{
ScriptedAI::EnterEvadeMode();
// Evade mini bosses
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
{
if (Battleground* bg = bgMap->GetBG())
{
for (uint8 i = AV_CPLACE_H_MARSHAL_ICE; i <= AV_CPLACE_H_MARSHAL_WTOWER; ++i)
{
if (Creature* marshall = bg->GetBGCreature(i))
{
if (marshall->IsAIEnabled && !marshall->IsInEvadeMode())
{
marshall->AI()->EnterEvadeMode();
}
}
}
}
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "BattlegroundAV.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
@@ -60,57 +59,11 @@ public:
YellTimer = urand(20 * IN_MILLISECONDS, 30 * IN_MILLISECONDS);
}
void EnterCombat(Unit* /*victim*/) override
void EnterCombat(Unit* /*who*/) override
{
Talk(YELL_AGGRO);
}
void AttackStart(Unit* victim) override
{
ScriptedAI::AttackStart(victim);
// Mini bosses should attack as well
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
{
if (Battleground* bg = bgMap->GetBG())
{
for (uint8 i = AV_CPLACE_A_MARSHAL_SOUTH; i <= AV_CPLACE_A_MARSHAL_STONE; ++i)
{
if (Creature* marshall = bg->GetBGCreature(i))
{
if (marshall->IsAIEnabled && !marshall->IsInCombat())
{
marshall->AI()->AttackStart(victim);
}
}
}
}
}
}
void EnterEvadeMode() override
{
ScriptedAI::EnterEvadeMode();
// Evade mini bosses
if (BattlegroundMap* bgMap = me->GetMap()->ToBattlegroundMap())
{
if (Battleground* bg = bgMap->GetBG())
{
for (uint8 i = AV_CPLACE_A_MARSHAL_SOUTH; i <= AV_CPLACE_A_MARSHAL_STONE; ++i)
{
if (Creature* marshall = bg->GetBGCreature(i))
{
if (marshall->IsAIEnabled && !marshall->IsInEvadeMode())
{
marshall->AI()->EnterEvadeMode();
}
}
}
}
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
@@ -20,7 +20,7 @@
#include "CreatureAIImpl.h"
uint32 const EncounterCount = 8;
constexpr uint32 EncounterCount = 8;
#define BWLScriptName "instance_blackwing_lair"
#define DataHeader "BWL"
@@ -59,7 +59,22 @@ enum BWLCreatureIds
NPC_FLAMEGOR = 11981,
NPC_CHROMAGGUS = 14020,
NPC_VICTOR_NEFARIUS = 10162,
NPC_NEFARIAN = 11583
NPC_NEFARIAN = 11583,
// Nefarian fight
NPC_BLACK_SPAWNER = 14307,
NPC_RED_SPAWNER = 14309,
NPC_GREEN_SPAWNER = 14310,
NPC_BRONZE_SPAWNER = 14311,
NPC_BLUE_SPAWNER = 14312,
NPC_BRONZE_DRAKONID = 14263,
NPC_BLUE_DRAKONID = 14261,
NPC_RED_DRAKONID = 14264,
NPC_GREEN_DRAKONID = 14262,
NPC_BLACK_DRAKONID = 14265,
NPC_CHROMATIC_DRAKONID = 14302,
NPC_BONE_CONSTRUCT = 14605
};
enum BWLGameObjectIds
@@ -90,7 +105,12 @@ enum BWLMisc
DATA_EGG_EVENT = 2,
TALK_EGG_BROKEN_RAND = 3,
SAY_NEFARIAN_VAEL_INTRO = 14
SAY_NEFARIAN_VAEL_INTRO = 14,
// Nefarian fight
DATA_NEFARIAN_LEFT_TUNNEL = 15,
DATA_NEFARIAN_RIGHT_TUNNEL = 16,
ACTION_NEFARIUS_ADD_KILLED = 2
};
template <class AI, class T>
@@ -30,7 +30,8 @@
enum Events
{
// Victor Nefarius
EVENT_SPAWN_ADD = 1,
EVENT_SPAWN_ADDS = 1,
EVENT_CHECK_PHASE_2,
EVENT_START_EVENT,
EVENT_SHADOW_BOLT,
EVENT_FEAR,
@@ -52,7 +53,9 @@ enum Events
EVENT_SUCCESS_2,
EVENT_SUCCESS_3,
ACTION_RESET = 0
ACTION_RESET = 0,
ACTION_KILLED = 1,
ACTION_ADD_KILLED = 2
};
enum Says
@@ -105,13 +108,6 @@ enum GameObjects
enum Creatures
{
NPC_BRONZE_DRAKANOID = 14263,
NPC_BLUE_DRAKANOID = 14261,
NPC_RED_DRAKANOID = 14264,
NPC_GREEN_DRAKANOID = 14262,
NPC_BLACK_DRAKANOID = 14265,
NPC_CHROMATIC_DRAKANOID = 14302,
NPC_BONE_CONSTRUCT = 14605,
NPC_TOTEM_C_FIRE_NOVA = 14662,
NPC_TOTEM_C_STONESKIN = 14663,
NPC_TOTEM_C_HEALING = 14664,
@@ -136,6 +132,14 @@ enum Spells
SPELL_NEFARIANS_BARRIER = 22663,
// Drakonid Spawner
SPELL_SPAWN_BLACK_DRAKONID = 22654,
SPELL_SPAWN_RED_DRAKONID = 22655,
SPELL_SPAWN_GREEN_DRAKONID = 22656,
SPELL_SPAWN_BRONZE_DRAKONID = 22657,
SPELL_SPAWN_BLUE_DRAKONID = 22658,
SPELL_SPAWN_CHROMATIC_DRAKONID = 22680,
// Nefarian
SPELL_SHADOWFLAME_INITIAL = 22992,
SPELL_SHADOWFLAME = 22539,
@@ -167,15 +171,27 @@ enum Spells
SPELL_CORRUPTED_WINDFURY_TOTEM = 23423
};
Position const DrakeSpawnLoc[2] = // drakonid
enum Misc
{
{-7591.151855f, -1204.051880f, 476.800476f, 3.0f},
{-7514.598633f, -1150.448853f, 476.796570f, 3.0f}
MAX_DRAKONID_KILLED = 42
};
Position const spawnerPositions[2] = // drakonid
{
{-7599.32f, -1191.72f, 475.545f, 3.05f},
{-7526.27f, -1135.04f, 473.445f, 5.76f}
};
Position const NefarianSpawn = { -7348.849f, -1495.134f, 552.5152f, 1.798f };
uint32 const Entry[5] = {NPC_BRONZE_DRAKANOID, NPC_BLUE_DRAKANOID, NPC_RED_DRAKANOID, NPC_GREEN_DRAKANOID, NPC_BLACK_DRAKANOID};
std::unordered_map<uint32, uint32> spawnerSpells =
{
{ NPC_BLACK_SPAWNER, SPELL_SPAWN_BLACK_DRAKONID },
{ NPC_BLUE_SPAWNER, SPELL_SPAWN_BLUE_DRAKONID },
{ NPC_BRONZE_SPAWNER, SPELL_SPAWN_BRONZE_DRAKONID },
{ NPC_GREEN_SPAWNER, SPELL_SPAWN_GREEN_DRAKONID },
{ NPC_RED_SPAWNER, SPELL_SPAWN_RED_DRAKONID }
};
class boss_victor_nefarius : public CreatureScript
{
@@ -187,6 +203,25 @@ public:
boss_victor_nefariusAI(Creature* creature) : BossAI(creature, DATA_NEFARIAN)
{
Initialize();
_nefarianLeftTunnel = instance->GetData(DATA_NEFARIAN_LEFT_TUNNEL);
_nefarianRightTunnel = instance->GetData(DATA_NEFARIAN_RIGHT_TUNNEL);
if (!_nefarianLeftTunnel || !_nefarianRightTunnel)
{
// Victor Nefarius weekly mechanic drakonid spawn
// Pick 2 drakonids and keep them for the whole save duration (the drakonids can't be repeated).
std::vector<uint32> nefarianDrakonidSpawners = { NPC_BLACK_SPAWNER, NPC_BLUE_SPAWNER, NPC_BRONZE_SPAWNER, NPC_GREEN_SPAWNER, NPC_RED_SPAWNER };
_nefarianRightTunnel = Acore::Containers::SelectRandomContainerElement(nefarianDrakonidSpawners);
// delete the previous picked one so we don't get any repeated.
nefarianDrakonidSpawners.erase(std::remove(nefarianDrakonidSpawners.begin(), nefarianDrakonidSpawners.end(), _nefarianRightTunnel), nefarianDrakonidSpawners.end());
// Pick another one
_nefarianLeftTunnel = Acore::Containers::SelectRandomContainerElement(nefarianDrakonidSpawners);
// save it to instance
instance->SetData(DATA_NEFARIAN_LEFT_TUNNEL, _nefarianLeftTunnel);
instance->SetData(DATA_NEFARIAN_RIGHT_TUNNEL, _nefarianRightTunnel);
}
}
void Initialize()
@@ -200,8 +235,18 @@ public:
if (me->GetMapId() == 469)
{
if (!me->FindNearestCreature(NPC_NEFARIAN, 1000.0f, true))
if (Creature* nefarian = me->FindNearestCreature(NPC_NEFARIAN, 1000.0f, true))
{
// Nefarian is spawned and he didn't finish his intro path yet, despawn it manually.
if (nefarian->GetMotionMaster()->GetCurrentMovementGeneratorType() == MovementGeneratorType::WAYPOINT_MOTION_TYPE)
{
nefarian->DespawnOrUnsummon();
}
}
else
{
_Reset();
}
me->SetVisible(true);
me->SetPhaseMask(1, true);
@@ -225,6 +270,22 @@ public:
me->RemoveAura(SPELL_ROOT_SELF);
summons.DespawnAll();
}
if (action == ACTION_ADD_KILLED)
{
KilledAdds++;
}
if (action == ACTION_KILLED)
{
Unit::Kill(me, me);
}
}
void JustDied(Unit* /*killer*/) override
{
instance->SetBossState(DATA_NEFARIAN, DONE);
instance->SaveToDB();
}
void BeginEvent()
@@ -241,19 +302,8 @@ public:
events.ScheduleEvent(EVENT_FEAR, urand(10000, 20000));
events.ScheduleEvent(EVENT_SILENCE, urand(20000, 25000));
events.ScheduleEvent(EVENT_MIND_CONTROL, urand(30000, 35000));
events.ScheduleEvent(EVENT_SPAWN_ADD, 10000);
}
void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override
{
if (summon->GetEntry() != NPC_NEFARIAN)
{
summon->UpdateEntry(NPC_BONE_CONSTRUCT);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
summon->SetReactState(REACT_PASSIVE);
summon->SetStandState(UNIT_STAND_STATE_DEAD);
++KilledAdds;
}
events.ScheduleEvent(EVENT_SPAWN_ADDS, 10000);
events.ScheduleEvent(EVENT_CHECK_PHASE_2, 10000);
}
void JustSummoned(Creature* summon) override { summons.Summon(summon); }
@@ -326,7 +376,7 @@ public:
}
// Only do this if we haven't spawned nefarian yet
if (UpdateVictim() && KilledAdds <= 42)
if (UpdateVictim() && KilledAdds <= MAX_DRAKONID_KILLED)
{
events.Update(diff);
@@ -368,39 +418,33 @@ public:
DoCastSelf(SPELL_SHADOWBLINK);
events.ScheduleEvent(EVENT_SHADOWBLINK, urand(30000, 40000));
break;
case EVENT_SPAWN_ADD:
for (uint8 i=0; i<2; ++i)
case EVENT_SPAWN_ADDS:
// Spawn the spawners.
me->SummonCreature(_nefarianLeftTunnel, spawnerPositions[0]);
me->SummonCreature(_nefarianRightTunnel, spawnerPositions[1]);
break;
case EVENT_CHECK_PHASE_2:
if (KilledAdds >= MAX_DRAKONID_KILLED)
{
uint32 CreatureID;
if (urand(0, 2) == 0)
CreatureID = NPC_CHROMATIC_DRAKANOID;
else
CreatureID = Entry[urand(0, 4)];
if (Creature* dragon = me->SummonCreature(CreatureID, DrakeSpawnLoc[i]))
if (Creature* nefarian = me->SummonCreature(NPC_NEFARIAN, NefarianSpawn))
{
dragon->SetFaction(FACTION_DRAGONFLIGHT_BLACK);
dragon->AI()->AttackStart(me->GetVictim());
}
if (KilledAdds >= 42)
{
if (Creature* nefarian = me->SummonCreature(NPC_NEFARIAN, NefarianSpawn))
{
nefarian->setActive(true);
nefarian->SetCanFly(true);
nefarian->SetDisableGravity(true);
nefarian->GetMotionMaster()->MovePath(NEFARIAN_PATH, false);
}
events.CancelEvent(EVENT_MIND_CONTROL);
events.CancelEvent(EVENT_FEAR);
events.CancelEvent(EVENT_SHADOW_BOLT);
events.CancelEvent(EVENT_SILENCE);
DoCastSelf(SPELL_ROOT_SELF, true);
me->SetVisible(false);
return;
nefarian->setActive(true);
nefarian->SetCanFly(true);
nefarian->SetDisableGravity(true);
nefarian->GetMotionMaster()->MovePath(NEFARIAN_PATH, false);
}
events.CancelEvent(EVENT_MIND_CONTROL);
events.CancelEvent(EVENT_FEAR);
events.CancelEvent(EVENT_SHADOW_BOLT);
events.CancelEvent(EVENT_SILENCE);
DoCastSelf(SPELL_ROOT_SELF, true);
me->SetVisible(false);
// Despawn the spawners.
summons.DespawnEntry(_nefarianLeftTunnel);
summons.DespawnEntry(_nefarianRightTunnel);
return;
}
events.ScheduleEvent(EVENT_SPAWN_ADD, 4000);
events.ScheduleEvent(EVENT_CHECK_PHASE_2, 1000);
break;
}
@@ -431,6 +475,8 @@ public:
private:
uint32 KilledAdds;
uint32 _nefarianRightTunnel;
uint32 _nefarianLeftTunnel;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -461,11 +507,11 @@ struct boss_nefarian : public BossAI
if (_introDone) // already in combat, reset properly.
{
_Reset();
if (Unit* victor = me->FindNearestCreature(NPC_VICTOR_NEFARIUS, 200.f, true))
if (Creature* victor = me->FindNearestCreature(NPC_VICTOR_NEFARIUS, 200.f, true))
{
if (victor->ToCreature() && victor->ToCreature()->AI())
if (victor->AI())
{
victor->ToCreature()->AI()->DoAction(ACTION_RESET);
victor->AI()->DoAction(ACTION_RESET);
}
}
me->DespawnOrUnsummon();
@@ -478,6 +524,14 @@ struct boss_nefarian : public BossAI
{
_JustDied();
Talk(SAY_DEATH);
if (Creature* victor = me->FindNearestCreature(NPC_VICTOR_NEFARIUS, 200.f, true))
{
if (victor->AI())
{
victor->AI()->DoAction(ACTION_KILLED);
}
}
}
void KilledUnit(Unit* victim) override
@@ -725,12 +779,12 @@ struct npc_corrupted_totem : public ScriptedAI
std::vector<uint32> mobsEntries;
mobsEntries.push_back(NPC_NEFARIAN);
mobsEntries.push_back(NPC_BONE_CONSTRUCT);
mobsEntries.push_back(NPC_BRONZE_DRAKANOID);
mobsEntries.push_back(NPC_BLUE_DRAKANOID);
mobsEntries.push_back(NPC_RED_DRAKANOID);
mobsEntries.push_back(NPC_GREEN_DRAKANOID);
mobsEntries.push_back(NPC_BLACK_DRAKANOID);
mobsEntries.push_back(NPC_CHROMATIC_DRAKANOID);
mobsEntries.push_back(NPC_BRONZE_DRAKONID);
mobsEntries.push_back(NPC_BLUE_DRAKONID);
mobsEntries.push_back(NPC_RED_DRAKONID);
mobsEntries.push_back(NPC_GREEN_DRAKONID);
mobsEntries.push_back(NPC_BLACK_DRAKONID);
mobsEntries.push_back(NPC_CHROMATIC_DRAKONID);
for (auto& entry : mobsEntries)
{
@@ -1125,6 +1179,33 @@ class spell_shadowblink : public SpellScript
}
};
// 22659
class spell_spawn_drakonid : public SpellScript
{
PrepareSpellScript(spell_spawn_drakonid);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SPAWN_BLACK_DRAKONID, SPELL_SPAWN_BLUE_DRAKONID, SPELL_SPAWN_BRONZE_DRAKONID, SPELL_SPAWN_GREEN_DRAKONID, SPELL_SPAWN_RED_DRAKONID });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (!caster)
{
return;
}
caster->CastSpell(caster, spawnerSpells[caster->GetEntry()], true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_spawn_drakonid::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_boss_nefarian()
{
new boss_victor_nefarius();
@@ -1137,4 +1218,5 @@ void AddSC_boss_nefarian()
RegisterSpellScript(aura_class_call_berserk);
RegisterSpellScript(spell_corrupted_totems);
RegisterSpellScript(spell_shadowblink);
RegisterSpellScript(spell_spawn_drakonid);
}
@@ -75,6 +75,8 @@ public:
// Razorgore
EggCount = 0;
EggEvent = 0;
NefarianLeftTunnel = 0;
NefarianRightTunnel = 0;
}
void OnCreatureCreate(Creature* creature) override
@@ -90,9 +92,7 @@ public:
chromaggusGUID = creature->GetGUID();
break;
case NPC_BLACKWING_DRAGON:
case NPC_BLACKWING_TASKMASTER:
case NPC_BLACKWING_LEGIONAIRE:
case NPC_BLACKWING_WARLOCK:
case NPC_BLACKWING_MAGE:
if (Creature* razor = instance->GetCreature(razorgoreGUID))
if (CreatureAI* razorAI = razor->AI())
@@ -104,6 +104,24 @@ public:
case NPC_VICTOR_NEFARIUS:
victorNefariusGUID = creature->GetGUID();
break;
case NPC_BLACK_DRAKONID:
case NPC_BLUE_DRAKONID:
case NPC_BRONZE_DRAKONID:
case NPC_CHROMATIC_DRAKONID:
case NPC_GREEN_DRAKONID:
case NPC_RED_DRAKONID:
if (Creature* nefarius = instance->GetCreature(victorNefariusGUID))
{
if (CreatureAI* nefariusAI = nefarius->AI())
{
nefariusAI->JustSummoned(creature);
}
}
if (creature->AI())
{
creature->AI()->DoZoneInCombat();
}
break;
default:
break;
}
@@ -168,6 +186,21 @@ public:
}
}
uint32 GetData(uint32 data) const override
{
switch (data)
{
case DATA_NEFARIAN_LEFT_TUNNEL:
return NefarianLeftTunnel;
case DATA_NEFARIAN_RIGHT_TUNNEL:
return NefarianRightTunnel;
default:
break;
}
return 0;
}
bool CheckRequiredBosses(uint32 bossId, Player const* /* player */) const override
{
switch (bossId)
@@ -270,6 +303,16 @@ public:
break;
}
}
if (type == DATA_NEFARIAN_LEFT_TUNNEL)
{
NefarianLeftTunnel = data;
}
if (type == DATA_NEFARIAN_RIGHT_TUNNEL)
{
NefarianRightTunnel = data;
}
}
ObjectGuid GetGuidData(uint32 type) const override
@@ -278,6 +321,8 @@ public:
{
case DATA_RAZORGORE_THE_UNTAMED:
return razorgoreGUID;
case DATA_LORD_VICTOR_NEFARIUS:
return victorNefariusGUID;
case DATA_CHROMAGGUS:
return chromaggusGUID;
case DATA_GO_CHROMAGGUS_DOOR:
@@ -294,6 +339,32 @@ public:
//! HACK, needed because of buggy CreatureAI after charm
if (unit->GetEntry() == NPC_RAZORGORE && GetBossState(DATA_RAZORGORE_THE_UNTAMED) != DONE)
SetBossState(DATA_RAZORGORE_THE_UNTAMED, DONE);
switch (unit->GetEntry())
{
case NPC_BLACK_DRAKONID:
case NPC_BLUE_DRAKONID:
case NPC_BRONZE_DRAKONID:
case NPC_CHROMATIC_DRAKONID:
case NPC_GREEN_DRAKONID:
case NPC_RED_DRAKONID:
if (Creature* summon = unit->ToCreature())
{
summon->UpdateEntry(NPC_BONE_CONSTRUCT);
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
summon->SetReactState(REACT_PASSIVE);
summon->SetStandState(UNIT_STAND_STATE_DEAD);
if (Creature* nefarius = instance->GetCreature(victorNefariusGUID))
{
if (nefarius->AI())
{
nefarius->AI()->DoAction(ACTION_NEFARIUS_ADD_KILLED);
}
}
}
break;
}
}
void Update(uint32 diff) override
@@ -331,6 +402,54 @@ public:
}
}
std::string GetSaveData() override
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "B W L " << GetBossSaveData() << NefarianLeftTunnel << ' ' << NefarianRightTunnel;
OUT_SAVE_INST_DATA_COMPLETE;
return saveStream.str();
}
void Load(char const* data) override
{
if (!data)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(data);
char dataHead1, dataHead2, dataHead3;
std::istringstream loadStream(data);
loadStream >> dataHead1 >> dataHead2 >> dataHead3;
if (dataHead1 == 'B' && dataHead2 == 'W' && dataHead3 == 'L')
{
for (uint32 i = 0; i < EncounterCount; ++i)
{
uint32 tmpState;
loadStream >> tmpState;
if (tmpState == IN_PROGRESS || tmpState == FAIL || tmpState > SPECIAL)
tmpState = NOT_STARTED;
SetBossState(i, EncounterState(tmpState));
}
loadStream >> NefarianLeftTunnel;
loadStream >> NefarianRightTunnel;
}
else
{
OUT_LOAD_INST_DATA_FAIL;
}
OUT_LOAD_INST_DATA_COMPLETE;
}
protected:
ObjectGuid razorgoreGUID;
ObjectGuid chromaggusGUID;
@@ -344,6 +463,10 @@ public:
uint32 EggEvent;
GuidList EggList;
// Nefarian
uint32 NefarianLeftTunnel;
uint32 NefarianRightTunnel;
// Misc
EventMap _events;
};
@@ -22,6 +22,7 @@
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "sunken_temple.h"
#include "Unit.h"
class instance_sunken_temple : public InstanceMapScript
{
@@ -48,6 +49,10 @@ public:
case NPC_JAMMAL_AN_THE_PROPHET:
_jammalanGUID = creature->GetGUID();
break;
case NPC_SHADE_OF_ERANIKUS:
_shadeOfEranikusGUID = creature->GetGUID();
creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
break;
}
if (creature->IsAlive() && creature->GetSpawnId() && creature->GetCreatureType() == CREATURE_TYPE_DRAGONKIN && creature->GetEntry() != NPC_SHADE_OF_ERANIKUS)
@@ -58,6 +63,12 @@ public:
{
if (unit->GetTypeId() == TYPEID_UNIT && unit->GetCreatureType() == CREATURE_TYPE_DRAGONKIN && unit->GetEntry() != NPC_SHADE_OF_ERANIKUS)
_dragonkinList.remove(unit->GetGUID());
if (unit->GetEntry() == NPC_JAMMAL_AN_THE_PROPHET)
{
if (Creature* cr = instance->GetCreature(_shadeOfEranikusGUID))
cr->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
}
void OnGameObjectCreate(GameObject* gameobject) override
@@ -193,6 +204,7 @@ public:
ObjectGuid _forcefieldGUID;
ObjectGuid _jammalanGUID;
ObjectGuid _shadeOfEranikusGUID;
GuidList _dragonkinList;
EventMap _events;
};
@@ -31,8 +31,8 @@ enum Says
{
SAY_AGGRO = 0,
SAY_FLEEING = 1,
SAY_MINION_DESTROY = 2, // Where does it belong?
SAY_PROTECT_ALTAR = 3 // Where does it belong?
SAY_MINION_DESTROY = 2,
SAY_PROTECT_ALTAR = 3
};
enum Spells
@@ -203,8 +203,31 @@ public:
}
};
class at_zulgurub_temple_speech : public OnlyOnceAreaTriggerScript
{
public:
at_zulgurub_temple_speech() : OnlyOnceAreaTriggerScript("at_zulgurub_temple_speech") {}
bool _OnTrigger(Player* player, const AreaTrigger* /*at*/) override
{
if (InstanceScript* instance = player->GetInstanceScript())
{
if (Creature* hakkar = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_HAKKAR)))
{
if (hakkar->GetAI())
{
hakkar->AI()->Talk(SAY_MINION_DESTROY);
}
}
return false;
}
return false;
}
};
void AddSC_boss_hakkar()
{
new boss_hakkar();
new at_zulgurub_entrance_speech();
new at_zulgurub_temple_speech();
}
@@ -226,6 +226,7 @@ public:
bool berserk{ false };
bool bAchievCheese{ true };
bool bAchievGettingCold{ true };
bool bAchievCacheRare{ true };
bool bAchievCoolestFriends{ true };
uint16 addSpawnTimer{ 0 };
@@ -240,6 +241,7 @@ public:
berserk = false;
bAchievCheese = true;
bAchievGettingCold = true;
bAchievCacheRare = true;
bAchievCoolestFriends = true;
me->SetSheath(SHEATH_STATE_MELEE);
@@ -423,6 +425,7 @@ public:
case EVENT_HARD_MODE_MISSED:
{
Talk(TEXT_HM_MISS);
bAchievCacheRare = false;
if (pInstance)
{
if (GameObject* go = pInstance->instance->GetGameObject(pInstance->GetGuidData(GO_HODIR_CHEST_HARD)))
@@ -591,6 +594,8 @@ public:
return (bAchievCheese ? 1 : 0);
case 2:
return (bAchievGettingCold ? 1 : 0);
case 3:
return (bAchievCacheRare ? 1 : 0);
case 4:
return (bAchievCoolestFriends ? 1 : 0);
}
+17
View File
@@ -18,6 +18,23 @@
#ifndef DBCENUMS_H
#define DBCENUMS_H
#pragma pack(push, 1)
struct DBCPosition2D
{
float X;
float Y;
};
struct DBCPosition3D
{
float X;
float Y;
float Z;
};
#pragma pack(pop)
// Client expected level limitation, like as used in DBC item max levels for "until max player level"
// use as default max player level, must be fit max level for used client
// also see MAX_LEVEL and STRONG_MAX_LEVEL define
-115
View File
@@ -21,124 +21,9 @@
#include "Common.h"
#include "DBCStorageIterator.h"
#include "Errors.h"
#include <G3D/AABox.h>
#include <G3D/Vector3.h>
#include <cstring>
#include <vector>
// Structures for M4 file. Source: https://wowdev.wiki
template<typename T>
struct M2SplineKey
{
T p0;
T p1;
T p2;
};
struct M2Header
{
char Magic[4]; // "MD20"
uint32 Version; // The version of the format.
uint32 lName; // Length of the model's name including the trailing \0
uint32 ofsName; // Offset to the name, it seems like models can get reloaded by this name.should be unique, i guess.
uint32 GlobalModelFlags; // 0x0001: tilt x, 0x0002: tilt y, 0x0008: add 2 fields in header, 0x0020: load .phys data (MoP+), 0x0080: has _lod .skin files (MoP?+), 0x0100: is camera related.
uint32 nGlobalSequences;
uint32 ofsGlobalSequences; // A list of timestamps.
uint32 nAnimations;
uint32 ofsAnimations; // Information about the animations in the model.
uint32 nAnimationLookup;
uint32 ofsAnimationLookup; // Mapping of global IDs to the entries in the Animation sequences block.
uint32 nBones; // MAX_BONES = 0x100
uint32 ofsBones; // Information about the bones in this model.
uint32 nKeyBoneLookup;
uint32 ofsKeyBoneLookup; // Lookup table for key skeletal bones.
uint32 nVertices;
uint32 ofsVertices; // Vertices of the model.
uint32 nViews; // Views (LOD) are now in .skins.
uint32 nSubmeshAnimations;
uint32 ofsSubmeshAnimations; // Submesh color and alpha animations definitions.
uint32 nTextures;
uint32 ofsTextures; // Textures of this model.
uint32 nTransparency;
uint32 ofsTransparency; // Transparency of textures.
uint32 nUVAnimation;
uint32 ofsUVAnimation;
uint32 nTexReplace;
uint32 ofsTexReplace; // Replaceable Textures.
uint32 nRenderFlags;
uint32 ofsRenderFlags; // Blending modes / render flags.
uint32 nBoneLookupTable;
uint32 ofsBoneLookupTable; // A bone lookup table.
uint32 nTexLookup;
uint32 ofsTexLookup; // The same for textures.
uint32 nTexUnits; // possibly removed with cata?!
uint32 ofsTexUnits; // And texture units. Somewhere they have to be too.
uint32 nTransLookup;
uint32 ofsTransLookup; // Everything needs its lookup. Here are the transparencies.
uint32 nUVAnimLookup;
uint32 ofsUVAnimLookup;
G3D::AABox BoundingBox; // min/max( [1].z, 2.0277779f ) - 0.16f seems to be the maximum camera height
float BoundingSphereRadius;
G3D::AABox CollisionBox;
float CollisionSphereRadius;
uint32 nBoundingTriangles;
uint32 ofsBoundingTriangles; // Our bounding volumes. Similar structure like in the old ofsViews.
uint32 nBoundingVertices;
uint32 ofsBoundingVertices;
uint32 nBoundingNormals;
uint32 ofsBoundingNormals;
uint32 nAttachments;
uint32 ofsAttachments; // Attachments are for weapons etc.
uint32 nAttachLookup;
uint32 ofsAttachLookup; // Of course with a lookup.
uint32 nEvents;
uint32 ofsEvents; // Used for playing sounds when dying and a lot else.
uint32 nLights;
uint32 ofsLights; // Lights are mainly used in loginscreens but in wands and some doodads too.
uint32 nCameras; // Format of Cameras changed with version 271!
uint32 ofsCameras; // The cameras are present in most models for having a model in the Character-Tab.
uint32 nCameraLookup;
uint32 ofsCameraLookup; // And lookup-time again.
uint32 nRibbonEmitters;
uint32 ofsRibbonEmitters; // Things swirling around. See the CoT-entrance for light-trails.
uint32 nParticleEmitters;
uint32 ofsParticleEmitters; // Spells and weapons, doodads and loginscreens use them. Blood dripping of a blade? Particles.
uint32 nBlendMaps; // This has to deal with blending. Exists IFF (flags & 0x8) != 0. When set, textures blending is overriden by the associated array. See M2/WotLK#Blend_mode_overrides
uint32 ofsBlendMaps; // Same as above. Points to an array of uint16 of nBlendMaps entries -- From WoD information.};
};
struct M2Array
{
uint32_t number;
uint32 offset_elements;
};
struct M2Track
{
uint16_t interpolation_type;
uint16_t global_sequence;
M2Array timestamps;
M2Array values;
};
struct M2Camera
{
uint32_t type; // 0: portrait, 1: characterinfo; -1: else (flyby etc.); referenced backwards in the lookup table.
float fov; // No radians, no degrees. Multiply by 35 to get degrees.
float far_clip;
float near_clip;
M2Track positions; // How the camera's position moves. Should be 3*3 floats.
G3D::Vector3 position_base;
M2Track target_positions; // How the target moves. Should be 3*3 floats.
G3D::Vector3 target_position_base;
M2Track rolldata; // The camera can have some roll-effect. Its 0 to 2*Pi.
};
struct FlyByCamera
{
uint32 timeStamp;
G3D::Vector4 locations;
};
/// Interface class for common access
class DBCStorageBase
{
+5 -7
View File
@@ -692,13 +692,11 @@ struct ChrRacesEntry
struct CinematicCameraEntry
{
uint32 id; // 0 index
char const* filename; // 1
uint32 soundid; // 2 in SoundEntries.dbc or 0
float base_x; // 3
float base_y; // 4
float base_z; // 5
float base_o; // 6
uint32 ID; // 0
char const* Model; // 1 Model filename (translate .mdx to .m2)
uint32 SoundID; // 2 Sound ID (voiceover for cinematic)
DBCPosition3D Origin; // 3-5 Position in map used for basis for M2 co-ordinates
float OriginFacing; // 6 Orientation in map used for basis for M2 co-ordinates
};
struct CinematicSequencesEntry