Core/Phasing: Implemented db spawns in personal phases
Port From (https://github.com/TrinityCore/TrinityCore/commit/8fabe5a3aacf7797f03d074ab8434f445be64955)
This commit is contained in:
@@ -1204,7 +1204,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
uint mapId = GetTransport() ? (uint)GetTransport().GetGoInfo().MoTransport.SpawnMap : GetMapId();
|
||||
SaveToDB(mapId, data.spawnDifficulties);
|
||||
SaveToDB(mapId, data.SpawnDifficulties);
|
||||
}
|
||||
|
||||
public virtual void SaveToDB(uint mapid, List<Difficulty> spawnDifficulties)
|
||||
@@ -1274,7 +1274,7 @@ namespace Game.Entities
|
||||
// prevent add data integrity problems
|
||||
data.movementType = (byte)(m_wanderDistance == 0 && GetDefaultMovementType() == MovementGeneratorType.Random
|
||||
? MovementGeneratorType.Idle : GetDefaultMovementType());
|
||||
data.spawnDifficulties = spawnDifficulties;
|
||||
data.SpawnDifficulties = spawnDifficulties;
|
||||
data.npcflag = npcflag;
|
||||
data.unit_flags = unitFlags;
|
||||
data.unit_flags2 = unitFlags2;
|
||||
@@ -1299,7 +1299,7 @@ namespace Game.Entities
|
||||
stmt.AddValue(index++, m_spawnId);
|
||||
stmt.AddValue(index++, GetEntry());
|
||||
stmt.AddValue(index++, mapid);
|
||||
stmt.AddValue(index++, data.spawnDifficulties.Empty() ? "" : string.Join(',', data.spawnDifficulties));
|
||||
stmt.AddValue(index++, data.SpawnDifficulties.Empty() ? "" : string.Join(',', data.SpawnDifficulties));
|
||||
stmt.AddValue(index++, data.PhaseId);
|
||||
stmt.AddValue(index++, data.PhaseGroup);
|
||||
stmt.AddValue(index++, displayId);
|
||||
|
||||
@@ -1018,7 +1018,7 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
SaveToDB(GetMapId(), data.spawnDifficulties);
|
||||
SaveToDB(GetMapId(), data.SpawnDifficulties);
|
||||
}
|
||||
|
||||
public void SaveToDB(uint mapid, List<Difficulty> spawnDifficulties)
|
||||
@@ -1045,7 +1045,7 @@ namespace Game.Entities
|
||||
data.spawntimesecs = (int)(m_spawnedByDefault ? m_respawnDelayTime : -m_respawnDelayTime);
|
||||
data.animprogress = GetGoAnimProgress();
|
||||
data.goState = GetGoState();
|
||||
data.spawnDifficulties = spawnDifficulties;
|
||||
data.SpawnDifficulties = spawnDifficulties;
|
||||
data.artKit = (byte)GetGoArtKit();
|
||||
if (data.spawnGroupData == null)
|
||||
data.spawnGroupData = Global.ObjectMgr.GetDefaultSpawnGroup();
|
||||
@@ -1063,7 +1063,7 @@ namespace Game.Entities
|
||||
stmt.AddValue(index++, m_spawnId);
|
||||
stmt.AddValue(index++, GetEntry());
|
||||
stmt.AddValue(index++, mapid);
|
||||
stmt.AddValue(index++, data.spawnDifficulties.Empty() ? "" : string.Join(",", data.spawnDifficulties));
|
||||
stmt.AddValue(index++, data.SpawnDifficulties.Empty() ? "" : string.Join(",", data.SpawnDifficulties));
|
||||
stmt.AddValue(index++, data.PhaseId);
|
||||
stmt.AddValue(index++, data.PhaseGroup);
|
||||
stmt.AddValue(index++, GetPositionX());
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Game.Entities
|
||||
if (!pos.IsPositionValid())
|
||||
return;
|
||||
|
||||
player.GetMap().LoadGrid(firstCamera.locations.X, firstCamera.locations.Y);
|
||||
player.GetMap().LoadGridForActiveObject(pos.GetPositionX(), pos.GetPositionY(), player);
|
||||
m_CinematicObject = player.SummonCreature(1, pos.posX, pos.posY, pos.posZ, 0.0f, TempSummonType.TimedDespawn, 5 * Time.Minute * Time.InMilliseconds);
|
||||
if (m_CinematicObject)
|
||||
{
|
||||
|
||||
@@ -2153,6 +2153,13 @@ namespace Game.Entities
|
||||
TeleportTo(m_summon_location);
|
||||
}
|
||||
|
||||
public override void OnPhaseChange()
|
||||
{
|
||||
base.OnPhaseChange();
|
||||
|
||||
GetMap().UpdatePersonalPhasesForPlayer(this);
|
||||
}
|
||||
|
||||
//GM
|
||||
public bool IsAcceptWhispers() { return m_ExtraFlags.HasAnyFlag(PlayerExtraFlags.AcceptWhispers); }
|
||||
public void SetAcceptWhispers(bool on)
|
||||
|
||||
@@ -1222,10 +1222,7 @@ namespace Game.Entities
|
||||
|
||||
public bool IsPossessed() { return HasUnitState(UnitState.Possessed); }
|
||||
|
||||
public void OnPhaseChange()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual void OnPhaseChange() { }
|
||||
|
||||
public uint GetModelForForm(ShapeShiftForm form, uint spellId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user