aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp8
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp7
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp9
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp11
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp28
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp4
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp1
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp3
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp6
9 files changed, 50 insertions, 27 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index d0a005f356e..52886d60c4b 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -934,6 +934,9 @@ public:
return false;
}
+ for (auto phase : handler->GetSession()->GetPlayer()->GetPhases())
+ v->SetInPhase(phase, false, true);
+
map->AddToMap(v->ToCreature());
return true;
@@ -962,13 +965,14 @@ public:
std::set<uint32> terrainswap;
std::set<uint32> phaseId;
+ std::set<uint32> worldMapSwap;
terrainswap.insert((uint32)atoi(t));
if (p)
phaseId.insert((uint32)atoi(p));
- handler->GetSession()->SendSetPhaseShift(phaseId, terrainswap);
+ handler->GetSession()->SendSetPhaseShift(phaseId, terrainswap, worldMapSwap);
return true;
}
@@ -1393,7 +1397,7 @@ public:
if (unit && unit->GetTypeId() == TYPEID_PLAYER)
player = unit->ToPlayer();
- player->GetPhaseMgr().SendDebugReportToPlayer(handler->GetSession()->GetPlayer());
+
return true;
}
};
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index e556854c2ab..37961b040b3 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -152,12 +152,15 @@ public:
GameObject* object = new GameObject;
uint32 guidLow = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT);
- if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMgr().GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
+ if (!object->Create(guidLow, objectInfo->entry, map, player->GetPhaseMask(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
{
delete object;
return false;
}
+ for (auto phase : player->GetPhases())
+ object->SetInPhase(phase, false, true);
+
if (spawntimeSecs)
{
uint32 value = atoi((char*)spawntimeSecs);
@@ -165,7 +168,7 @@ public:
}
// fill the gameobject data and save to the db
- object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMgr().GetPhaseMaskForSpawn());
+ object->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), player->GetPhaseMask());
// delete the old object and do a clean load from DB with a fresh new GameObject instance.
// this is required to avoid weird behavior and memory leaks
delete object;
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index d47ee20fac5..83b799f46bb 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -1277,14 +1277,9 @@ public:
Unit* target = handler->getSelectedUnit();
if (target)
- {
- if (target->GetTypeId() == TYPEID_PLAYER)
- target->ToPlayer()->GetPhaseMgr().SetCustomPhase(phasemask);
- else
- target->SetPhaseMask(phasemask, true);
- }
+ target->SetPhaseMask(phasemask, true);
else
- handler->GetSession()->GetPlayer()->GetPhaseMgr().SetCustomPhase(phasemask);
+ handler->GetSession()->GetPlayer()->SetPhaseMask(phasemask, true);
return true;
}
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index fb465aaca16..a46db80600e 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -243,7 +243,7 @@ public:
uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT);
CreatureData& data = sObjectMgr->NewOrExistCreatureData(guid);
data.id = id;
- data.phaseMask = chr->GetPhaseMgr().GetPhaseMaskForSpawn();
+ data.phaseMask = chr->GetPhaseMask();
data.posX = chr->GetTransOffsetX();
data.posY = chr->GetTransOffsetY();
data.posZ = chr->GetTransOffsetZ();
@@ -251,20 +251,23 @@ public:
Creature* creature = trans->CreateNPCPassenger(guid, &data);
- creature->SaveToDB(trans->GetGOInfo()->moTransport.mapID, 1 << map->GetSpawnMode(), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
+ creature->SaveToDB(trans->GetGOInfo()->moTransport.mapID, 1 << map->GetSpawnMode(), chr->GetPhaseMask());
sObjectMgr->AddCreatureToGrid(guid, &data);
return true;
}
Creature* creature = new Creature();
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
{
delete creature;
return false;
}
- creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
+ for (auto phase : chr->GetPhases())
+ creature->SetInPhase(phase, false, true);
+
+ creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
uint32 db_guid = creature->GetDBTableGUIDLow();
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index 5306e0e1d9e..210c47a7d3d 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -694,7 +694,7 @@ public:
}
// re-create
Creature* wpCreature2 = new Creature();
- if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
+ if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), VISUAL_WAYPOINT, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
@@ -702,7 +702,10 @@ public:
return false;
}
- wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
+ for (auto phase : chr->GetPhases())
+ wpCreature2->SetInPhase(phase, false, true);
+
+ wpCreature2->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
/// @todo Should we first use "Create" then use "LoadFromDB"?
if (!wpCreature2->LoadCreatureFromDB(wpCreature2->GetDBTableGUIDLow(), map))
@@ -918,13 +921,16 @@ public:
float o = chr->GetOrientation();
Creature* wpCreature = new Creature();
- if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, x, y, z, o))
+ if (!wpCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete wpCreature;
return false;
}
+ for (auto phase : chr->GetPhases())
+ wpCreature->SetInPhase(phase, false, true);
+
// Set "wpguid" column to the visual waypoint
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_DATA_WPGUID);
@@ -934,7 +940,7 @@ public:
WorldDatabase.Execute(stmt);
- wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
+ wpCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
if (!wpCreature->LoadCreatureFromDB(wpCreature->GetDBTableGUIDLow(), map))
{
@@ -982,14 +988,17 @@ public:
Map* map = chr->GetMap();
Creature* creature = new Creature();
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
delete creature;
return false;
}
- creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
+ for (auto phase : chr->GetPhases())
+ creature->SetInPhase(phase, false, true);
+
+ creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
if (!creature->LoadCreatureFromDB(creature->GetDBTableGUIDLow(), map))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id);
@@ -1031,14 +1040,17 @@ public:
Map* map = chr->GetMap();
Creature* creature = new Creature();
- if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMgr().GetPhaseMaskForSpawn(), id, x, y, z, o))
+ if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMask(), id, x, y, z, o))
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
delete creature;
return false;
}
- creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMgr().GetPhaseMaskForSpawn());
+ for (auto phase : chr->GetPhases())
+ creature->SetInPhase(phase, false, true);
+
+ creature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMask());
if (!creature->LoadCreatureFromDB(creature->GetDBTableGUIDLow(), map))
{
handler->PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id);
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index 9404694e706..006ef461cab 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -380,7 +380,7 @@ class boss_halion : public CreatureScript
if (events.IsInPhase(PHASE_THREE))
{
// Don't consider copied damage.
- if (!me->InSamePhase(attacker))
+ if (!me->IsInPhase(attacker))
return;
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
@@ -541,7 +541,7 @@ class boss_twilight_halion : public CreatureScript
if (events.IsInPhase(PHASE_THREE))
{
// Don't consider copied damage.
- if (!me->InSamePhase(attacker))
+ if (!me->IsInPhase(attacker))
return;
if (Creature* controller = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_HALION_CONTROLLER)))
diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
index 8a1fb6a9829..4fa80c7bac2 100644
--- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
+++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
@@ -90,7 +90,6 @@ public:
delete go;
return;
}
-
instance->AddToMap(go);
}
diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
index 7ae1c7840db..753d4ebea01 100644
--- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
+++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp
@@ -190,7 +190,8 @@ public:
{
summon->AI()->AttackStart(me->GetVictim());
summon->CastSpell((Unit*)NULL, SPELL_ZURAMAT_ADD_2);
- summon->SetPhaseMask(17, true);
+ summon->SetInPhase(169, true, true); // Normal phase
+ summon->SetInPhase(173, true, true); // Void phase
}
};
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
index a3ef9ce7b5c..b43904f2223 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
@@ -170,6 +170,9 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
return true;
}
+ for (auto phase : player->GetPhases())
+ go->SetInPhase(phase, false, true);
+
go->SetRespawnTime(0);
if (!map->AddToMap(go))
@@ -204,6 +207,9 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId)
return true;
}
+ for (auto phase : player->GetPhases())
+ go->SetInPhase(phase, false, true);
+
go->SetRespawnTime(0);
if (!map->AddToMap(go))