Beispiel #1
0
            public override void GetProperties(ObjectPropertyList list)
            {
                base.GetProperties(list);

                HuntTrophyAddon addon = Addon as HuntTrophyAddon;

                if (addon != null)
                {
                    list.Add(1155708, addon.Owner != null ? addon.Owner : "Unknown"); // Hunter: ~1_NAME~
                    list.Add(1155709, addon.DateKilled);                              // Date of Kill: ~1_DATE~

                    if (addon.KillLocation != null)
                    {
                        list.Add(1061114, addon.KillLocation); // Location: ~1_val~
                    }
                    list.Add(1155718, addon.Species.ToString());

                    if (addon.MeasuredBy == MeasuredBy.Length)
                    {
                        list.Add(1155711, addon.Measurement.ToString()); // Length: ~1_VAL~
                    }
                    else if (addon.MeasuredBy == MeasuredBy.Wingspan)
                    {
                        list.Add(1155710, addon.Measurement.ToString());        // Wingspan: ~1_VAL~
                    }
                    else
                    {
                        list.Add(1072225, addon.Measurement.ToString()); // Weight: ~1_WEIGHT~ stones
                    }
                }
            }
Beispiel #2
0
        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 = SouthID;
                    }
                    else if (westWall)
                    {
                        itemID = EastID;
                    }
                    else
                    {
                        from.SendLocalizedMessage(1042626); // The trophy must be placed next to a wall.
                    }
                    if (itemID > 0)
                    {
                        Item trophy;

                        if (Info.Complex)
                        {
                            trophy = new HuntTrophyAddon(m_Owner, Index, m_Measurement, m_DateKilled, m_Location);
                        }
                        else
                        {
                            trophy        = new HuntTrophy(m_Owner, Index, m_Measurement, m_DateKilled, m_Location);
                            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.
            }
        }