Core/Graveyards: Made the graveyard orientations loading from WorldSafeLocs.dbc
This commit is contained in:
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS `graveyard_orientation`;
|
||||
@@ -5311,8 +5311,7 @@ void Player::RepopAtGraveyard()
|
||||
// and don't show spirit healer location
|
||||
if (ClosestGrave)
|
||||
{
|
||||
float const* orientation = sObjectMgr->GetGraveyardOrientation(ClosestGrave->ID);
|
||||
TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, orientation ? *orientation : GetOrientation());
|
||||
TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, (ClosestGrave->Facing * M_PI) / 180); // Orientation is initially in degrees
|
||||
if (isDead()) // not send if alive, because it used in TeleportTo()
|
||||
{
|
||||
WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4*4); // show spirit healer position on minimap
|
||||
|
||||
@@ -279,7 +279,6 @@ ObjectMgr::~ObjectMgr()
|
||||
itr->second.Clear();
|
||||
|
||||
_cacheTrainerSpellStore.clear();
|
||||
_graveyardOrientations.clear();
|
||||
|
||||
for (DungeonEncounterContainer::iterator itr =_dungeonEncounterStore.begin(); itr != _dungeonEncounterStore.end(); ++itr)
|
||||
for (DungeonEncounterList::iterator encounterItr = itr->second.begin(); encounterItr != itr->second.end(); ++encounterItr)
|
||||
@@ -300,34 +299,6 @@ void ObjectMgr::AddLocaleString(std::string const& s, LocaleConstant locale, Str
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGraveyardOrientations()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
_graveyardOrientations.clear();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT id, orientation FROM graveyard_orientation");
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 id = fields[0].GetUInt32();
|
||||
if (!sWorldSafeLocsStore.LookupEntry(id))
|
||||
{
|
||||
TC_LOG_ERROR("server.loading", "Graveyard %u referenced in graveyard_orientation doesn't exist.", id);
|
||||
continue;
|
||||
}
|
||||
_graveyardOrientations[id] = fields[1].GetFloat();
|
||||
|
||||
} while (result->NextRow());
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %lu graveyard orientations in %u ms", (unsigned long)_graveyardOrientations.size(), GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadCreatureLocales()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
@@ -6204,19 +6175,13 @@ void ObjectMgr::LoadAreaTriggerTeleports()
|
||||
continue;
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const* MapID = sWorldSafeLocsStore.LookupEntry(PortLocID);
|
||||
WorldSafeLocsEntry const* PositionX = sWorldSafeLocsStore.LookupEntry(PortLocID);
|
||||
WorldSafeLocsEntry const* PositionY = sWorldSafeLocsStore.LookupEntry(PortLocID);
|
||||
WorldSafeLocsEntry const* PositionZ = sWorldSafeLocsStore.LookupEntry(PortLocID);
|
||||
WorldSafeLocsEntry const* Orientation = sWorldSafeLocsStore.LookupEntry(PortLocID);
|
||||
|
||||
AreaTriggerStruct at;
|
||||
|
||||
at.target_mapId = MapID->map_id;
|
||||
at.target_X = PositionX->x;
|
||||
at.target_Y = PositionY->y;
|
||||
at.target_Z = PositionZ->z;
|
||||
at.target_Orientation = ((Orientation->Facing) * M_PI) / 180; // Orientation is initially in degrees
|
||||
at.target_mapId = portLoc->map_id;
|
||||
at.target_X = portLoc->x;
|
||||
at.target_Y = portLoc->y;
|
||||
at.target_Z = portLoc->z;
|
||||
at.target_Orientation = (portLoc->Facing * M_PI) / 180; // Orientation is initially in degrees
|
||||
|
||||
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
|
||||
if (!atEntry)
|
||||
|
||||
@@ -650,7 +650,6 @@ struct GraveYardData
|
||||
};
|
||||
|
||||
typedef std::multimap<uint32, GraveYardData> GraveYardContainer;
|
||||
typedef std::unordered_map<uint32 /* graveyard Id */, float /* orientation */> GraveyardOrientationContainer;
|
||||
typedef std::pair<GraveYardContainer::const_iterator, GraveYardContainer::const_iterator> GraveYardMapBounds;
|
||||
typedef std::pair<GraveYardContainer::iterator, GraveYardContainer::iterator> GraveYardMapBoundsNonConst;
|
||||
|
||||
@@ -990,7 +989,6 @@ class ObjectMgr
|
||||
void LoadBroadcastTextLocales();
|
||||
void LoadCreatureClassLevelStats();
|
||||
void LoadCreatureLocales();
|
||||
void LoadGraveyardOrientations();
|
||||
void LoadCreatureTemplates();
|
||||
void LoadCreatureTemplateAddons();
|
||||
void LoadCreatureTemplate(Field* fields);
|
||||
@@ -1274,15 +1272,6 @@ class ObjectMgr
|
||||
return &iter->second;
|
||||
}
|
||||
|
||||
float const* GetGraveyardOrientation(uint32 id) const
|
||||
{
|
||||
GraveyardOrientationContainer::const_iterator iter = _graveyardOrientations.find(id);
|
||||
if (iter != _graveyardOrientations.end())
|
||||
return &iter->second;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedCost, uint8 type, bool persist = true); // for event
|
||||
bool RemoveVendorItem(uint32 entry, uint32 item, uint8 type, bool persist = true); // for event
|
||||
bool IsVendorItemValid(uint32 vendor_entry, uint32 id, int32 maxcount, uint32 ptime, uint32 ExtendedCost, uint8 type, Player* player = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const;
|
||||
@@ -1503,8 +1492,6 @@ class ObjectMgr
|
||||
CacheVendorItemContainer _cacheVendorItemStore;
|
||||
CacheTrainerSpellContainer _cacheTrainerSpellStore;
|
||||
|
||||
GraveyardOrientationContainer _graveyardOrientations;
|
||||
|
||||
std::set<uint32> _difficultyEntries[MAX_DIFFICULTY - 1]; // already loaded difficulty 1 value in creatures, used in CheckCreatureTemplate
|
||||
std::set<uint32> _hasDifficultyEntries[MAX_DIFFICULTY - 1]; // already loaded creatures with difficulty 1 values, used in CheckCreatureTemplate
|
||||
|
||||
|
||||
@@ -443,7 +443,7 @@ void WorldSession::SendSpiritResurrect()
|
||||
_player->GetPositionX(), _player->GetPositionY(), _player->GetPositionZ(), _player->GetMapId(), _player->GetTeam());
|
||||
|
||||
if (corpseGrave != ghostGrave)
|
||||
_player->TeleportTo(corpseGrave->map_id, corpseGrave->x, corpseGrave->y, corpseGrave->z, _player->GetOrientation());
|
||||
_player->TeleportTo(corpseGrave->map_id, corpseGrave->x, corpseGrave->y, corpseGrave->z, (corpseGrave->Facing * M_PI) / 180); // Orientation is initially in degrees
|
||||
// or update at original position
|
||||
else
|
||||
_player->UpdateObjectVisibility();
|
||||
|
||||
@@ -1606,9 +1606,6 @@ void World::SetInitialWorldSettings()
|
||||
TC_LOG_INFO("server.loading", "Loading Graveyard-zone links...");
|
||||
sObjectMgr->LoadGraveyardZones();
|
||||
|
||||
TC_LOG_INFO("server.loading", "Loading Graveyard Orientations...");
|
||||
sObjectMgr->LoadGraveyardOrientations();
|
||||
|
||||
TC_LOG_INFO("server.loading", "Loading spell pet auras...");
|
||||
sSpellMgr->LoadSpellPetAuras();
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ public:
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
|
||||
player->TeleportTo(gy->map_id, gy->x, gy->y, gy->z, player->GetOrientation());
|
||||
player->TeleportTo(gy->map_id, gy->x, gy->y, gy->z, (gy->Facing * M_PI) / 180); // Orientation is initially in degrees
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user