public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch( version ) { default: case 1: { _Blocker = (LOSBlocker)reader.ReadItem(); goto case 0; } case 0: { BoardGameControlItem = (BoardGameControlItem)reader.ReadItem(); Offset.X = reader.ReadInt(); Offset.Y = reader.ReadInt(); Offset.Z = reader.ReadInt(); break; } } }
public FlameOfOrder(Point3D location, Map map) : base(0x19AB) { Movable = false; Light = LightType.Circle225; MoveToWorld(location, map); m_Barriers = new List <EnergyBarrier>(m_BarrierLocations.Length); m_Blockers = new List <Blocker>(m_BarrierLocations.Length); m_LOSBlockers = new List <LOSBlocker>(m_BarrierLocations.Length); m_MsgTriggers = new List <SBMessageTrigger>(m_MsgTriggerLocations.Length); foreach (Point3D loc in m_BarrierLocations) { m_Barriers.Add(new EnergyBarrier(loc, map)); Blocker blocker = new Blocker(); blocker.MoveToWorld(loc, map); m_Blockers.Add(blocker); LOSBlocker losblocker = new LOSBlocker(); losblocker.MoveToWorld(loc, map); m_LOSBlockers.Add(losblocker); } foreach (Point3D loc in m_MsgTriggerLocations) { SBMessageTrigger trigger = new SBMessageTrigger(this); trigger.MoveToWorld(loc, map); m_MsgTriggers.Add(trigger); } }
protected void RestoreBarrier() { for (var index = 0; index < m_Barriers.Count; index++) { EnergyBarrier barrier = m_Barriers[index]; barrier.Active = true; } for (var index = 0; index < m_BarrierLocations.Length; index++) { Point3D loc = m_BarrierLocations[index]; Blocker blocker = new Blocker(); blocker.MoveToWorld(loc, Map); m_Blockers.Add(blocker); LOSBlocker losblocker = new LOSBlocker(); losblocker.MoveToWorld(loc, Map); m_LOSBlockers.Add(losblocker); } Visible = true; }
public override void OnSpeech(SpeechEventArgs e) { string mantra = e.Speech.ToLower(); if (Visible && e.Mobile.InRange(this, 2) && mantra == "ord") { Visible = false; for (var index = 0; index < m_Barriers.Count; index++) { EnergyBarrier barrier = m_Barriers[index]; barrier.Active = false; } for (var index = 0; index < m_Blockers.Count; index++) { Blocker blocker = m_Blockers[index]; blocker.Delete(); } for (var index = 0; index < m_LOSBlockers.Count; index++) { LOSBlocker losblocker = m_LOSBlockers[index]; losblocker.Delete(); } m_Blockers.Clear(); m_LOSBlockers.Clear(); Timer.DelayCall(TimeSpan.FromMinutes(2.0), RestoreBarrier); } }
public override void OnAfterDelete() { base.OnAfterDelete(); for (var index = 0; index < m_Blockers.Count; index++) { Blocker blocker = m_Blockers[index]; blocker.Delete(); } for (var index = 0; index < m_LOSBlockers.Count; index++) { LOSBlocker losblocker = m_LOSBlockers[index]; losblocker.Delete(); } for (var index = 0; index < m_MsgTriggers.Count; index++) { SBMessageTrigger trigger = m_MsgTriggers[index]; trigger.Delete(); } for (var index = 0; index < m_Barriers.Count; index++) { EnergyBarrier barrier = m_Barriers[index]; barrier.Delete(); } }
//master constructor public GamePiece( int itemid, string name, bool blocklos ) : base( itemid ) { Movable = false; Name = name; if( blocklos ) { _Blocker = new LOSBlocker(); } }
protected void RestoreBarrier() { foreach (EnergyBarrier barrier in m_Barriers) { barrier.Active = true; } foreach (Point3D loc in m_BarrierLocations) { Blocker blocker = new Blocker(); blocker.MoveToWorld(loc, Map); m_Blockers.Add(blocker); LOSBlocker losblocker = new LOSBlocker(); losblocker.MoveToWorld(loc, Map); m_LOSBlockers.Add(losblocker); } Visible = true; }
private static void GenerateCoral_OnCommand(CommandEventArgs e) { e.Mobile.SendMessage("Generating Corals..."); int count = 0; for(int i = 0; i < limits.Length; i++) { Point2D actual = limits[i]; Point2D next = (i == limits.Length - 1 ? limits[0] : limits[i + 1]); for (int x = actual.X, y = actual.Y; x != next.X || y != next.Y;) { if (x != next.X) { if (x < next.X) x++; else x--; } if (y != next.Y) { if (y < next.Y) y++; else y--; } Static rock = new Static(rocks[Utility.Random(0, rocks.Count)]); Item blocker = new Blocker(); Item losBlocker = new LOSBlocker(); int z = map.GetAverageZ(x, y); // on récupère la hauteur du sol à cet endroit rock.MoveToWorld(new Point3D(x, y, z), map); // le rocher pour la forme blocker.MoveToWorld(new Point3D(x, y, z), map); // un blocker pour empêcher de passer même avec un sea horse par exemple losBlocker.MoveToWorld(new Point3D(x, y, z), map); // pour empêcher tout sort de téléport de fonctionner count++; } } e.Mobile.SendMessage(String.Format("{0} Corals have been generated !", count)); }