Core/Entities: Remove phasemask
This commit is contained in:
@@ -324,12 +324,6 @@ namespace Framework.Constants
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct PhaseMasks
|
|
||||||
{
|
|
||||||
public const uint Normal = 0x00000001;
|
|
||||||
public const uint Anywhere = 0xFFFFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum LocaleConstant
|
public enum LocaleConstant
|
||||||
{
|
{
|
||||||
enUS = 0,
|
enUS = 0,
|
||||||
|
|||||||
@@ -683,7 +683,7 @@ namespace Game.BattleFields
|
|||||||
pos.GetPosition(out x, out y, out z, out o);
|
pos.GetPosition(out x, out y, out z, out o);
|
||||||
|
|
||||||
Creature creature = new Creature();
|
Creature creature = new Creature();
|
||||||
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, PhaseMasks.Normal, entry, x, y, z, o))
|
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, entry, x, y, z, o))
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Battlefield, "Battlefield:SpawnCreature: Can't create creature entry: {0}", entry);
|
Log.outError(LogFilter.Battlefield, "Battlefield:SpawnCreature: Can't create creature entry: {0}", entry);
|
||||||
return null;
|
return null;
|
||||||
@@ -715,7 +715,7 @@ namespace Game.BattleFields
|
|||||||
|
|
||||||
// Create gameobject
|
// Create gameobject
|
||||||
GameObject go = new GameObject();
|
GameObject go = new GameObject();
|
||||||
if (!go.Create(entry, map, PhaseMasks.Normal, pos, rotation, 255, GameObjectState.Ready))
|
if (!go.Create(entry, map, pos, rotation, 255, GameObjectState.Ready))
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Battlefield, "Battlefield:SpawnGameObject: Cannot create gameobject template {1}! Battlefield not created!", entry);
|
Log.outError(LogFilter.Battlefield, "Battlefield:SpawnGameObject: Cannot create gameobject template {1}! Battlefield not created!", entry);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1324,7 +1324,7 @@ namespace Game.BattleGrounds
|
|||||||
// and when loading it (in go.LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
|
// and when loading it (in go.LoadFromDB()), a new guid would be assigned to the object, and a new object would be created
|
||||||
// So we must create it specific for this instance
|
// So we must create it specific for this instance
|
||||||
GameObject go = new GameObject();
|
GameObject go = new GameObject();
|
||||||
if (!go.Create(entry, GetBgMap(), PhaseMasks.Normal, new Position(x, y, z, o), rotation, 100, goState))
|
if (!go.Create(entry, GetBgMap(), new Position(x, y, z, o), rotation, 100, goState))
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Battleground, "Battleground.AddObject: cannot create gameobject (entry: {0}) for BG (map: {1}, instance id: {2})!", entry, m_MapId, m_InstanceID);
|
Log.outError(LogFilter.Battleground, "Battleground.AddObject: cannot create gameobject (entry: {0}) for BG (map: {1}, instance id: {2})!", entry, m_MapId, m_InstanceID);
|
||||||
return false;
|
return false;
|
||||||
@@ -1440,7 +1440,7 @@ namespace Game.BattleGrounds
|
|||||||
}
|
}
|
||||||
|
|
||||||
Creature creature = new Creature();
|
Creature creature = new Creature();
|
||||||
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, PhaseMasks.Normal, entry, x, y, z, o))
|
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, entry, x, y, z, o))
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Battleground, "Battleground.AddCreature: cannot create creature (entry: {0}) for BG (map: {1}, instance id: {2})!",
|
Log.outError(LogFilter.Battleground, "Battleground.AddCreature: cannot create creature (entry: {0}) for BG (map: {1}, instance id: {2})!",
|
||||||
entry, m_MapId, m_InstanceID);
|
entry, m_MapId, m_InstanceID);
|
||||||
|
|||||||
@@ -941,7 +941,7 @@ namespace Game.Chat
|
|||||||
Creature creature = new Creature();
|
Creature creature = new Creature();
|
||||||
|
|
||||||
Map map = handler.GetSession().GetPlayer().GetMap();
|
Map map = handler.GetSession().GetPlayer().GetMap();
|
||||||
if (!creature.Create(map.GenerateLowGuid(HighGuid.Vehicle), map, handler.GetSession().GetPlayer().GetPhaseMask(), entry, x, y, z, o, null, id))
|
if (!creature.Create(map.GenerateLowGuid(HighGuid.Vehicle), map, entry, x, y, z, o, null, id))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
map.AddToMap(creature.ToCreature());
|
map.AddToMap(creature.ToCreature());
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ namespace Game.Chat
|
|||||||
GameObject obj = new GameObject();
|
GameObject obj = new GameObject();
|
||||||
|
|
||||||
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(player.GetOrientation(), 0.0f, 0.0f));
|
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(player.GetOrientation(), 0.0f, 0.0f));
|
||||||
if (!obj.Create(objectInfo.entry, map, 0, player, rotation, 255, GameObjectState.Ready))
|
if (!obj.Create(objectInfo.entry, map, player, rotation, 255, GameObjectState.Ready))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
obj.CopyPhaseFrom(player);
|
obj.CopyPhaseFrom(player);
|
||||||
|
|||||||
@@ -240,7 +240,6 @@ namespace Game.Chat
|
|||||||
{
|
{
|
||||||
// Get ALL the variables!
|
// Get ALL the variables!
|
||||||
Player playerTarget;
|
Player playerTarget;
|
||||||
uint phase = 0;
|
|
||||||
ObjectGuid guidTarget;
|
ObjectGuid guidTarget;
|
||||||
string nameTarget;
|
string nameTarget;
|
||||||
string zoneName = "";
|
string zoneName = "";
|
||||||
@@ -317,11 +316,12 @@ namespace Game.Chat
|
|||||||
|
|
||||||
// Check if iterator is online. If is...
|
// Check if iterator is online. If is...
|
||||||
Player p = Global.ObjAccessor.FindPlayer(slot.guid);
|
Player p = Global.ObjAccessor.FindPlayer(slot.guid);
|
||||||
|
string phases = "";
|
||||||
if (p && p.IsInWorld)
|
if (p && p.IsInWorld)
|
||||||
{
|
{
|
||||||
// ... than, it prints information like "is online", where he is, etc...
|
// ... than, it prints information like "is online", where he is, etc...
|
||||||
onlineState = "online";
|
onlineState = "online";
|
||||||
phase = (!p.IsGameMaster() ? p.GetPhaseMask() : uint.MaxValue);
|
phases = string.Join(", ", p.GetPhases());
|
||||||
|
|
||||||
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(p.GetAreaId());
|
AreaTableRecord area = CliDB.AreaTableStorage.LookupByKey(p.GetAreaId());
|
||||||
if (area != null)
|
if (area != null)
|
||||||
@@ -336,12 +336,11 @@ namespace Game.Chat
|
|||||||
// ... else, everything is set to offline or neutral values.
|
// ... else, everything is set to offline or neutral values.
|
||||||
zoneName = "<ERROR>";
|
zoneName = "<ERROR>";
|
||||||
onlineState = "Offline";
|
onlineState = "Offline";
|
||||||
phase = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we can print those informations for every single member of each group!
|
// Now we can print those informations for every single member of each group!
|
||||||
handler.SendSysMessage(CypherStrings.GroupPlayerNameGuid, slot.name, onlineState,
|
handler.SendSysMessage(CypherStrings.GroupPlayerNameGuid, slot.name, onlineState,
|
||||||
zoneName, phase, slot.guid.ToString(), flags, LFGQueue.GetRolesString(slot.roles));
|
zoneName, phases, slot.guid.ToString(), flags, LFGQueue.GetRolesString(slot.roles));
|
||||||
}
|
}
|
||||||
|
|
||||||
// And finish after every iterator is done.
|
// And finish after every iterator is done.
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ namespace Game.Chat
|
|||||||
mapId, (mapEntry != null ? mapEntry.MapName[handler.GetSessionDbcLocale()] : unknown),
|
mapId, (mapEntry != null ? mapEntry.MapName[handler.GetSessionDbcLocale()] : unknown),
|
||||||
zoneId, (zoneEntry != null ? zoneEntry.AreaName[handler.GetSessionDbcLocale()] : unknown),
|
zoneId, (zoneEntry != null ? zoneEntry.AreaName[handler.GetSessionDbcLocale()] : unknown),
|
||||||
areaId, (areaEntry != null ? areaEntry.AreaName[handler.GetSessionDbcLocale()] : unknown),
|
areaId, (areaEntry != null ? areaEntry.AreaName[handler.GetSessionDbcLocale()] : unknown),
|
||||||
obj.GetPhaseMask(), string.Join(", ", obj.GetPhases()), obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ(), obj.GetOrientation());
|
string.Join(", ", obj.GetPhases()), obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ(), obj.GetOrientation());
|
||||||
|
|
||||||
Transport transport = obj.GetTransport();
|
Transport transport = obj.GetTransport();
|
||||||
if (transport)
|
if (transport)
|
||||||
|
|||||||
@@ -1120,7 +1120,7 @@ namespace Game.Chat
|
|||||||
}
|
}
|
||||||
|
|
||||||
Creature creature = new Creature();
|
Creature creature = new Creature();
|
||||||
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, chr.GetPhaseMask(), id, x, y, z, o))
|
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, id, x, y, z, o))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
creature.CopyPhaseFrom(chr);
|
creature.CopyPhaseFrom(chr);
|
||||||
|
|||||||
@@ -546,7 +546,7 @@ namespace Game.Chat.Commands
|
|||||||
|
|
||||||
// re-create
|
// re-create
|
||||||
Creature wpCreature = new Creature();
|
Creature wpCreature = new Creature();
|
||||||
if (!wpCreature.Create(map.GenerateLowGuid(HighGuid.Creature), map, chr.GetPhaseMask(), 1, chr.GetPositionX(), chr.GetPositionY(), chr.GetPositionZ(), chr.GetOrientation()))
|
if (!wpCreature.Create(map.GenerateLowGuid(HighGuid.Creature), map, 1, chr.GetPositionX(), chr.GetPositionY(), chr.GetPositionZ(), chr.GetOrientation()))
|
||||||
{
|
{
|
||||||
wpCreature.CopyPhaseFrom(chr);
|
wpCreature.CopyPhaseFrom(chr);
|
||||||
wpCreature.SaveToDB(map.GetId(), 1ul << (int)map.GetSpawnMode());
|
wpCreature.SaveToDB(map.GetId(), 1ul << (int)map.GetSpawnMode());
|
||||||
@@ -755,7 +755,7 @@ namespace Game.Chat.Commands
|
|||||||
float o = chr.GetOrientation();
|
float o = chr.GetOrientation();
|
||||||
|
|
||||||
Creature wpCreature = new Creature();
|
Creature wpCreature = new Creature();
|
||||||
if (!wpCreature.Create(map.GenerateLowGuid(HighGuid.Creature), map, chr.GetPhaseMask(), id, x, y, z, o))
|
if (!wpCreature.Create(map.GenerateLowGuid(HighGuid.Creature), map, id, x, y, z, o))
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.WaypointVpNotcreated, id);
|
handler.SendSysMessage(CypherStrings.WaypointVpNotcreated, id);
|
||||||
return false;
|
return false;
|
||||||
@@ -815,7 +815,7 @@ namespace Game.Chat.Commands
|
|||||||
Map map = chr.GetMap();
|
Map map = chr.GetMap();
|
||||||
|
|
||||||
Creature creature = new Creature();
|
Creature creature = new Creature();
|
||||||
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, chr.GetPhaseMask(), id, x, y, z, o))
|
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, id, x, y, z, o))
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.WaypointVpNotcreated, id);
|
handler.SendSysMessage(CypherStrings.WaypointVpNotcreated, id);
|
||||||
return false;
|
return false;
|
||||||
@@ -863,7 +863,7 @@ namespace Game.Chat.Commands
|
|||||||
Map map = chr.GetMap();
|
Map map = chr.GetMap();
|
||||||
|
|
||||||
Creature creature = new Creature();
|
Creature creature = new Creature();
|
||||||
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, chr.GetPhaseMask(), id, x, y, z, o))
|
if (!creature.Create(map.GenerateLowGuid(HighGuid.Creature), map, id, x, y, z, o))
|
||||||
{
|
{
|
||||||
handler.SendSysMessage(CypherStrings.WaypointNotcreated, id);
|
handler.SendSysMessage(CypherStrings.WaypointNotcreated, id);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
_Create(ObjectGuid.Create(HighGuid.AreaTrigger, GetMapId(), GetTemplate().Id, caster.GetMap().GenerateLowGuid(HighGuid.AreaTrigger)));
|
_Create(ObjectGuid.Create(HighGuid.AreaTrigger, GetMapId(), GetTemplate().Id, caster.GetMap().GenerateLowGuid(HighGuid.AreaTrigger)));
|
||||||
SetPhaseMask(caster.GetPhaseMask(), false);
|
|
||||||
|
|
||||||
SetEntry(GetTemplate().Id);
|
SetEntry(GetTemplate().Id);
|
||||||
SetDuration(duration);
|
SetDuration(duration);
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ namespace Game.Entities
|
|||||||
Relocate(pos);
|
Relocate(pos);
|
||||||
|
|
||||||
base._Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid));
|
base._Create(ObjectGuid.Create(HighGuid.Conversation, GetMapId(), conversationEntry, lowGuid));
|
||||||
SetPhaseMask(creator.GetPhaseMask(), false);
|
|
||||||
CopyPhaseFrom(creator);
|
CopyPhaseFrom(creator);
|
||||||
|
|
||||||
SetEntry(conversationEntry);
|
SetEntry(conversationEntry);
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
_Create(ObjectGuid.Create(HighGuid.Corpse, owner.GetMapId(), 0, guidlow));
|
_Create(ObjectGuid.Create(HighGuid.Corpse, owner.GetMapId(), 0, guidlow));
|
||||||
SetPhaseMask(owner.GetPhaseMask(), false);
|
|
||||||
|
|
||||||
SetObjectScale(1);
|
SetObjectScale(1);
|
||||||
SetGuidValue(CorpseFields.Owner, owner.GetGUID());
|
SetGuidValue(CorpseFields.Owner, owner.GetGUID());
|
||||||
|
|||||||
@@ -720,7 +720,7 @@ namespace Game.Entities
|
|||||||
GetMotionMaster().Initialize();
|
GetMotionMaster().Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Create(ulong guidlow, Map map, uint phaseMask, uint entry, float x, float y, float z, float ang, CreatureData data = null, uint vehId = 0)
|
public bool Create(ulong guidlow, Map map, uint entry, float x, float y, float z, float ang, CreatureData data = null, uint vehId = 0)
|
||||||
{
|
{
|
||||||
SetMap(map);
|
SetMap(map);
|
||||||
|
|
||||||
@@ -1044,8 +1044,8 @@ namespace Game.Entities
|
|||||||
data.unit_flags3 = unitFlags3;
|
data.unit_flags3 = unitFlags3;
|
||||||
data.dynamicflags = dynamicflags;
|
data.dynamicflags = dynamicflags;
|
||||||
|
|
||||||
data.phaseId = (uint)(GetDBPhase() > 0 ? GetDBPhase() : 0);
|
data.phaseId = GetDBPhase() > 0 ? (uint)GetDBPhase() : data.phaseId;
|
||||||
data.phaseGroup = (uint)(GetDBPhase() < 0 ? Math.Abs(GetDBPhase()) : 0);
|
data.phaseGroup = GetDBPhase() < 0 ? (uint)-GetDBPhase() : data.phaseGroup;
|
||||||
|
|
||||||
// update in DB
|
// update in DB
|
||||||
SQLTransaction trans = new SQLTransaction();
|
SQLTransaction trans = new SQLTransaction();
|
||||||
@@ -1319,7 +1319,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
m_spawnId = spawnId;
|
m_spawnId = spawnId;
|
||||||
m_creatureData = data;
|
m_creatureData = data;
|
||||||
if (!Create(map.GenerateLowGuid(HighGuid.Creature), map, PhaseMasks.Normal, data.id, data.posX, data.posY, data.posZ, data.orientation, data))
|
if (!Create(map.GenerateLowGuid(HighGuid.Creature), map, data.id, data.posX, data.posY, data.posZ, data.orientation, data))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//We should set first home position, because then AI calls home movement
|
//We should set first home position, because then AI calls home movement
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
|
|
||||||
_Create(ObjectGuid.Create(HighGuid.DynamicObject, GetMapId(), spell.Id, guidlow));
|
_Create(ObjectGuid.Create(HighGuid.DynamicObject, GetMapId(), spell.Id, guidlow));
|
||||||
SetPhaseMask(caster.GetPhaseMask(), false);
|
|
||||||
|
|
||||||
SetEntry(spell.Id);
|
SetEntry(spell.Id);
|
||||||
SetObjectScale(1f);
|
SetObjectScale(1f);
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Create(uint name_id, Map map, uint phaseMask, Position pos, Quaternion rotation, uint animprogress, GameObjectState go_state, uint artKit = 0)
|
public bool Create(uint name_id, Map map, Position pos, Quaternion rotation, uint animprogress, GameObjectState go_state, uint artKit = 0)
|
||||||
{
|
{
|
||||||
Contract.Assert(map);
|
Contract.Assert(map);
|
||||||
SetMap(map);
|
SetMap(map);
|
||||||
@@ -341,7 +341,7 @@ namespace Game.Entities
|
|||||||
if (linkedEntry != 0)
|
if (linkedEntry != 0)
|
||||||
{
|
{
|
||||||
GameObject linkedGO = new GameObject();
|
GameObject linkedGO = new GameObject();
|
||||||
if (linkedGO.Create(linkedEntry, map, phaseMask, pos, rotation, 255, GameObjectState.Ready))
|
if (linkedGO.Create(linkedEntry, map, pos, rotation, 255, GameObjectState.Ready))
|
||||||
{
|
{
|
||||||
SetLinkedTrap(linkedGO);
|
SetLinkedTrap(linkedGO);
|
||||||
map.AddToMap(linkedGO);
|
map.AddToMap(linkedGO);
|
||||||
@@ -877,8 +877,8 @@ namespace Game.Entities
|
|||||||
data.artKit = GetGoArtKit();
|
data.artKit = GetGoArtKit();
|
||||||
Global.ObjectMgr.NewGOData(m_spawnId, data);
|
Global.ObjectMgr.NewGOData(m_spawnId, data);
|
||||||
|
|
||||||
data.phaseId = (uint)(GetDBPhase() > 0 ? GetDBPhase() : 0);
|
data.phaseId = GetDBPhase() > 0 ? (uint)GetDBPhase() : data.phaseId;
|
||||||
data.phaseGroup = (uint)(GetDBPhase() < 0 ? Math.Abs(GetDBPhase()) : 0);
|
data.phaseGroup = GetDBPhase() < 0 ? (uint)-GetDBPhase() : data.phaseGroup;
|
||||||
|
|
||||||
// Update in DB
|
// Update in DB
|
||||||
byte index = 0;
|
byte index = 0;
|
||||||
@@ -925,7 +925,7 @@ namespace Game.Entities
|
|||||||
uint artKit = data.artKit;
|
uint artKit = data.artKit;
|
||||||
|
|
||||||
m_spawnId = spawnId;
|
m_spawnId = spawnId;
|
||||||
if (!Create(entry, map, PhaseMasks.Normal, pos, data.rotation, animprogress, go_state, artKit))
|
if (!Create(entry, map, pos, data.rotation, animprogress, go_state, artKit))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (data.phaseId != 0)
|
if (data.phaseId != 0)
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
_name = "";
|
_name = "";
|
||||||
m_isWorldObject = isWorldObject;
|
m_isWorldObject = isWorldObject;
|
||||||
phaseMask = PhaseMasks.Normal;
|
|
||||||
|
|
||||||
m_serverSideVisibility.SetValue(ServerSideVisibilityType.Ghost, GhostVisibilityType.Alive | GhostVisibilityType.Ghost);
|
m_serverSideVisibility.SetValue(ServerSideVisibilityType.Ghost, GhostVisibilityType.Alive | GhostVisibilityType.Ghost);
|
||||||
m_serverSideVisibilityDetect.SetValue(ServerSideVisibilityType.Ghost, GhostVisibilityType.Alive);
|
m_serverSideVisibilityDetect.SetValue(ServerSideVisibilityType.Ghost, GhostVisibilityType.Alive);
|
||||||
@@ -2045,7 +2044,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
Map map = GetMap();
|
Map map = GetMap();
|
||||||
GameObject go = new GameObject();
|
GameObject go = new GameObject();
|
||||||
if (!go.Create(entry, map, GetPhaseMask(), pos, rotation, 255, GameObjectState.Ready))
|
if (!go.Create(entry, map, pos, rotation, 255, GameObjectState.Ready))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
go.CopyPhaseFrom(this);
|
go.CopyPhaseFrom(this);
|
||||||
@@ -2155,14 +2154,6 @@ namespace Game.Entities
|
|||||||
return (valuesCount > (uint)UnitFields.CombatReach) ? GetFloatValue(UnitFields.CombatReach) : SharedConst.DefaultWorldObjectSize;
|
return (valuesCount > (uint)UnitFields.CombatReach) ? GetFloatValue(UnitFields.CombatReach) : SharedConst.DefaultWorldObjectSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void SetPhaseMask(uint newPhaseMask, bool update)
|
|
||||||
{
|
|
||||||
phaseMask = newPhaseMask;
|
|
||||||
|
|
||||||
if (update && IsInWorld)
|
|
||||||
UpdateObjectVisibility();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool HasInPhaseList(uint phase)
|
bool HasInPhaseList(uint phase)
|
||||||
{
|
{
|
||||||
return _phases.Contains(phase);
|
return _phases.Contains(phase);
|
||||||
@@ -2209,20 +2200,14 @@ namespace Game.Entities
|
|||||||
foreach (var eff in auraPhaseList)
|
foreach (var eff in auraPhaseList)
|
||||||
{
|
{
|
||||||
uint phase = (uint)eff.GetMiscValueB();
|
uint phase = (uint)eff.GetMiscValueB();
|
||||||
bool up = SetInPhase(phase, false, true);
|
updateNeeded = SetInPhase(phase, false, true) || updateNeeded;
|
||||||
if (!updateNeeded && up)
|
|
||||||
updateNeeded = true;
|
|
||||||
}
|
}
|
||||||
var auraPhaseGroupList = unit.GetAuraEffectsByType(AuraType.PhaseGroup);
|
var auraPhaseGroupList = unit.GetAuraEffectsByType(AuraType.PhaseGroup);
|
||||||
foreach (var eff in auraPhaseGroupList)
|
foreach (var eff in auraPhaseGroupList)
|
||||||
{
|
{
|
||||||
bool up = false;
|
|
||||||
uint phaseGroup = (uint)eff.GetMiscValueB();
|
uint phaseGroup = (uint)eff.GetMiscValueB();
|
||||||
foreach (uint phase in Global.DB2Mgr.GetPhasesForGroup(phaseGroup))
|
foreach (uint phase in Global.DB2Mgr.GetPhasesForGroup(phaseGroup))
|
||||||
up = SetInPhase(phase, false, true);
|
updateNeeded = SetInPhase(phase, false, true) || updateNeeded;
|
||||||
|
|
||||||
if (!updateNeeded && up)
|
|
||||||
updateNeeded = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2242,13 +2227,17 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (apply)
|
if (apply)
|
||||||
{
|
{
|
||||||
if (HasInPhaseList(id)) // do not run the updates if we are already in this phase
|
// do not run the updates if we are already in this phase
|
||||||
|
if (_phases.Contains(id))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_phases.Add(id);
|
_phases.Add(id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!_phases.Contains(id))
|
||||||
|
return false;
|
||||||
|
|
||||||
// if area phase passes the condition we should not remove it (ie: if remove called from aura remove)
|
// if area phase passes the condition we should not remove it (ie: if remove called from aura remove)
|
||||||
// this however breaks the .mod phase command, you wont be able to remove any area based phases with it
|
// this however breaks the .mod phase command, you wont be able to remove any area based phases with it
|
||||||
var phases = Global.ObjectMgr.GetPhasesForArea(GetAreaId());
|
var phases = Global.ObjectMgr.GetPhasesForArea(GetAreaId());
|
||||||
@@ -2262,8 +2251,6 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HasInPhaseList(id)) // do not run the updates if we are not in this phase
|
|
||||||
return false;
|
|
||||||
_phases.Remove(id);
|
_phases.Remove(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2400,7 +2387,6 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint GetPhaseMask() { return phaseMask; }
|
|
||||||
public List<uint> GetPhases() { return _phases; }
|
public List<uint> GetPhases() { return _phases; }
|
||||||
public List<uint> GetTerrainSwaps() { return _terrainSwaps; }
|
public List<uint> GetTerrainSwaps() { return _terrainSwaps; }
|
||||||
public List<uint> GetWorldMapAreaSwaps() { return _worldMapAreaSwaps; }
|
public List<uint> GetWorldMapAreaSwaps() { return _worldMapAreaSwaps; }
|
||||||
@@ -3172,7 +3158,6 @@ namespace Game.Entities
|
|||||||
Transport m_transport;
|
Transport m_transport;
|
||||||
Map _currMap;
|
Map _currMap;
|
||||||
uint instanceId;
|
uint instanceId;
|
||||||
uint phaseMask;
|
|
||||||
List<uint> _phases = new List<uint>();
|
List<uint> _phases = new List<uint>();
|
||||||
List<uint> _terrainSwaps = new List<uint>();
|
List<uint> _terrainSwaps = new List<uint>();
|
||||||
List<uint> _worldMapAreaSwaps = new List<uint>();
|
List<uint> _worldMapAreaSwaps = new List<uint>();
|
||||||
|
|||||||
@@ -474,7 +474,7 @@ namespace Game.Entities
|
|||||||
pos.GetPosition(out x, out y, out z, out o);
|
pos.GetPosition(out x, out y, out z, out o);
|
||||||
CalculatePassengerPosition(ref x, ref y, ref z, ref o);
|
CalculatePassengerPosition(ref x, ref y, ref z, ref o);
|
||||||
|
|
||||||
if (!summon.Create(map.GenerateLowGuid(HighGuid.Creature), map, 0, entry, x, y, z, o, null, vehId))
|
if (!summon.Create(map.GenerateLowGuid(HighGuid.Creature), map, entry, x, y, z, o, null, vehId))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
foreach (var phase in phases)
|
foreach (var phase in phases)
|
||||||
|
|||||||
@@ -709,7 +709,7 @@ namespace Game.Garrisons
|
|||||||
|
|
||||||
Position pos = PacketInfo.PlotPos;
|
Position pos = PacketInfo.PlotPos;
|
||||||
GameObject go = new GameObject();
|
GameObject go = new GameObject();
|
||||||
if (!go.Create(entry, map, 0, pos, Quaternion.WAxis, 255, GameObjectState.Active))
|
if (!go.Create(entry, map, pos, Quaternion.WAxis, 255, GameObjectState.Active))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (BuildingInfo.CanActivate() && BuildingInfo.PacketInfo.HasValue && !BuildingInfo.PacketInfo.Value.Active)
|
if (BuildingInfo.CanActivate() && BuildingInfo.PacketInfo.HasValue && !BuildingInfo.PacketInfo.Value.Active)
|
||||||
@@ -719,7 +719,7 @@ namespace Game.Garrisons
|
|||||||
{
|
{
|
||||||
Position pos2 = finalizeInfo.factionInfo[faction].Pos;
|
Position pos2 = finalizeInfo.factionInfo[faction].Pos;
|
||||||
GameObject finalizer = new GameObject();
|
GameObject finalizer = new GameObject();
|
||||||
if (finalizer.Create(finalizeInfo.factionInfo[faction].GameObjectId, map, 0, pos2, Quaternion.WAxis, 255, GameObjectState.Ready))
|
if (finalizer.Create(finalizeInfo.factionInfo[faction].GameObjectId, map, pos2, Quaternion.WAxis, 255, GameObjectState.Ready))
|
||||||
{
|
{
|
||||||
// set some spell id to make the object delete itself after use
|
// set some spell id to make the object delete itself after use
|
||||||
finalizer.SetSpellId(finalizer.GetGoInfo().Goober.spell);
|
finalizer.SetSpellId(finalizer.GetGoInfo().Goober.spell);
|
||||||
|
|||||||
@@ -3203,7 +3203,7 @@ namespace Game.Maps
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!summon.Create(GenerateLowGuid(HighGuid.Creature), this, 0, entry, pos.posX, pos.posY, pos.posZ, pos.Orientation, null, vehId))
|
if (!summon.Create(GenerateLowGuid(HighGuid.Creature), this, entry, pos.posX, pos.posY, pos.posZ, pos.Orientation, null, vehId))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// Set the summon to the summoner's phase
|
// Set the summon to the summoner's phase
|
||||||
|
|||||||
@@ -2852,7 +2852,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
Map map = target.GetMap();
|
Map map = target.GetMap();
|
||||||
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(target.GetOrientation(), 0.0f, 0.0f));
|
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(target.GetOrientation(), 0.0f, 0.0f));
|
||||||
if (!pGameObj.Create(gameobject_id, map, m_caster.GetPhaseMask(), new Position(x, y, z, target.GetOrientation()), rotation, 255, GameObjectState.Ready))
|
if (!pGameObj.Create(gameobject_id, map, new Position(x, y, z, target.GetOrientation()), rotation, 255, GameObjectState.Ready))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pGameObj.CopyPhaseFrom(m_caster);
|
pGameObj.CopyPhaseFrom(m_caster);
|
||||||
@@ -3516,7 +3516,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
Map map = m_caster.GetMap();
|
Map map = m_caster.GetMap();
|
||||||
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(pos.GetOrientation(), 0.0f, 0.0f));
|
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(pos.GetOrientation(), 0.0f, 0.0f));
|
||||||
if (!pGameObj.Create((uint)gameobject_id, map, m_caster.GetPhaseMask(), pos, rotation, 0, GameObjectState.Ready))
|
if (!pGameObj.Create((uint)gameobject_id, map, pos, rotation, 0, GameObjectState.Ready))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pGameObj.CopyPhaseFrom(m_caster);
|
pGameObj.CopyPhaseFrom(m_caster);
|
||||||
@@ -3860,7 +3860,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
Map map = m_caster.GetMap();
|
Map map = m_caster.GetMap();
|
||||||
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(m_caster.GetOrientation(), 0.0f, 0.0f));
|
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(m_caster.GetOrientation(), 0.0f, 0.0f));
|
||||||
if (!go.Create(go_id, map, m_caster.GetPhaseMask(), new Position(x, y, z, m_caster.GetOrientation()), rotation, 255, GameObjectState.Ready))
|
if (!go.Create(go_id, map, new Position(x, y, z, m_caster.GetOrientation()), rotation, 255, GameObjectState.Ready))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
go.CopyPhaseFrom(m_caster);
|
go.CopyPhaseFrom(m_caster);
|
||||||
@@ -4548,7 +4548,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
Position pos = new Position(fx, fy, fz, m_caster.GetOrientation());
|
Position pos = new Position(fx, fy, fz, m_caster.GetOrientation());
|
||||||
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(m_caster.GetOrientation(), 0.0f, 0.0f));
|
Quaternion rotation = new Quaternion(Matrix3.fromEulerAnglesZYX(m_caster.GetOrientation(), 0.0f, 0.0f));
|
||||||
if (!pGameObj.Create(name_id, cMap, m_caster.GetPhaseMask(), pos, rotation, 255, GameObjectState.Ready))
|
if (!pGameObj.Create(name_id, cMap, pos, rotation, 255, GameObjectState.Ready))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pGameObj.CopyPhaseFrom(m_caster);
|
pGameObj.CopyPhaseFrom(m_caster);
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity
|
|||||||
void SpawnGameObject(uint entry, Position pos)
|
void SpawnGameObject(uint entry, Position pos)
|
||||||
{
|
{
|
||||||
GameObject go = new GameObject();
|
GameObject go = new GameObject();
|
||||||
if (go.Create(entry, instance, PhaseMasks.Normal, pos, Quaternion.WAxis, 255, GameObjectState.Ready))
|
if (go.Create(entry, instance, pos, Quaternion.WAxis, 255, GameObjectState.Ready))
|
||||||
instance.AddToMap(go);
|
instance.AddToMap(go);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user