Core/Entities: Phase Rework (main commit)
This commit is contained in:
1 parent
4a268b3fd3
commit
e44bb5f387
79 files changed
+1738
-851
No files matched your search
@@ -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());
|
||||
|
||||
@@ -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,
|
||||
@@ -282,20 +282,7 @@ public:
|
||||
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
|
||||
{
|
||||
@@ -1611,7 +1599,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);
|
||||
|
||||
@@ -1643,7 +1630,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
|
||||
@@ -1830,9 +1816,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;
|
||||
|
||||
Reference in new issue
Block a user