protected override void OnTarget(Mobile from, object o) { if (!BaseCommand.IsAccessible(from, o)) { from.SendMessage("That is not accessible."); return; } if (o is BaseGrapeVine) { BaseGrapeVine vine = (BaseGrapeVine)o; if (!vine.Deleted && vine.Placer == from) { from.Target = new VineMoveToTarget(o); } else { from.SendMessage("Invalid target. Only grapevines that you placed can be moved."); } } else { from.SendMessage("Invalid target. Only grapevines that you placed can be moved."); } }
protected override void OnTarget(Mobile from, object o) { if (!BaseCommand.IsAccessible(from, o)) { from.SendMessage("That is not accessible."); return; } if (o is BaseGrapeVine) { BaseGrapeVine vine = (BaseGrapeVine)o; if (vine.Placer == from) { if (VinePlacement.RefundForVine(from)) { ((Item)o).Delete(); } } else { from.SendMessage("Invalid target. Only grapevines that you placed can be deleted."); } } else { from.SendMessage("Invalid target. Only grapevines that you placed can be deleted."); } }
protected override void OnTarget(Mobile from, object o) { IPoint3D p = o as IPoint3D; if (p != null) { object obj = Activator.CreateInstance(m_Types[m_IType].m_Type); if (obj is BaseGrapeVine) { if (m_IVariety < 0 || m_IVariety > m_Grapes.Length) { m_IVariety = 0; } BaseGrapeVine vine = (BaseGrapeVine)obj; vine.Movable = false; vine.Variety = m_Grapes[m_IVariety].m_Variety; if (from.AccessLevel == AccessLevel.Player) { vine.Placer = from; } Point3D loc = new Point3D(p); if (p is StaticTarget) { loc.Z -= TileData.ItemTable[((StaticTarget)p).ItemID & 0x3FFF].CalcHeight; } if (VinePlacement.ValidatePlacement(loc, from, o)) { if ((from.AccessLevel == AccessLevel.Player && VinePlacement.PayForVine(from)) || from.AccessLevel > AccessLevel.Player) { vine.MoveToWorld(loc, from.Map); string addnotice = m_Types[m_IType].m_VineName + " Added"; from.SendGump(new AddGrapeVineGump(from, addnotice, m_IVariety, GumpPage.None)); } else { string addnotice = "You cannot afford to place this vine!"; from.SendGump(new AddGrapeVineGump(from, addnotice, m_IVariety, GumpPage.None)); } } else { vine.Delete(); string addnotice = "Invalid target or something is blocking vine placement."; from.SendGump(new AddGrapeVineGump(from, addnotice, m_IVariety, GumpPage.None)); } } } }