Dynamic Creature/Go spawning
Port From (https://github.com/TrinityCore/TrinityCore/commit/03b125e6d1947258316c931499746696a95aded2)
This commit is contained in:
@@ -345,6 +345,10 @@ namespace Game.Entities
|
||||
{
|
||||
if (_nextGuid >= ObjectGuid.GetMaxCounter(_highGuid) - 1)
|
||||
HandleCounterOverflow();
|
||||
|
||||
if (_highGuid == HighGuid.Creature || _highGuid == HighGuid.Vehicle || _highGuid == HighGuid.GameObject || _highGuid == HighGuid.Transport)
|
||||
CheckGuidTrigger(_nextGuid);
|
||||
|
||||
return _nextGuid++;
|
||||
}
|
||||
|
||||
@@ -355,5 +359,13 @@ namespace Game.Entities
|
||||
Log.outFatal(LogFilter.Server, "{0} guid overflow!! Can't continue, shutting down server. ", _highGuid);
|
||||
Global.WorldMgr.StopNow();
|
||||
}
|
||||
|
||||
void CheckGuidTrigger(ulong guidlow)
|
||||
{
|
||||
if (!Global.WorldMgr.IsGuidAlert() && guidlow > WorldConfig.GetUInt64Value(WorldCfg.RespawnGuidAlertLevel))
|
||||
Global.WorldMgr.TriggerGuidAlert();
|
||||
else if (!Global.WorldMgr.IsGuidWarning() && guidlow > WorldConfig.GetUInt64Value(WorldCfg.RespawnGuidWarnLevel))
|
||||
Global.WorldMgr.TriggerGuidWarning();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,6 +364,12 @@ namespace Game.Entities
|
||||
Relocate(pos);
|
||||
}
|
||||
|
||||
public void WorldRelocate(uint mapId, Position pos)
|
||||
{
|
||||
_mapId = mapId;
|
||||
Relocate(pos);
|
||||
}
|
||||
|
||||
public void WorldRelocate(WorldLocation loc)
|
||||
{
|
||||
_mapId = loc._mapId;
|
||||
|
||||
@@ -1731,7 +1731,7 @@ namespace Game.Entities
|
||||
|
||||
public virtual uint GetLevelForTarget(WorldObject target) { return 1; }
|
||||
|
||||
public virtual void SaveRespawnTime() { }
|
||||
public virtual void SaveRespawnTime(uint forceDelay = 0, bool saveToDB = true) { }
|
||||
|
||||
public ZoneScript GetZoneScript() { return m_zoneScript; }
|
||||
|
||||
@@ -1770,7 +1770,7 @@ namespace Game.Entities
|
||||
public virtual bool IsInvisibleDueToDespawn() { return false; }
|
||||
public virtual bool IsAlwaysDetectableFor(WorldObject seer) { return false; }
|
||||
|
||||
public virtual bool LoadFromDB(ulong guid, Map map) { return true; }
|
||||
public virtual bool LoadFromDB(ulong spawnId, Map map, bool addToMap, bool allowDuplicate) { return true; }
|
||||
|
||||
//Position
|
||||
|
||||
|
||||
Reference in New Issue
Block a user