mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core/Entities: Phase Rework (main commit)
This commit is contained in:
@@ -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, 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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...");
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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"
|
||||
@@ -289,8 +290,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));
|
||||
@@ -439,7 +439,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
|
||||
@@ -455,8 +455,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
|
||||
|
||||
@@ -268,7 +268,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);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user