public virtual void AddTrunk() { if (m_Trunk != null) { m_Trunk.Delete(); } if (TrunkID > 0) { m_TrunkID = TrunkID; m_Trunk = new Static(TrunkID); m_Trunk.Name = "a tree trunk"; m_Trunk.MoveToWorld(this.Location, this.Map); } }
protected override void OnTick() { if (m_Water != null) { m_Water.Delete(); } }
protected override void OnTick() { if (m_Count == 0) { m_Sparkle = new Static(14201); m_Sparkle.MoveToWorld(m_Player.Location, m_Player.Map); } if (m_Count == 2) { if (!m_Player.Hidden) { Timer.DelayCall(TimeSpan.FromSeconds(1.2), new TimerStateCallback(Hide_Callback), m_Player); } else { m_Player.Hidden = !m_Player.Hidden; } m_Player.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.CenterFeet); m_Player.PlaySound(0x208); m_Sparkle.Delete(); Stop(); return; } m_Count++; }
public override void Delete() { if (Static != null) { Static.Delete(); } Static = null; base.Delete(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); Static = reader.ReadItem(); if (Static != null) { Static.Delete(); } Delete(); }
public override void Execute(Server.Commands.CommandEventArgs args, object o) { if (o is AddonComponent) { BaseAddon addon = ((AddonComponent)o).Addon; if (addon.Components.Count > 0) { for (int i = 0; i < addon.Components.Count; i++) { AddonComponent component = (addon.Components)[i]; Item newItem = new Item(component.ItemID) { Hue = component.Hue, Name = component.Name }; newItem.MoveToWorld(new Point3D(component.Location), component.Map); } } addon.Delete(); AddResponse("The add-on has been converted to an item."); } else if (o is Static) { Static s = (Static)o; Item newItem = new Item(s.ItemID) { Hue = s.Hue, Layer = s.Layer, Light = s.Light, Name = s.Name }; newItem.MoveToWorld(new Point3D(s.Location), s.Map); if (s.Parent == args.Mobile) { newItem.Bounce(args.Mobile); } s.Delete(); AddResponse("The static has been converted to an item."); } else { LogFailure("This command only works with static items or add-ons."); } }
public ActionResult Delete(int id, FormCollection collection) { Static model = Static.FindBy(id); try { model.Delete(); // TODO: Add delete logic here return(RedirectToAction("Index")); } catch { return(View(model)); } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 0: m_MinDelay = reader.ReadTimeSpan(); m_MaxDelay = reader.ReadTimeSpan(); m_Static = (Static)reader.ReadItem(); if (m_Static != null) m_Static.Delete(); List<Item> list = reader.ReadStrongItemList(); foreach (Item item in list) if(item != null && !item.Deleted) item.Delete(); break; } }