private void Replace() { var trophy = new HuntTrophy(m_Owner, Index, m_Measurement, m_DateKilled, m_Location); if (Parent is Container) { ((Container)Parent).DropItem(trophy); } else { BaseHouse house = BaseHouse.FindHouseAt(this); trophy.MoveToWorld(GetWorldLocation(), Map); trophy.IsLockedDown = IsLockedDown; trophy.IsSecure = IsSecure; trophy.Movable = Movable; if (house != null && house.LockDowns.ContainsKey(this)) { house.LockDowns.Remove(this); house.LockDowns.Add(trophy, house.Owner); } else if (house != null && house.IsSecure(this)) { house.ReleaseSecure(house.Owner, this); house.AddSecure(house.Owner, trophy); } } Delete(); }
public override void OnDoubleClick(Mobile from) { if (IsChildOf(from.Backpack)) { BaseHouse house = BaseHouse.FindHouseAt(from); if (house != null && house.IsCoOwner(from)) { bool northWall = BaseAddon.IsWall(from.X, from.Y - 1, from.Z, from.Map); bool westWall = BaseAddon.IsWall(from.X - 1, from.Y, from.Z, from.Map); if (northWall && westWall) { switch (from.Direction & Direction.Mask) { case Direction.North: case Direction.South: northWall = true; westWall = false; break; case Direction.East: case Direction.West: northWall = false; westWall = true; break; default: from.SendMessage("Turn to face the wall on which to hang this trophy."); return; } } int itemID = 0; if (northWall) { itemID = m_SouthID; } else if (westWall) { itemID = EastID; } else { from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall. } if (itemID > 0) { Item trophy = new HuntTrophy(m_Owner, m_MeasuredBy, m_Measurement, m_SouthID, m_DateKilled, m_Location, m_Species); trophy.ItemID = itemID; trophy.MoveToWorld(from.Location, from.Map); house.Addons[trophy] = from; Delete(); } } else { from.SendLocalizedMessage(502092); // You must be in your house to do this. } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }
public override void OnDoubleClick(Mobile from) { if (IsChildOf(from.Backpack)) { BaseHouse house = BaseHouse.FindHouseAt(from); if (house != null && house.IsCoOwner(from)) { bool northWall = BaseAddon.IsWall(from.X, from.Y - 1, from.Z, from.Map); bool westWall = BaseAddon.IsWall(from.X - 1, from.Y, from.Z, from.Map); if (northWall && westWall) { switch (from.Direction & Direction.Mask) { case Direction.North: case Direction.South: northWall = true; westWall = false; break; case Direction.East: case Direction.West: northWall = false; westWall = true; break; default: from.SendMessage("Turn to face the wall on which to hang this trophy."); return; } } int itemID = 0; if (northWall) itemID = m_SouthID; else if (westWall) itemID = EastID; else from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall. if (itemID > 0) { Item trophy = new HuntTrophy(m_Owner, m_MeasuredBy, m_Measurement, m_SouthID, m_DateKilled, m_Location, m_Species); trophy.ItemID = itemID; trophy.MoveToWorld(from.Location, from.Map); house.Addons.Add(trophy); Delete(); } } else { from.SendLocalizedMessage(502092); // You must be in your house to do this. } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }