public FirepitFire(CampingFirepitPlaced firepit) : base(0xDE3) { m_Firepit = firepit; Movable = false; Visible = false; m_Entries = new ArrayList(); m_Created = DateTime.UtcNow; if (!m_Firepit.InDungeon) { m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), new TimerCallback(OnTick)); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); if (version >= 0) { m_Firepit = (CampingFirepitPlaced)reader.ReadItem(); } //----- if (!m_Firepit.InDungeon) { m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), new TimerCallback(OnTick)); } m_Entries = new ArrayList(); }
public InternalTimer(CampingFirepitPlaced firepit) : base(firepit.TickInterval, firepit.TickInterval) { Priority = TimerPriority.OneSecond; m_Firepit = firepit; }
protected override void OnTarget(Mobile from, object target) { if (m_CampingFirepit.Deleted || m_CampingFirepit.RootParent != from) { return; } PlayerMobile pm = from as PlayerMobile; if (pm == null) { return; } IPoint3D location = target as IPoint3D; if (location == null) { return; } Map map = from.Map; if (map == null) { return; } SpellHelper.GetSurfaceTop(ref location); if (location is Mobile) { targetLocation = (Mobile)location; } else { targetLocation = new Entity(Serial.Zero, new Point3D(location), map); } if (!map.CanSpawnMobile(targetLocation.Location)) { from.SendLocalizedMessage(501942); // That location is blocked. return; } if (BaseBoat.IsWaterTile(targetLocation.Location, map)) { BaseBoat boatAtLocation = BaseBoat.FindBoatAt(targetLocation.Location, map); if (boatAtLocation == null) { from.SendMessage("You may only place those on dry land."); return; } } Point3D newLocation = targetLocation.Location; SpellHelper.AdjustField(ref newLocation, map, 12, false); CampingFirepitPlaced firepitPlaced = new CampingFirepitPlaced(); firepitPlaced.MoveToWorld(newLocation, map); firepitPlaced.Light(from); m_CampingFirepit.m_Charges--; if (m_CampingFirepit.m_Charges <= 0) { m_CampingFirepit.Delete(); } }