public virtual bool Teleport(Map temp, Point location, bool effects = true, byte effectnumber = 0) { if (temp == null || !temp.ValidPoint(location)) return false; CurrentMap.RemoveObject(this); if (effects) Broadcast(new S.ObjectTeleportOut {ObjectID = ObjectID, Type = effectnumber}); Broadcast(new S.ObjectRemove {ObjectID = ObjectID}); CurrentMap = temp; CurrentLocation = location; InTrapRock = false; CurrentMap.AddObject(this); BroadcastInfo(); if (effects) Broadcast(new S.ObjectTeleportIn { ObjectID = ObjectID, Type = effectnumber }); BroadcastHealthChange(); return true; }
public bool Spawn(Map temp, Point location) { if (!temp.ValidPoint(location)) return false; CurrentMap = temp; CurrentLocation = location; CurrentMap.AddObject(this); RefreshAll(); SetHP(MaxHP); Spawned(); Envir.MonsterCount++; CurrentMap.MonsterCount++; return true; }
public bool Spawn(Map temp, Point location) { if (!temp.ValidPoint(location)) return false; if (uniqueAI != null && uniqueAI.UseKillTimer) { DateTime timeKilled = new DateTime(uniqueAI.LastKillYear, uniqueAI.LastKillMonth, uniqueAI.LastKillDay, uniqueAI.LastKillHour, uniqueAI.LastKillMinute, 0, 0); DateTime timeNow = DateTime.Now; if (timeNow.CompareTo(timeKilled) < 0) return false; } CurrentMap = temp; CurrentLocation = location; CurrentMap.AddObject(this); RefreshAll(); SetHP(MaxHP); Spawned(); Envir.MonsterCount++; CurrentMap.MonsterCount++; return true; }