Merge branch '4.3.4' of https://github.com/Ovahlord/TrinityCore into 4.3.4

This commit is contained in:
Ovalord committed 2018-03-15 17:21:39 +01:00
commit e0d987fa37
210 files changed
+5236 -1764

No files matched your search

+8 -16
View File
@@ -24,6 +24,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "PhasingHandler.h"
#include "BattlefieldMgr.h"
#include "BattlegroundMgr.h"
#include "Chat.h"
@@ -979,7 +980,7 @@ public:
return false;
}
v->CopyPhaseFrom(handler->GetSession()->GetPlayer());
PhasingHandler::InheritPhaseShift(v, handler->GetSession()->GetPlayer());
map->AddToMap(v->ToCreature());
@@ -1008,22 +1009,20 @@ public:
if (!t)
return false;
std::set<uint32> terrainswap;
std::set<uint32> phaseId;
std::set<uint32> worldMapSwap;
PhaseShift phaseShift;
if (uint32 ut = (uint32)atoi(t))
terrainswap.insert(ut);
phaseShift.AddVisibleMapId(ut, nullptr);
if (p)
if (uint32 up = (uint32)atoi(p))
phaseId.insert(up);
phaseShift.AddPhase(up, PhaseFlags::None, nullptr);
if (m)
if (uint32 um = (uint32)atoi(m))
worldMapSwap.insert(um);
phaseShift.AddUiWorldMapAreaIdSwap(um);
handler->GetSession()->SendSetPhaseShift(phaseId, terrainswap, worldMapSwap);
PhasingHandler::SendToPlayer(handler->GetSession()->GetPlayer(), phaseShift);
return true;
}
@@ -1462,15 +1461,8 @@ public:
std::stringstream phases;
for (uint32 phase : target->GetPhases())
{
phases << phase << " ";
}
PhasingHandler::PrintToChat(handler, target->GetPhaseShift());
if (!phases.str().empty())
handler->PSendSysMessage("Target's current phases: %s", phases.str().c_str());
else
handler->SendSysMessage("Target is not phased");
return true;
}
+4 -3
View File
@@ -24,6 +24,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "PhasingHandler.h"
#include "MapManager.h"
#include "TicketMgr.h"
#include "Chat.h"
@@ -245,7 +246,7 @@ public:
player->SaveRecallPosition();
Map const* map = sMapMgr->CreateBaseMap(mapId);
float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
float z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y));
player->TeleportTo(mapId, x, y, z, player->GetOrientation());
return true;
@@ -465,7 +466,7 @@ public:
else
player->SaveRecallPosition();
float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
float z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y));
player->TeleportTo(zoneEntry->mapid, x, y, z, player->GetOrientation());
return true;
@@ -513,7 +514,7 @@ public:
return false;
}
Map const* map = sMapMgr->CreateBaseMap(mapId);
z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y));
z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y));
}
// stop flight if need
+2 -1
View File
@@ -31,6 +31,7 @@ EndScriptData */
#include "Language.h"
#include "Player.h"
#include "Opcodes.h"
#include "PhasingHandler.h"
class gobject_commandscript : public CommandScript
{
@@ -147,7 +148,7 @@ public:
return false;
}
object->CopyPhaseFrom(player);
PhasingHandler::InheritPhaseShift(object, player);
if (spawntimeSecs)
{
+4 -4
View File
@@ -21,6 +21,7 @@
#include "LFG.h"
#include "Player.h"
#include "ObjectMgr.h"
#include "PhasingHandler.h"
#include "GroupMgr.h"
#include "ScriptMgr.h"
@@ -331,7 +332,6 @@ public:
{
// Get ALL the variables!
Player* playerTarget;
uint32 phase = 0;
ObjectGuid guidTarget;
std::string nameTarget;
std::string zoneName;
@@ -412,11 +412,12 @@ public:
// Check if iterator is online. If is...
Player* p = ObjectAccessor::FindPlayer((*itr).guid);
std::string phases;
if (p)
{
// ... than, it prints information like "is online", where he is, etc...
onlineState = "online";
phase = (!p->IsGameMaster() ? p->GetPhaseMask() : -1);
phases = PhasingHandler::FormatPhases(p->GetPhaseShift());
LocaleConstant localeConstant = handler->GetSessionDbcLocale();
AreaTableEntry const* area = sAreaTableStore.LookupEntry(p->GetAreaId());
@@ -432,12 +433,11 @@ public:
// ... else, everything is set to offline or neutral values.
zoneName = "<ERROR>";
onlineState = "Offline";
phase = 0;
}
// Now we can print those informations for every single member of each group!
handler->PSendSysMessage(LANG_GROUP_PLAYER_NAME_GUID, slot.name.c_str(), onlineState,
zoneName.c_str(), phase, slot.guid.GetCounter(), flags.c_str(),
zoneName.c_str(), phases.c_str(), slot.guid.GetCounter(), flags.c_str(),
lfg::GetRolesString(slot.roles).c_str());
}
+14 -28
View File
@@ -32,6 +32,7 @@
#include "WeatherMgr.h"
#include "Player.h"
#include "Pet.h"
#include "PhasingHandler.h"
#include "LFG.h"
#include "GroupMgr.h"
#include "MMapFactory.h"
@@ -238,8 +239,8 @@ public:
Map2ZoneCoordinates(zoneX, zoneY, zoneId);
Map const* map = object->GetMap();
float groundZ = map->GetHeight(object->GetPhases(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
float floorZ = map->GetHeight(object->GetPhases(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
float groundZ = map->GetHeight(object->GetPhaseShift(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT);
float floorZ = map->GetHeight(object->GetPhaseShift(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ());
GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY());
@@ -248,11 +249,11 @@ public:
uint32 haveMap = Map::ExistMap(mapId, gridX, gridY) ? 1 : 0;
uint32 haveVMap = Map::ExistVMap(mapId, gridX, gridY) ? 1 : 0;
uint32 haveMMap = (DisableMgr::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps())) ? 1 : 0;
uint32 haveMMap = (DisableMgr::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) ? 1 : 0;
if (haveVMap)
{
if (map->IsOutdoors(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()))
if (map->IsOutdoors(object->GetPhaseShift(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()))
handler->PSendSysMessage(LANG_GPS_POSITION_OUTDOORS);
else
handler->PSendSysMessage(LANG_GPS_POSITION_INDOORS);
@@ -266,7 +267,6 @@ public:
mapId, (mapEntry ? mapEntry->name : unknown),
zoneId, (zoneEntry ? zoneEntry->area_name : unknown),
areaId, (areaEntry ? areaEntry->area_name : unknown),
object->GetPhaseMask(), StringJoin(object->GetPhases(), ", ").c_str(),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation());
if (Transport* transport = object->GetTransport())
handler->PSendSysMessage(LANG_TRANSPORT_POSITION,
@@ -277,25 +277,12 @@ public:
zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap, haveMMap);
LiquidData liquidStatus;
ZLiquidStatus status = map->GetLiquidStatus(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus);
ZLiquidStatus status = map->GetLiquidStatus(object->GetPhaseShift(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), MAP_ALL_LIQUIDS, &liquidStatus);
if (status)
handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status);
if (!object->GetTerrainSwaps().empty())
{
std::stringstream ss;
for (uint32 swap : object->GetTerrainSwaps())
ss << swap << " ";
handler->PSendSysMessage("Target's active terrain swaps: %s", ss.str().c_str());
}
if (!object->GetWorldMapAreaSwaps().empty())
{
std::stringstream ss;
for (uint32 swap : object->GetWorldMapAreaSwaps())
ss << swap << " ";
handler->PSendSysMessage("Target's active world map area swaps: %s", ss.str().c_str());
}
PhasingHandler::PrintToChat(handler, object->GetPhaseShift());
return true;
}
@@ -453,8 +440,8 @@ public:
target->GetContactPoint(_player, x, y, z);
_player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
_player->CopyPhaseFrom(target, true);
PhasingHandler::InheritPhaseShift(_player, target);
_player->UpdateObjectVisibility();
}
else
{
@@ -584,7 +571,8 @@ public:
float x, y, z;
_player->GetClosePoint(x, y, z, target->GetObjectSize());
target->TeleportTo(_player->GetMapId(), x, y, z, target->GetOrientation());
target->SetPhaseMask(_player->GetPhaseMask(), true);
PhasingHandler::InheritPhaseShift(target, handler->GetSession()->GetPlayer());
target->UpdateObjectVisibility();
}
else
{
@@ -1608,7 +1596,6 @@ public:
// Position data print
uint32 mapId;
uint32 areaId;
std::set<uint32> phases;
std::string areaName = handler->GetTrinityString(LANG_UNKNOWN);
std::string zoneName = handler->GetTrinityString(LANG_UNKNOWN);
@@ -1640,7 +1627,6 @@ public:
areaId = target->GetAreaId();
alive = target->IsAlive() ? handler->GetTrinityString(LANG_YES) : handler->GetTrinityString(LANG_NO);
gender = target->getGender();
phases = target->GetPhases();
}
// get additional information from DB
else
@@ -1827,9 +1813,9 @@ public:
// Output XII. LANG_PINFO_CHR_ALIVE
handler->PSendSysMessage(LANG_PINFO_CHR_ALIVE, alive.c_str());
// Output XIII. LANG_PINFO_CHR_PHASES
if (target && !phases.empty())
handler->PSendSysMessage(LANG_PINFO_CHR_PHASES, StringJoin(phases, ", ").c_str());
// Output XIII. phases
if (target)
PhasingHandler::PrintToChat(handler, target->GetPhaseShift());
// Output XIV. LANG_PINFO_CHR_MONEY
uint32 gold = money / GOLD;
+16 -11
View File
@@ -30,6 +30,7 @@
#include "Player.h"
#include "PointMovementGenerator.h"
#include "PathGenerator.h"
#include "PhasingHandler.h"
#include "MMapFactory.h"
#include "Map.h"
#include "TargetedMovementGenerator.h"
@@ -62,7 +63,7 @@ public:
static bool HandleMmapPathCommand(ChatHandler* handler, char const* args)
{
if (!MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps()))
if (!MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()))
{
handler->PSendSysMessage("NavMesh not loaded for current map.");
return true;
@@ -130,12 +131,16 @@ public:
int32 gx = 32 - player->GetPositionX() / SIZE_OF_GRIDS;
int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS;
float x, y, z;
player->GetPosition(x, y, z);
handler->PSendSysMessage("%03u%02i%02i.mmtile", player->GetMapId(), gx, gy);
handler->PSendSysMessage("gridloc [%i, %i]", gy, gx);
// calculate navmesh tile location
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps());
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(handler->GetSession()->GetPlayer()->GetMapId(), player->GetInstanceId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps());
uint32 terrainMapId = PhasingHandler::GetTerrainMapId(player->GetPhaseShift(), player->GetMap(), x, y);
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(terrainMapId);
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(terrainMapId, player->GetInstanceId());
if (!navmesh || !navmeshquery)
{
handler->PSendSysMessage("NavMesh not loaded for current map.");
@@ -143,8 +148,6 @@ public:
}
float const* min = navmesh->getParams()->orig;
float x, y, z;
player->GetPosition(x, y, z);
float location[VERTEX_SIZE] = { y, z, x };
float extents[VERTEX_SIZE] = { 3.0f, 5.0f, 3.0f };
@@ -185,9 +188,10 @@ public:
static bool HandleMmapLoadedTilesCommand(ChatHandler* handler, char const* /*args*/)
{
uint32 mapid = handler->GetSession()->GetPlayer()->GetMapId();
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(mapid, handler->GetSession()->GetPlayer()->GetTerrainSwaps());
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(mapid, handler->GetSession()->GetPlayer()->GetInstanceId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps());
Player* player = handler->GetSession()->GetPlayer();
uint32 terrainMapId = PhasingHandler::GetTerrainMapId(player->GetPhaseShift(), player->GetMap(), player->GetPositionX(), player->GetPositionY());
dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(terrainMapId);
dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(terrainMapId, player->GetInstanceId());
if (!navmesh || !navmeshquery)
{
handler->PSendSysMessage("NavMesh not loaded for current map.");
@@ -210,14 +214,15 @@ public:
static bool HandleMmapStatsCommand(ChatHandler* handler, char const* /*args*/)
{
uint32 mapId = handler->GetSession()->GetPlayer()->GetMapId();
Player* player = handler->GetSession()->GetPlayer();
uint32 terrainMapId = PhasingHandler::GetTerrainMapId(player->GetPhaseShift(), player->GetMap(), player->GetPositionX(), player->GetPositionY());
handler->PSendSysMessage("mmap stats:");
handler->PSendSysMessage(" global mmap pathfinding is %sabled", DisableMgr::IsPathfindingEnabled(mapId) ? "en" : "dis");
handler->PSendSysMessage(" global mmap pathfinding is %sabled", DisableMgr::IsPathfindingEnabled(player->GetMapId()) ? "en" : "dis");
MMAP::MMapManager* manager = MMAP::MMapFactory::createOrGetMMapManager();
handler->PSendSysMessage(" %u maps loaded with %u tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount());
dtNavMesh const* navmesh = manager->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId(), handler->GetSession()->GetPlayer()->GetTerrainSwaps());
dtNavMesh const* navmesh = manager->GetNavMesh(terrainMapId);
if (!navmesh)
{
handler->PSendSysMessage("NavMesh not loaded for current map.");
+33 -7
View File
@@ -27,6 +27,7 @@ EndScriptData */
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "Pet.h"
#include "PhasingHandler.h"
#include "Player.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
@@ -828,9 +829,18 @@ public:
if (!*args)
return false;
uint32 phaseId = uint32(atoul(args));
char* phaseText = strtok((char*)args, " ");
if (!phaseText)
return false;
if (!sPhaseStore.LookupEntry(phaseId))
uint32 phaseId = uint32(strtoul(phaseText, nullptr, 10));
uint32 visibleMapId = 0;
char* visibleMapIdText = strtok(nullptr, " ");
if (visibleMapIdText)
visibleMapId = uint32(strtoul(visibleMapIdText, nullptr, 10));
if (phaseId && !sPhaseStore.LookupEntry(phaseId))
{
handler->SendSysMessage(LANG_PHASE_NOTFOUND);
handler->SetSentErrorMessage(true);
@@ -838,13 +848,29 @@ public:
}
Unit* target = handler->getSelectedUnit();
if (!target)
target = handler->GetSession()->GetPlayer();
if (visibleMapId)
{
MapEntry const* visibleMap = sMapStore.LookupEntry(visibleMapId);
if (!visibleMap || visibleMap->rootPhaseMap != int32(target->GetMapId()))
{
handler->SendSysMessage(LANG_PHASE_NOTFOUND);
handler->SetSentErrorMessage(true);
return false;
}
target->SetInPhase(phaseId, true, !target->IsInPhase(phaseId));
if (!target->GetPhaseShift().HasVisibleMapId(visibleMapId))
PhasingHandler::AddVisibleMapId(target, visibleMapId);
else
PhasingHandler::RemoveVisibleMapId(target, visibleMapId);
}
if (target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->SendUpdatePhasing();
if (phaseId)
{
if (!target->GetPhaseShift().HasPhase(phaseId))
PhasingHandler::AddPhase(target, phaseId, true);
else
PhasingHandler::RemovePhase(target, phaseId, true);
}
return true;
}
+8 -22
View File
@@ -32,6 +32,7 @@ EndScriptData */
#include "CreatureAI.h"
#include "Player.h"
#include "Pet.h"
#include "PhasingHandler.h"
template<typename E, typename T = char const*>
struct EnumName
@@ -287,8 +288,7 @@ public:
return false;
}
//creature->CopyPhaseFrom(chr); // creature is not directly added to world, only to db, so this is useless here
PhasingHandler::InheritPhaseShift(creature, chr);
creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
ObjectGuid::LowType db_guid = creature->GetSpawnId();
@@ -718,18 +718,8 @@ public:
if (CreatureData const* data = sObjectMgr->GetCreatureData(target->GetSpawnId()))
{
handler->PSendSysMessage(LANG_NPCINFO_PHASES, data->phaseid, data->phaseGroup);
if (data->phaseGroup)
{
std::set<uint32> _phases = target->GetPhases();
if (!_phases.empty())
{
handler->PSendSysMessage(LANG_NPCINFO_PHASE_IDS);
for (uint32 phaseId : _phases)
handler->PSendSysMessage("%u", phaseId);
}
}
handler->PSendSysMessage(LANG_NPCINFO_PHASES, data->phaseId, data->phaseGroup);
PhasingHandler::PrintToChat(handler, target->GetPhaseShift());
}
handler->PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor());
@@ -1078,12 +1068,8 @@ public:
return false;
}
creature->ClearPhases();
for (uint32 id : GetPhasesForGroup(phaseGroupId))
creature->SetInPhase(id, false, true); // don't send update here for multiple phases, only send it once after adding all phases
creature->UpdateObjectVisibility();
PhasingHandler::ResetPhaseShift(creature);
PhasingHandler::AddPhaseGroup(creature, phaseGroupId, true);
creature->SetDBPhase(-int(phaseGroupId));
creature->SaveToDB();
@@ -1114,8 +1100,8 @@ public:
return false;
}
creature->ClearPhases();
creature->SetInPhase(phaseID, true, true);
PhasingHandler::ResetPhaseShift(creature);
PhasingHandler::AddPhase(creature, phaseID, true);
creature->SetDBPhase(phaseID);
creature->SaveToDB();
@@ -1142,15 +1142,6 @@ public:
return true;
}
static bool HandleReloadPhaseDefinitionsCommand(ChatHandler* handler, const char* /*args*/)
{
TC_LOG_INFO("misc", "Reloading terrain_phase_info table...");
sObjectMgr->LoadTerrainPhaseInfo();
handler->SendGlobalGMSysMessage("Terrain phase infos reloaded.");
return true;
}
static bool HandleReloadRBACCommand(ChatHandler* handler, const char* /*args*/)
{
TC_LOG_INFO("misc", "Reloading RBAC tables...");
+151 -5
View File
@@ -22,16 +22,31 @@ Comment: All server related commands
Category: commandscripts
EndScriptData */
#include "ScriptMgr.h"
#include "Chat.h"
#include "Config.h"
#include "DatabaseEnv.h"
#include "DatabaseLoader.h"
#include "GameTime.h"
#include "GitRevision.h"
#include "Language.h"
#include "Log.h"
#include "ObjectAccessor.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "GitRevision.h"
#include "Util.h"
#include "GameTime.h"
#include "RBAC.h"
#include "Realm.h"
#include "UpdateTime.h"
#include "Util.h"
#include "VMapFactory.h"
#include "World.h"
#include "WorldSession.h"
#include <numeric>
#include <boost/filesystem/operations.hpp>
#include <mysql_version.h>
#include <openssl/crypto.h>
#include <openssl/opensslv.h>
class server_commandscript : public CommandScript
{
@@ -77,6 +92,7 @@ public:
static std::vector<ChatCommand> serverCommandTable =
{
{ "corpses", rbac::RBAC_PERM_COMMAND_SERVER_CORPSES, true, &HandleServerCorpsesCommand, "" },
{ "debug", rbac::RBAC_PERM_COMMAND_SERVER_DEBUG, true, &HandleServerDebugCommand, "" },
{ "exit", rbac::RBAC_PERM_COMMAND_SERVER_EXIT, true, &HandleServerExitCommand, "" },
{ "idlerestart", rbac::RBAC_PERM_COMMAND_SERVER_IDLERESTART, true, nullptr, "", serverIdleRestartCommandTable },
{ "idleshutdown", rbac::RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN, true, nullptr, "", serverIdleShutdownCommandTable },
@@ -102,6 +118,136 @@ public:
return true;
}
static bool HandleServerDebugCommand(ChatHandler* handler, char const* /*args*/)
{
uint16 worldPort = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
std::string dbPortOutput;
{
uint16 dbPort = 0;
if (QueryResult res = LoginDatabase.PQuery("SELECT port FROM realmlist WHERE id = %u", realm.Id.Realm))
dbPort = (*res)[0].GetUInt16();
if (dbPort)
dbPortOutput = Trinity::StringFormat("Realmlist (Realm Id: %u) configured in port %" PRIu16, realm.Id.Realm, dbPort);
else
dbPortOutput = Trinity::StringFormat("Realm Id: %u not found in `realmlist` table. Please check your setup", realm.Id.Realm);
}
handler->PSendSysMessage("%s", GitRevision::GetFullVersion());
handler->PSendSysMessage("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
handler->PSendSysMessage("Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
handler->PSendSysMessage("Using MySQL version: %s", MYSQL_SERVER_VERSION);
handler->PSendSysMessage("Using CMake version: %s", GitRevision::GetCMakeVersion());
handler->PSendSysMessage("Compiled on: %s", GitRevision::GetHostOSVersion());
uint32 updateFlags = sConfigMgr->GetIntDefault("Updates.EnableDatabases", DatabaseLoader::DATABASE_NONE);
if (!updateFlags)
handler->SendSysMessage("Automatic database updates are disabled for all databases!");
else
{
static char const* const databaseNames[3 /*TOTAL_DATABASES*/] =
{
"Auth",
"Characters",
"World"
};
std::string availableUpdateDatabases;
for (uint32 i = 0; i < 3 /* TOTAL_DATABASES*/; ++i)
{
if (!(updateFlags & (1 << i)))
continue;
availableUpdateDatabases += databaseNames[i];
if (i != 3 /*TOTAL_DATABASES*/ - 1)
availableUpdateDatabases += ", ";
}
handler->PSendSysMessage("Automatic database updates are enabled for the following databases: %s", availableUpdateDatabases.c_str());
}
handler->PSendSysMessage("Worldserver listening connections on port %" PRIu16, worldPort);
handler->PSendSysMessage("%s", dbPortOutput.c_str());
bool vmapIndoorCheck = sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK);
bool vmapLOSCheck = VMAP::VMapFactory::createOrGetVMapManager()->isLineOfSightCalcEnabled();
bool vmapHeightCheck = VMAP::VMapFactory::createOrGetVMapManager()->isHeightCalcEnabled();
bool mmapEnabled = sWorld->getBoolConfig(CONFIG_ENABLE_MMAPS);
std::string dataDir = sWorld->GetDataPath();
std::vector<std::string> subDirs;
subDirs.emplace_back("maps");
if (vmapIndoorCheck || vmapLOSCheck || vmapHeightCheck)
{
handler->PSendSysMessage("VMAPs status: Enabled. LineOfSight: %i, getHeight: %i, indoorCheck: %i", vmapLOSCheck, vmapHeightCheck, vmapIndoorCheck);
subDirs.emplace_back("vmaps");
}
else
handler->SendSysMessage("VMAPs status: Disabled");
if (mmapEnabled)
{
handler->SendSysMessage("MMAPs status: Enabled");
subDirs.emplace_back("mmaps");
}
else
handler->SendSysMessage("MMAPs status: Disabled");
for (std::string const& subDir : subDirs)
{
boost::filesystem::path mapPath(dataDir);
mapPath.append(subDir);
if (!boost::filesystem::exists(mapPath))
{
handler->PSendSysMessage("%s directory doesn't exist!. Using path: %s", subDir.c_str(), mapPath.generic_string().c_str());
continue;
}
auto end = boost::filesystem::directory_iterator();
std::size_t folderSize = std::accumulate(boost::filesystem::directory_iterator(mapPath), end, std::size_t(0), [](std::size_t val, boost::filesystem::path const& mapFile)
{
if (boost::filesystem::is_regular_file(mapFile))
val += boost::filesystem::file_size(mapFile);
return val;
});
handler->PSendSysMessage("%s directory located in %s. Total size: " SZFMTD " bytes", subDir.c_str(), mapPath.generic_string().c_str(), folderSize);
}
LocaleConstant defaultLocale = sWorld->GetDefaultDbcLocale();
uint32 availableLocalesMask = (1 << defaultLocale);
for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
{
LocaleConstant locale = static_cast<LocaleConstant>(i);
if (locale == defaultLocale)
continue;
if (sWorld->GetAvailableDbcLocale(locale) != defaultLocale)
availableLocalesMask |= (1 << locale);
}
std::string availableLocales;
for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
{
if (!(availableLocalesMask & (1 << i)))
continue;
availableLocales += localeNames[i];
if (i != TOTAL_LOCALES - 1)
availableLocales += " ";
}
handler->PSendSysMessage("Using %s DBC Locale as default. All available DBC locales: %s", localeNames[defaultLocale], availableLocales.c_str());
handler->PSendSysMessage("Using World DB: %s", sWorld->GetDBVersion());
return true;
}
static bool HandleServerInfoCommand(ChatHandler* handler, char const* /*args*/)
{
uint32 playersNum = sWorld->GetPlayerCount();
@@ -113,7 +259,7 @@ public:
std::string uptime = secsToTimeString(GameTime::GetUptime());
uint32 updateTime = sWorldUpdateTime.GetLastUpdateTime();
handler->SendSysMessage(GitRevision::GetFullVersion());
handler->PSendSysMessage("%s", GitRevision::GetFullVersion());
handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum);
handler->PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
handler->PSendSysMessage(LANG_UPTIME, uptime.c_str());
+2 -1
View File
@@ -27,6 +27,7 @@ EndScriptData */
#include "Language.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "PhasingHandler.h"
#include "Player.h"
#include "ScriptMgr.h"
@@ -202,7 +203,7 @@ public:
SQLTransaction dummy;
Player::SavePositionInDB(WorldLocation(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation),
sMapMgr->GetZoneId(tele->mapId, tele->position_x, tele->position_y, tele->position_z), target_guid, dummy);
sMapMgr->GetZoneId(PhasingHandler::GetEmptyPhaseShift(), tele->mapId, tele->position_x, tele->position_y, tele->position_z), target_guid, dummy);
}
return true;
+5 -4
View File
@@ -25,6 +25,7 @@ EndScriptData */
#include "Chat.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "PhasingHandler.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "WaypointManager.h"
@@ -667,7 +668,7 @@ public:
return false;
}
wpCreature->CopyPhaseFrom(chr);
PhasingHandler::InheritPhaseShift(wpCreature, chr);
wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
@@ -881,7 +882,7 @@ public:
return false;
}
wpCreature->CopyPhaseFrom(chr);
PhasingHandler::InheritPhaseShift(wpCreature, chr);
// Set "wpguid" column to the visual waypoint
stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID);
@@ -945,7 +946,7 @@ public:
return false;
}
creature->CopyPhaseFrom(chr);
PhasingHandler::InheritPhaseShift(creature, chr);
creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
if (!creature->LoadCreatureFromDB(creature->GetSpawnId(), map))
@@ -996,7 +997,7 @@ public:
return false;
}
creature->CopyPhaseFrom(chr);
PhasingHandler::InheritPhaseShift(creature, chr);
creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
if (!creature->LoadCreatureFromDB(creature->GetSpawnId(), map))
@@ -334,14 +334,14 @@ class boss_foe_reaper_5000 : public CreatureScript
Trinity::NormalizeMapCoord(destX);
Trinity::NormalizeMapCoord(destY);
travelDistZ = 10.0f;
destZ = map->GetHeight(me->GetPhases(), destX, destY, respZ + travelDistZ - 2.0f, false);
destZ = map->GetHeight(me->GetPhaseShift(), destX, destY, respZ + travelDistZ - 2.0f, false);
if (std::fabs(destZ - respZ) > travelDistZ)
{
destZ = map->GetHeight(me->GetPhases(), destX, destY, respZ - 2.0f, true);
destZ = map->GetHeight(me->GetPhaseShift(), destX, destY, respZ - 2.0f, true);
if (std::fabs(destZ - respZ) > travelDistZ)
{
destZ = map->GetHeight(me->GetPhases(), destX, destY, respZ + travelDistZ - 2.0f, true);
destZ = map->GetHeight(me->GetPhaseShift(), destX, destY, respZ + travelDistZ - 2.0f, true);
if (std::fabs(destZ - respZ) > travelDistZ)
return;
@@ -24,6 +24,7 @@
#include "ScriptedEscortAI.h"
#include "CombatAI.h"
#include "PassiveAI.h"
#include "PhasingHandler.h"
#include "Player.h"
#include "SpellInfo.h"
#include "CreatureTextMgr.h"
@@ -367,14 +368,12 @@ class npc_josiah_avery : public CreatureScript
struct npc_josiah_averyAI : public PassiveAI
{
npc_josiah_averyAI(Creature* creature) : PassiveAI(creature)
{
}
npc_josiah_averyAI(Creature* creature) : PassiveAI(creature) { }
void IsSummonedBy(Unit* summoner) override
{
me->SetInPhase(PHASE_ID_SUMMON, false, false);
me->SetInPhase(PHASE_ID_WOUND, false, true);
PhasingHandler::AddPhase(me, PHASE_ID_SUMMON, true);
PhasingHandler::AddPhase(me, PHASE_ID_WOUND, true);
_playerGuid = summoner->GetGUID();
_events.ScheduleEvent(EVENT_COSMETIC_ATTACK, Milliseconds(500));
}
@@ -1172,7 +1172,7 @@ public:
float x, y, z;
me->GetPosition(x, y, z);
z = me->GetMap()->GetHeight(me->GetPhases(), x, y, z);
z = me->GetMap()->GetHeight(me->GetPhaseShift(), x, y, z);
me->GetMotionMaster()->MovePoint(0, x, y, z);
me->SetPosition(x, y, z, 0);
}
@@ -1290,7 +1290,7 @@ public:
{
float x, y, z;
me->GetPosition(x, y, z);
z = me->GetMap()->GetHeight(me->GetPhases(), x, y, z);
z = me->GetMap()->GetHeight(me->GetPhaseShift(), x, y, z);
me->GetMotionMaster()->MovePoint(0, x, y, z);
me->SetPosition(x, y, z, 0);
hyjal_trashAI::JustDied(killer);
@@ -270,7 +270,7 @@ public:
Position pos = me->GetRandomNearPosition(10.0f);
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
pos.m_positionZ = std::max(me->GetMap()->GetHeight(me->GetPhaseShift(), pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(me->GetPhaseShift(), pos.m_positionX, pos.m_positionY));
if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
return summon;
@@ -305,7 +305,7 @@ public:
Position pos = me->GetRandomNearPosition(10.0f);
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
pos.m_positionZ = std::max(me->GetMap()->GetHeight(me->GetPhaseShift(), pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(me->GetPhaseShift(), pos.m_positionX, pos.m_positionY));
if (Unit* Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
if (Unit* temp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_MEDIVH)))
@@ -543,7 +543,7 @@ public:
float x = caster->GetPositionX() + dist * std::cos(angle);
float y = caster->GetPositionY() + dist * std::sin(angle);
float z = caster->GetMap()->GetHeight(caster->GetPhases(), x, y, caster->GetPositionZ());
float z = caster->GetMap()->GetHeight(caster->GetPhaseShift(), x, y, caster->GetPositionZ());
const_cast<WorldLocation*>(GetExplTargetDest())->Relocate(x, y, z);
GetHitDest()->Relocate(x, y, z);
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "lost_city_of_the_tolvir.h"
#include "ObjectMgr.h"
#include "PhasingHandler.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
@@ -290,8 +291,7 @@ public:
if (Creature* barim = _instance->GetCreature(DATA_HIGH_PROPHET_BARIM))
barim->AI()->JustSummoned(me);
for (uint32 id : GetPhasesForGroup(PHASE_GROUP_ENCOUNTER_1))
me->SetInPhase(id, false, true);
PhasingHandler::AddPhaseGroup(me, PHASE_GROUP_ENCOUNTER_1, true);
DoCastSelf(SPELL_REPENTANCE_SCRIPT_1, true);
_events.ScheduleEvent(EVENT_COPY_WEAPON, Seconds(2));
@@ -440,7 +440,7 @@ public:
me->SetReactState(REACT_PASSIVE);
DoZoneInCombat();
DoCastSelf(SPELL_BIRTH, true);
me->SetInPhase(PHASE_ID_REPENTANCE, true, false);
PhasingHandler::AddPhase(me, PHASE_ID_REPENTANCE, true);
}
void JustEngagedWith(Unit* /*who*/) override
@@ -456,8 +456,7 @@ public:
if (Creature* barim = _instance->GetCreature(DATA_HIGH_PROPHET_BARIM))
barim->AI()->JustSummoned(summon);
for (uint32 id : GetPhasesForGroup(PHASE_GROUP_ENCOUNTER_1))
summon->SetInPhase(id, false, true);
PhasingHandler::AddPhaseGroup(summon, PHASE_GROUP_ENCOUNTER_1, true);
}
void JustDied(Unit* /*killer*/) override
@@ -285,7 +285,7 @@ class boss_high_priestess_azil : public CreatureScript
me->RemoveAurasDueToSpell(SPELL_EARTH_FURY_CASTING_VISUAL);
me->RemoveAurasDueToSpell(SPELL_EARTH_FURY_ENERGY_SHIELD);
Position pos = me->GetPosition();
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhases(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhaseShift(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
me->GetMotionMaster()->MovePoint(POINT_GROUND, pos);
break;
}
@@ -266,7 +266,7 @@ class boss_slabhide : public CreatureScript
case EVENT_LAND:
{
Position pos = me->GetPosition();
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhases(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhaseShift(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ());
me->GetMotionMaster()->MoveLand(POINT_SLABHIDE_LAND, pos);
break;
}
@@ -479,7 +479,7 @@ public:
{
Unit* caster = GetCaster();
Position pos = caster->GetPosition();
pos.m_positionZ = caster->GetMap()->GetHeight(caster->GetPhases(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, 100.0f);
pos.m_positionZ = caster->GetMap()->GetHeight(caster->GetPhaseShift(), pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), true, 100.0f);
dest.Relocate(pos);
}
@@ -88,7 +88,7 @@ class boss_amanitar : public CreatureScript
for (uint8 i = 0; i < 30; ++i)
{
Position pos = me->GetRandomNearPosition(30.0f);
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhases(), pos.GetPositionX(), pos.GetPositionY(), MAX_HEIGHT) + 2.0f;
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhaseShift(), pos.GetPositionX(), pos.GetPositionY(), MAX_HEIGHT) + 2.0f;
if (Creature* trigger = me->SummonCreature(NPC_TRIGGER, pos))
{
@@ -22,6 +22,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ahnkahet.h"
#include "PhasingHandler.h"
#include "Player.h"
#include "SpellInfo.h"
@@ -142,7 +143,7 @@ public:
// clone
player->CastSpell(summon, SPELL_CLONE_PLAYER, true);
// phase the summon
summon->SetInPhase(spellInfo->Effects[EFFECT_0].MiscValueB, true, true);
PhasingHandler::AddPhase(summon, spellInfo->Effects[EFFECT_0].MiscValueB, true);
}
}
++insanityHandled;
@@ -168,9 +169,9 @@ public:
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_QUICK_DEMISE_START_EVENT);
// Visible for all players in insanity
me->SetInPhase(169, true, true);
for (uint32 i = 173; i <= 177; ++i)
me->SetInPhase(i, true, true);
PhasingHandler::AddPhase(me, i, false);
PhasingHandler::AddPhase(me, 169, true);
ResetPlayersPhase();
@@ -208,7 +209,7 @@ public:
return;
else
{
nextPhase = *visage->GetPhases().begin();
nextPhase = visage->GetPhaseShift().GetPhases().begin()->Id;
break;
}
}
@@ -627,7 +627,7 @@ class npc_frost_sphere : public CreatureScript
if (me->GetHealth() <= damage)
{
damage = 0;
float floorZ = me->GetMap()->GetHeight(me->GetPhases(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
float floorZ = me->GetMap()->GetHeight(me->GetPhaseShift(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
if (fabs(me->GetPositionZ() - floorZ) < 0.1f)
{
// we are close to the ground
@@ -804,7 +804,7 @@ class boss_prince_valanar_icc : public CreatureScript
{
float x, y, z;
summon->GetPosition(x, y, z);
float ground_Z = summon->GetMap()->GetHeight(summon->GetPhases(), x, y, z, true, 500.0f);
float ground_Z = summon->GetMap()->GetHeight(summon->GetPhaseShift(), x, y, z, true, 500.0f);
summon->GetMotionMaster()->MovePoint(POINT_KINETIC_BOMB_IMPACT, x, y, ground_Z);
summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
break;
@@ -1046,7 +1046,7 @@ class npc_kinetic_bomb : public CreatureScript
me->SetReactState(REACT_PASSIVE);
me->GetPosition(_x, _y, _groundZ);
me->DespawnOrUnsummon(60000);
_groundZ = me->GetMap()->GetHeight(me->GetPhases(), _x, _y, _groundZ, true, 500.0f);
_groundZ = me->GetMap()->GetHeight(me->GetPhaseShift(), _x, _y, _groundZ, true, 500.0f);
}
void DoAction(int32 action) override
@@ -17,6 +17,7 @@
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "PhasingHandler.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "Cell.h"
@@ -636,7 +637,7 @@ class npc_the_lich_king_controller : public CreatureScript
void JustSummoned(Creature* summon) override
{
// must not be in dream phase
summon->SetInPhase(173, true, false);
PhasingHandler::RemovePhase(summon, 173, true);
if (summon->GetEntry() != NPC_SUPPRESSER)
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
summon->AI()->AttackStart(target);
@@ -294,10 +294,7 @@ class boss_sapphiron : public CreatureScript
events.ScheduleEvent(EVENT_TAIL, randtime(Seconds(7), Seconds(10)), 0, PHASE_GROUND);
return;
case EVENT_DRAIN:
if (events.IsInPhase(PHASE_FLIGHT))
_delayedDrain = true;
else
CastDrain();
CastDrain();
return;
case EVENT_BLIZZARD:
DoCastAOE(SPELL_SUMMON_BLIZZARD);
@@ -399,6 +396,9 @@ class boss_sapphiron : public CreatureScript
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_AGGRESSIVE);
return;
case EVENT_DRAIN:
_delayedDrain = true;
break;
}
}
}
@@ -778,7 +778,7 @@ class boss_flame_leviathan_safety_container : public CreatureScript
{
float x, y, z;
me->GetPosition(x, y, z);
z = me->GetMap()->GetHeight(me->GetPhases(), x, y, z);
z = me->GetMap()->GetHeight(me->GetPhaseShift(), x, y, z);
me->GetMotionMaster()->MovePoint(0, x, y, z);
me->SetPosition(x, y, z, 0);
}
@@ -872,7 +872,7 @@ class boss_sara : public CreatureScript
float angle = frand(0.0f, 2.0f * float(M_PI));
pos.m_positionX = YoggSaronSpawnPos.GetPositionX() + radius * cosf(angle);
pos.m_positionY = YoggSaronSpawnPos.GetPositionY() + radius * sinf(angle);
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhases(), pos.GetPositionX(), pos.GetPositionY(), YoggSaronSpawnPos.GetPositionZ() + 5.0f);
pos.m_positionZ = me->GetMap()->GetHeight(me->GetPhaseShift(), pos.GetPositionX(), pos.GetPositionY(), YoggSaronSpawnPos.GetPositionZ() + 5.0f);
me->SummonCreature(NPC_DEATH_RAY, pos, TEMPSUMMON_TIMED_DESPAWN, 20000);
}
break;
@@ -38,6 +38,7 @@ EndContentData */
#include "ScriptedGossip.h"
#include "ScriptedEscortAI.h"
#include "ScriptedFollowerAI.h"
#include "PhasingHandler.h"
#include "Player.h"
#include "SpellInfo.h"
#include "WorldSession.h"
@@ -1689,7 +1690,7 @@ public:
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
break;
case 20:
me->SetInPhase(170, true, false);
PhasingHandler::RemovePhase(me, 170, true);
Talk(SAY_5);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
@@ -529,7 +529,7 @@ public:
bird->KillSelf();
crunchy->GetMotionMaster()->MovePoint(0, bird->GetPositionX(), bird->GetPositionY(),
bird->GetMap()->GetWaterOrGroundLevel(bird->GetPhases(), bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ()));
bird->GetMap()->GetWaterOrGroundLevel(bird->GetPhaseShift(), bird->GetPositionX(), bird->GetPositionY(), bird->GetPositionZ()));
/// @todo Make crunchy perform emote eat when he reaches the bird
break;
@@ -18,6 +18,7 @@
#include "ScriptMgr.h"
#include "OutdoorPvPSI.h"
#include "WorldPacket.h"
#include "PhasingHandler.h"
#include "Player.h"
#include "GameObject.h"
#include "MapManager.h"
@@ -182,8 +183,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
return true;
}
go->CopyPhaseFrom(player);
PhasingHandler::InheritPhaseShift(go, player);
go->SetRespawnTime(0);
if (!map->AddToMap(go))
@@ -213,8 +213,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
return true;
}
go->CopyPhaseFrom(player);
PhasingHandler::InheritPhaseShift(go, player);
go->SetRespawnTime(0);
if (!map->AddToMap(go))
@@ -75,7 +75,7 @@ public:
void Reset() override
{
ground = me->GetMap()->GetHeight(me->GetPhases(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZMinusOffset());
ground = me->GetMap()->GetHeight(me->GetPhaseShift(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZMinusOffset());
SummonInfernal();
events.ScheduleEvent(EVENT_CAST_SUMMON_INFERNAL, urand(1000, 3000));
}
+10 -18
View File
@@ -84,7 +84,7 @@ enum MageSpells
SPELL_MAGE_IGNITE = 12654,
SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE = 29077,
SPELL_MAGE_PERMAFROST = 91394,
SPELL_MAGE_PYRO_BLAST = 11366,
SPELL_MAGE_PYROBLAST = 11366,
SPELL_MAGE_SCORCH = 2948,
SPELL_MAGE_SLOW = 31589,
SPELL_MAGE_SQUIRREL_FORM = 32813,
@@ -1880,7 +1880,7 @@ class spell_mage_hot_streak : public SpellScriptLoader
SPELL_MAGE_IMPROVED_HOT_STREAK_R1,
SPELL_MAGE_IMPROVED_HOT_STREAK_R2,
SPELL_MAGE_FIREBALL,
SPELL_MAGE_PYRO_BLAST,
SPELL_MAGE_PYROBLAST,
SPELL_MAGE_FIRE_BLAST,
SPELL_MAGE_FROSTFIRE_BOLT,
SPELL_MAGE_SCORCH
@@ -1896,7 +1896,7 @@ class spell_mage_hot_streak : public SpellScriptLoader
switch (eventInfo.GetSpellInfo()->Id)
{
case SPELL_MAGE_FIREBALL:
case SPELL_MAGE_PYRO_BLAST:
case SPELL_MAGE_PYROBLAST:
case SPELL_MAGE_FIRE_BLAST:
case SPELL_MAGE_FROSTFIRE_BOLT:
case SPELL_MAGE_SCORCH:
@@ -1951,7 +1951,7 @@ class spell_mage_improved_hot_streak : public SpellScriptLoader
{
SPELL_MAGE_HOT_STREAK_TRIGGERED,
SPELL_MAGE_FIREBALL,
SPELL_MAGE_PYRO_BLAST,
SPELL_MAGE_PYROBLAST,
SPELL_MAGE_FIRE_BLAST,
SPELL_MAGE_FROSTFIRE_BOLT,
SPELL_MAGE_SCORCH
@@ -1963,7 +1963,7 @@ class spell_mage_improved_hot_streak : public SpellScriptLoader
switch (eventInfo.GetSpellInfo()->Id)
{
case SPELL_MAGE_FIREBALL:
case SPELL_MAGE_PYRO_BLAST:
case SPELL_MAGE_PYROBLAST:
case SPELL_MAGE_FIRE_BLAST:
case SPELL_MAGE_FROSTFIRE_BOLT:
case SPELL_MAGE_SCORCH:
@@ -1974,16 +1974,8 @@ class spell_mage_improved_hot_streak : public SpellScriptLoader
if (criticalStrikesCounter == 2)
{
if (roll_chance_i(GetSpellInfo()->Effects[EFFECT_0].BasePoints))
{
criticalStrikesCounter = 0;
return true;
}
else
{
criticalStrikesCounter = 0;
return false;
}
criticalStrikesCounter = 0;
return roll_chance_i(GetSpellInfo()->Effects[EFFECT_0].BasePoints);
}
}
return false;
@@ -2023,7 +2015,7 @@ class spell_mage_pyroblast : public SpellScriptLoader
return ValidateSpellInfo(
{
SPELL_MAGE_HOT_STREAK_TRIGGERED,
SPELL_MAGE_PYRO_BLAST
SPELL_MAGE_PYROBLAST
});
}
@@ -2035,7 +2027,7 @@ class spell_mage_pyroblast : public SpellScriptLoader
void HandleDamage(SpellEffIndex /*effIndex*/)
{
// Copy the spellpower coefficient from the original pyroblast spell
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_MAGE_PYRO_BLAST))
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_MAGE_PYROBLAST))
{
int32 damage = GetEffectValue();
if (Unit* target = GetHitUnit())
@@ -2051,7 +2043,7 @@ class spell_mage_pyroblast : public SpellScriptLoader
{
if (Unit* target = GetHitUnit())
if (Unit* caster = GetCaster())
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_MAGE_PYRO_BLAST))
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(SPELL_MAGE_PYROBLAST))
if (Aura* aura = target->GetAura(GetSpellInfo()->Id))
aura->GetEffect(EFFECT_1)->SetBonusAmount(caster->SpellDamageBonusDone(target, spell, 0, DOT, EFFECT_1));
}
+46 -24
View File
@@ -1000,36 +1000,57 @@ class spell_q12805_lifeblood_dummy : public SpellScriptLoader
*/
enum BattleStandard
{
NPC_KING_OF_THE_MOUNTAINT_KC = 31766,
NPC_KING_OF_THE_MOUNTAINT_KC = 31766,
SPELL_PLANT_HORDE_BATTLE_STANDARD = 59643,
SPELL_HORDE_BATTLE_STANDARD_STATE = 59642,
SPELL_ALLIANCE_BATTLE_STANDARD_STATE = 4339,
SPELL_JUMP_ROCKET_BLAST = 4340
};
class spell_q13280_13283_plant_battle_standard: public SpellScriptLoader
class spell_q13280_13283_plant_battle_standard : public SpellScript
{
public:
spell_q13280_13283_plant_battle_standard() : SpellScriptLoader("spell_q13280_13283_plant_battle_standard") { }
PrepareSpellScript(spell_q13280_13283_plant_battle_standard);
class spell_q13280_13283_plant_battle_standard_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q13280_13283_plant_battle_standard_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();
uint32 triggeredSpellID = SPELL_ALLIANCE_BATTLE_STANDARD_STATE;
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (caster->IsVehicle())
if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC);
}
caster->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
if (caster->IsVehicle())
if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC);
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q13280_13283_plant_battle_standard_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
if (GetSpellInfo()->Id == SPELL_PLANT_HORDE_BATTLE_STANDARD)
triggeredSpellID = SPELL_HORDE_BATTLE_STANDARD_STATE;
SpellScript* GetSpellScript() const override
{
return new spell_q13280_13283_plant_battle_standard_SpellScript();
}
target->RemoveAllAuras();
target->CastSpell(target, triggeredSpellID, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q13280_13283_plant_battle_standard::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
class spell_q13280_13283_jump_jets : public SpellScript
{
PrepareSpellScript(spell_q13280_13283_jump_jets);
void HandleCast()
{
Unit* caster = GetCaster();
if (caster->IsVehicle())
if (Unit* rocketBunny = caster->GetVehicleKit()->GetPassenger(1))
rocketBunny->CastSpell(rocketBunny, SPELL_JUMP_ROCKET_BLAST, true);
}
void Register() override
{
OnCast += SpellCastFn(spell_q13280_13283_jump_jets::HandleCast);
}
};
enum ChumTheWaterSummons
@@ -2897,7 +2918,8 @@ void AddSC_quest_spell_scripts()
new spell_q12659_ahunaes_knife();
new spell_q9874_liquid_fire();
new spell_q12805_lifeblood_dummy();
new spell_q13280_13283_plant_battle_standard();
RegisterSpellScript(spell_q13280_13283_plant_battle_standard);
RegisterSpellScript(spell_q13280_13283_jump_jets);
new spell_q14112_14145_chum_the_water();
new spell_q9452_cast_net();
new spell_q12279_cast_net();
+1 -1
View File
@@ -3057,7 +3057,7 @@ class npc_mage_orb : public CreatureScript
pos.m_positionX = me->GetPositionX() + cos(pos.GetOrientation()) * 100.0f;
pos.m_positionY = me->GetPositionY() + sin(pos.GetOrientation()) * 100.0f;
float ground;
me->GetMap()->GetWaterOrGroundLevel(me->GetPhases(), pos.GetPositionX(), pos.GetPositionY(), me->GetPositionZ(), &ground);
me->GetMap()->GetWaterOrGroundLevel(me->GetPhaseShift(), pos.GetPositionX(), pos.GetPositionY(), me->GetPositionZ(), &ground);
pos.m_positionZ = ground;
Movement::MoveSplineInit init(me);
init.SetSmooth();