mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
Core/DBC Move WorldSafeLocs.dbc storage to DB (#932)
This commit is contained in:
@@ -18,6 +18,7 @@ EndScriptData */
|
||||
#include "Chat.h"
|
||||
#include "Language.h"
|
||||
#include "Player.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
class go_commandscript : public CommandScript
|
||||
{
|
||||
@@ -171,7 +172,7 @@ public:
|
||||
if (!graveyardId)
|
||||
return false;
|
||||
|
||||
WorldSafeLocsEntry const* gy = sWorldSafeLocsStore.LookupEntry(graveyardId);
|
||||
GraveyardStruct const* gy = sGraveyard->GetGraveyard(graveyardId);
|
||||
if (!gy)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNOEXIST, graveyardId);
|
||||
@@ -179,9 +180,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!MapManager::IsValidMapCoord(gy->map_id, gy->x, gy->y, gy->z))
|
||||
if (!MapManager::IsValidMapCoord(gy->Map, gy->x, gy->y, gy->z))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->x, gy->y, gy->map_id);
|
||||
handler->PSendSysMessage(LANG_INVALID_TARGET_COORD, gy->x, gy->y, gy->Map);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -196,7 +197,7 @@ public:
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
|
||||
player->TeleportTo(gy->map_id, gy->x, gy->y, gy->z, player->GetOrientation());
|
||||
player->TeleportTo(gy->Map, gy->x, gy->y, gy->z, player->GetOrientation());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "GroupMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
class misc_commandscript : public CommandScript
|
||||
{
|
||||
@@ -1268,7 +1269,7 @@ public:
|
||||
else
|
||||
return false;
|
||||
|
||||
WorldSafeLocsEntry const* graveyard = sWorldSafeLocsStore.LookupEntry(graveyardId);
|
||||
GraveyardStruct const* graveyard = sGraveyard->GetGraveyard(graveyardId);
|
||||
|
||||
if (!graveyard)
|
||||
{
|
||||
@@ -1289,7 +1290,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sObjectMgr->AddGraveyardLink(graveyardId, zoneId, teamId))
|
||||
if (sGraveyard->AddGraveyardLink(graveyardId, zoneId, teamId))
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, graveyardId, zoneId);
|
||||
else
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, graveyardId, zoneId);
|
||||
@@ -1315,13 +1316,13 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
uint32 zone_id = player->GetZoneId();
|
||||
|
||||
WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveyard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), teamId);
|
||||
GraveyardStruct const* graveyard = sGraveyard->GetClosestGraveyard(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), teamId);
|
||||
|
||||
if (graveyard)
|
||||
{
|
||||
uint32 graveyardId = graveyard->ID;
|
||||
|
||||
GraveyardData const* data = sObjectMgr->FindGraveyardData(graveyardId, zone_id);
|
||||
GraveyardData const* data = sGraveyard->FindGraveyardData(graveyardId, zone_id);
|
||||
if (!data)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, graveyardId);
|
||||
|
||||
@@ -29,6 +29,7 @@ EndScriptData */
|
||||
#include "TicketMgr.h"
|
||||
#include "WardenCheckMgr.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
class reload_commandscript : public CommandScript
|
||||
{
|
||||
@@ -80,6 +81,7 @@ public:
|
||||
{ "disenchant_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesDisenchantCommand, "" },
|
||||
{ "event_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventScriptsCommand, "" },
|
||||
{ "fishing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesFishingCommand, "" },
|
||||
{ "game_graveyard", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardCommand, "" },
|
||||
{ "game_graveyard_zone", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardZoneCommand, "" },
|
||||
{ "game_tele", SEC_ADMINISTRATOR, true, &HandleReloadGameTeleCommand, "" },
|
||||
{ "gameobject_questender", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestEnderCommand, "" },
|
||||
@@ -1022,7 +1024,7 @@ public:
|
||||
{
|
||||
sLog->outString("Re-Loading Graveyard-zone links...");
|
||||
|
||||
sObjectMgr->LoadGraveyardZones();
|
||||
sGraveyard->LoadGraveyardZones();
|
||||
|
||||
handler->SendGlobalGMSysMessage("DB table `game_graveyard_zone` reloaded.");
|
||||
|
||||
@@ -1203,6 +1205,14 @@ public:
|
||||
handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadGameGraveyardCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Reloading game_graveyard table...");
|
||||
sGraveyard->LoadGraveyardFromDB();
|
||||
handler->SendGlobalGMSysMessage("DB table `game_graveyard` reloaded.");
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_reload_commandscript()
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "CombatAI.h"
|
||||
#include "Player.h"
|
||||
#include "PoolMgr.h"
|
||||
#include "GameGraveyard.h"
|
||||
#include "World.h"
|
||||
|
||||
#define GOSSIP_HELLO_DEMO1 "Build catapult."
|
||||
@@ -227,8 +228,8 @@ class npc_wg_spirit_guide : public CreatureScript
|
||||
GraveyardVect gy = wintergrasp->GetGraveyardVector();
|
||||
for (uint8 i = 0; i < gy.size(); i++)
|
||||
if (action - GOSSIP_ACTION_INFO_DEF == i && gy[i]->GetControlTeamId() == player->GetTeamId())
|
||||
if (WorldSafeLocsEntry const* safeLoc = sWorldSafeLocsStore.LookupEntry(gy[i]->GetGraveyardId()))
|
||||
player->TeleportTo(safeLoc->map_id, safeLoc->x, safeLoc->y, safeLoc->z, 0);
|
||||
if (GraveyardStruct const* safeLoc = sGraveyard->GetGraveyard(gy[i]->GetGraveyardId()))
|
||||
player->TeleportTo(safeLoc->Map, safeLoc->x, safeLoc->y, safeLoc->z, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "Language.h"
|
||||
#include "World.h"
|
||||
#include "GossipDef.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
OPvPCapturePointEP_EWT::OPvPCapturePointEP_EWT(OutdoorPvP* pvp)
|
||||
: OPvPCapturePoint(pvp), m_TowerState(EP_TS_N), m_UnitsSummonedSideId(TEAM_NEUTRAL)
|
||||
@@ -419,8 +420,8 @@ void OPvPCapturePointEP_CGT::LinkGraveyard(TeamId teamId)
|
||||
{
|
||||
if (m_GraveyardSide != teamId)
|
||||
{
|
||||
sObjectMgr->RemoveGraveyardLink(EP_GraveYardId, EP_GraveYardZone, m_GraveyardSide, false);
|
||||
sObjectMgr->AddGraveyardLink(EP_GraveYardId, EP_GraveYardZone, teamId, false);
|
||||
sGraveyard->RemoveGraveyardLink(EP_GraveYardId, EP_GraveYardZone, m_GraveyardSide, false);
|
||||
sGraveyard->AddGraveyardLink(EP_GraveYardId, EP_GraveYardZone, teamId, false);
|
||||
m_GraveyardSide = teamId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "Language.h"
|
||||
#include "World.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
OutdoorPvPNA::OutdoorPvPNA()
|
||||
{
|
||||
@@ -120,7 +121,7 @@ void OPvPCapturePointNA::DeSpawnGOs()
|
||||
void OPvPCapturePointNA::FactionTakeOver(TeamId teamId)
|
||||
{
|
||||
if (m_ControllingFaction != TEAM_NEUTRAL)
|
||||
sObjectMgr->RemoveGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
|
||||
sGraveyard->RemoveGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
|
||||
if (m_ControllingFaction == TEAM_ALLIANCE)
|
||||
sWorld->SendZoneText(NA_HALAA_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_NA_LOSE_A));
|
||||
else if (m_ControllingFaction == TEAM_HORDE)
|
||||
@@ -128,7 +129,7 @@ void OPvPCapturePointNA::FactionTakeOver(TeamId teamId)
|
||||
|
||||
m_ControllingFaction = teamId;
|
||||
if (m_ControllingFaction != TEAM_NEUTRAL)
|
||||
sObjectMgr->AddGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
|
||||
sGraveyard->AddGraveyardLink(NA_HALAA_GRAVEYARD, NA_HALAA_GRAVEYARD_ZONE, m_ControllingFaction, false);
|
||||
DeSpawnGOs();
|
||||
DeSpawnNPCs();
|
||||
SpawnGOsForTeam(teamId);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "GossipDef.h"
|
||||
#include "World.h"
|
||||
#include "GameGraveyard.h"
|
||||
|
||||
OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon(OutdoorPvP* pvp, ZM_BeaconType type)
|
||||
: OPvPCapturePoint(pvp), m_TowerType(type), m_TowerState(ZM_TOWERSTATE_N)
|
||||
@@ -214,8 +215,8 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid)
|
||||
m_GraveYardState = ZM_GRAVEYARD_A;
|
||||
DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
|
||||
AddObject(0, ZM_Banner_A.entry, ZM_Banner_A.map, ZM_Banner_A.x, ZM_Banner_A.y, ZM_Banner_A.z, ZM_Banner_A.o, ZM_Banner_A.rot0, ZM_Banner_A.rot1, ZM_Banner_A.rot2, ZM_Banner_A.rot3);
|
||||
sObjectMgr->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE); // rem gy
|
||||
sObjectMgr->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE, false); // add gy
|
||||
sGraveyard->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE); // rem gy
|
||||
sGraveyard->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE, false); // add gy
|
||||
m_PvP->TeamApplyBuff(TEAM_ALLIANCE, ZM_CAPTURE_BUFF, 0, player);
|
||||
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
|
||||
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A));
|
||||
@@ -227,8 +228,8 @@ int32 OPvPCapturePointZM_GraveYard::HandleOpenGo(Player* player, uint64 guid)
|
||||
m_GraveYardState = ZM_GRAVEYARD_H;
|
||||
DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
|
||||
AddObject(0, ZM_Banner_H.entry, ZM_Banner_H.map, ZM_Banner_H.x, ZM_Banner_H.y, ZM_Banner_H.z, ZM_Banner_H.o, ZM_Banner_H.rot0, ZM_Banner_H.rot1, ZM_Banner_H.rot2, ZM_Banner_H.rot3);
|
||||
sObjectMgr->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE); // rem gy
|
||||
sObjectMgr->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE, false); // add gy
|
||||
sGraveyard->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE); // rem gy
|
||||
sGraveyard->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE, false); // add gy
|
||||
m_PvP->TeamApplyBuff(TEAM_HORDE, ZM_CAPTURE_BUFF, 0, player);
|
||||
player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
|
||||
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H));
|
||||
|
||||
Reference in New Issue
Block a user