Core/Phasing: Implemented db spawns in personal phases
Port From (https://github.com/TrinityCore/TrinityCore/commit/8fabe5a3aacf7797f03d074ab8434f445be64955)
This commit is contained in:
@@ -770,7 +770,7 @@ namespace Game.Chat
|
||||
else if (target.GetDBPhase() < 0)
|
||||
handler.SendSysMessage($"Target creature's PhaseGroup in DB: {Math.Abs(target.GetDBPhase())}");
|
||||
|
||||
PhasingHandler.PrintToChat(handler, target.GetPhaseShift());
|
||||
PhasingHandler.PrintToChat(handler, target);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -282,9 +282,9 @@ namespace Game.Chat
|
||||
obj.Relocate(x, y, z, obj.GetOrientation());
|
||||
|
||||
// update which cell has this gameobject registered for loading
|
||||
Global.ObjectMgr.RemoveGameObjectFromGrid(guidLow, obj.GetGameObjectData());
|
||||
Global.ObjectMgr.RemoveGameObjectFromGrid(obj.GetGameObjectData());
|
||||
obj.SaveToDB();
|
||||
Global.ObjectMgr.AddGameObjectToGrid(guidLow, obj.GetGameObjectData());
|
||||
Global.ObjectMgr.AddGameObjectToGrid(obj.GetGameObjectData());
|
||||
|
||||
// Generate a completely new spawn with new guid
|
||||
// client caches recently deleted objects and brings them back to life
|
||||
@@ -627,7 +627,7 @@ namespace Game.Chat
|
||||
return false;
|
||||
|
||||
// TODO: is it really necessary to add both the real and DB table guid here ?
|
||||
Global.ObjectMgr.AddGameObjectToGrid(spawnId, Global.ObjectMgr.GetGameObjectData(spawnId));
|
||||
Global.ObjectMgr.AddGameObjectToGrid(Global.ObjectMgr.GetGameObjectData(spawnId));
|
||||
handler.SendSysMessage(CypherStrings.GameobjectAdd, objectId, objectInfo.name, spawnId, player.GetPositionX(), player.GetPositionY(), player.GetPositionZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -981,7 +981,7 @@ namespace Game.Chat
|
||||
if (liquidStatus != null)
|
||||
handler.SendSysMessage(CypherStrings.LiquidStatus, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status);
|
||||
|
||||
PhasingHandler.PrintToChat(handler, obj.GetPhaseShift());
|
||||
PhasingHandler.PrintToChat(handler, obj);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1774,7 +1774,7 @@ namespace Game.Chat
|
||||
|
||||
// Output XIII. phases
|
||||
if (target)
|
||||
PhasingHandler.PrintToChat(handler, target.GetPhaseShift());
|
||||
PhasingHandler.PrintToChat(handler, target);
|
||||
|
||||
// Output XIV. LANG_PINFO_CHR_MONEY
|
||||
ulong gold = money / MoneyConstants.Gold;
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace Game.Chat
|
||||
if (data != null)
|
||||
handler.SendSysMessage(CypherStrings.NpcinfoPhases, data.PhaseId, data.PhaseGroup);
|
||||
|
||||
PhasingHandler.PrintToChat(handler, target.GetPhaseShift());
|
||||
PhasingHandler.PrintToChat(handler, target);
|
||||
|
||||
handler.SendSysMessage(CypherStrings.NpcinfoArmor, target.GetArmor());
|
||||
handler.SendSysMessage(CypherStrings.NpcinfoPosition, target.GetPositionX(), target.GetPositionY(), target.GetPositionZ());
|
||||
@@ -239,9 +239,9 @@ namespace Game.Chat
|
||||
return false;
|
||||
}
|
||||
|
||||
Global.ObjectMgr.RemoveCreatureFromGrid(lowguid, data);
|
||||
Global.ObjectMgr.RemoveCreatureFromGrid(data);
|
||||
data.SpawnPoint.Relocate(player);
|
||||
Global.ObjectMgr.AddCreatureToGrid(lowguid, data);
|
||||
Global.ObjectMgr.AddCreatureToGrid(data);
|
||||
|
||||
// update position in DB
|
||||
PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_POSITION);
|
||||
@@ -668,7 +668,7 @@ namespace Game.Chat
|
||||
if (creaturePassenger != null)
|
||||
{
|
||||
creaturePassenger.SaveToDB((uint)trans.GetGoInfo().MoTransport.SpawnMap, new List<Difficulty>() { map.GetDifficultyID() });
|
||||
Global.ObjectMgr.AddCreatureToGrid(guid, data);
|
||||
Global.ObjectMgr.AddCreatureToGrid(data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -689,7 +689,7 @@ namespace Game.Chat
|
||||
if (!creature)
|
||||
return false;
|
||||
|
||||
Global.ObjectMgr.AddCreatureToGrid(db_guid, Global.ObjectMgr.GetCreatureData(db_guid));
|
||||
Global.ObjectMgr.AddCreatureToGrid(Global.ObjectMgr.GetCreatureData(db_guid));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user