Inheritance: Item
Exemplo n.º 1
0
        public static void GetTime(Clock item, Mobile from, Map map, int x, int y, out int generalNumber, out string exactTime)
        {
            int hours, minutes;

            GetTime(map, x, y, out hours, out minutes);

            // 00:00 AM - 00:59 AM : Witching hour
            // 01:00 AM - 03:59 AM : Middle of night
            // 04:00 AM - 07:59 AM : Early morning
            // 08:00 AM - 11:59 AM : Late morning
            // 12:00 PM - 12:59 PM : Noon
            // 01:00 PM - 03:59 PM : Afternoon
            // 04:00 PM - 07:59 PM : Early evening
            // 08:00 PM - 11:59 AM : Late at night

            if (hours >= 20)
            {
                if (item != null)
                {
                    from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "It's late at night"));
                }

                generalNumber = 1042957; // It's late at night
            }
            else if (hours >= 16)
            {
                if (item != null)
                {
                    from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "It's early in the evening"));
                }

                generalNumber = 1042956; // It's early in the evening
            }
            else if (hours >= 13)
            {
                if (item != null)
                {
                    from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "It's the afternoon"));
                }

                generalNumber = 1042955; // It's the afternoon
            }
            else if (hours >= 12)
            {
                if (item != null)
                {
                    from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "It's around noon"));
                }

                generalNumber = 1042954; // It's around noon
            }
            else if (hours >= 08)
            {
                if (item != null)
                {
                    from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "It's late in the morning"));
                }

                generalNumber = 1042953; // It's late in the morning
            }
            else if (hours >= 04)
            {
                if (item != null)
                {
                    from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "It's early in the morning"));
                }

                generalNumber = 1042952; // It's early in the morning
            }
            else if (hours >= 01)
            {
                if (item != null)
                {
                    from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "It's the middle of the night"));
                }

                generalNumber = 1042951; // It's the middle of the night
            }
            else
            {
                if (item != null)
                {
                    from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", "'Tis the witching hour. 12 Midnight."));
                }

                generalNumber = 1042950; // 'Tis the witching hour. 12 Midnight.
            }

            hours %= 12;

            if (hours == 0)
            {
                hours = 12;
            }

            if (item != null)
            {
                from.Send(new AsciiMessage(item.Serial, item.ItemID, MessageType.Regular, 0, 3, "", String.Format("{0}:{1:D2} to be exact", hours, minutes)));
            }

            exactTime = String.Format("{0}:{1:D2}", hours, minutes);
        }
        private void UpdateImage()
        {
            int hours;
            int minutes;

            Clock.GetTime(Map, X, Y, out hours, out minutes);

            if (FacingSouth)
            {
                if (hours < 4)
                {
                    ItemID = 0x2A60;
                }
                else if (hours < 6)
                {
                    ItemID = 0x2A5F;
                }
                else if (hours < 8)
                {
                    ItemID = 0x2A5E;
                }
                else if (hours < 16)
                {
                    ItemID = 0x2A5D;
                }
                else if (hours < 18)
                {
                    ItemID = 0x2A5E;
                }
                else if (hours < 20)
                {
                    ItemID = 0x2A5F;
                }
                else
                {
                    ItemID = 0x2A60;
                }
            }
            else
            {
                if (hours < 4)
                {
                    ItemID = 0x2A64;
                }
                else if (hours < 6)
                {
                    ItemID = 0x2A63;
                }
                else if (hours < 8)
                {
                    ItemID = 0x2A62;
                }
                else if (hours < 16)
                {
                    ItemID = 0x2A61;
                }
                else if (hours < 18)
                {
                    ItemID = 0x2A62;
                }
                else if (hours < 20)
                {
                    ItemID = 0x2A63;
                }
                else
                {
                    ItemID = 0x2A64;
                }
            }
        }
Exemplo n.º 3
0
 public static void GetTime(Clock item, Mobile from, out int generalNumber, out string exactTime)
 {
     GetTime(item, from, from.Map, from.X, from.Y, out generalNumber, out exactTime);
 }
Exemplo n.º 4
0
        public override void OnDoubleClick(Mobile from)
        {
            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1008155);               // You peer into the heavens, seeking the moons...

            from.Send(new MessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Trammel, from.X, from.Y), "", AffixType.Prepend, "Trammel : ", ""));
            from.Send(new MessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Felucca, from.X, from.Y), "", AffixType.Prepend, "Felucca : ", ""));

            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                QuestSystem qs = player.Quest;

                if (qs is WitchApprenticeQuest)
                {
                    FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;

                    if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.StarChart)
                    {
                        int hours, minutes;
                        Clock.GetTime(from.Map, from.X, from.Y, out hours, out minutes);

                        if (hours < 5 || hours > 17)
                        {
                            player.SendLocalizedMessage(1055040);                               // You gaze up into the glittering night sky.  With great care, you compose a chart of the most prominent star patterns.

                            obj.Complete();
                        }
                        else
                        {
                            player.SendLocalizedMessage(1055039);                               // You gaze up into the sky, but it is not dark enough to see any stars.
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
        public override void OnDoubleClick(Mobile from)
        {
            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1008155); // You peer into the heavens, seeking the moons...

            from.Send(new MessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Trammel, from.X, from.Y), "", AffixType.Prepend, "Trammel : ", ""));
            from.Send(new MessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 1008146 + (int)Clock.GetMoonPhase(Map.Felucca, from.X, from.Y), "", AffixType.Prepend, "Felucca : ", ""));

            PlayerMobile player = from as PlayerMobile;
        }
        public override void OnSingleClick(Mobile from)
        {
            int moonPhase = (int)Clock.GetMoonPhase(from.Map, from.X, from.Y);

            LabelTo(from, $"Through the moongate you {PMList.Felucca.Entries[moonPhase].Description}");
        }
Exemplo n.º 7
0
        public override void OnSingleClick(Mobile from)
        {
            string dest = "";
            int    hours;
            int    minutes;
            int    cycle;
            int    steps = 0;

            int gateCount;
            int gateNum;
            int destNum = 0;

            PMList  list;
            PMEntry entry;

            if (Map == Map.Felucca || Map == Map.Trammel)
            {
                if (Map == Map.Felucca)
                {
                    list = PMList.Felucca;
                }
                else
                {
                    list = PMList.Trammel;
                }

                gateCount = list.Entries.Length;
                gateNum   = 0;

                for (int i = 0; i < gateCount; ++i)
                {
                    entry = list.Entries[i];
                    if (this.Location == entry.Location)
                    {
                        gateNum = i;
                        break;
                    }
                }

                Clock.GetTime(Map, X, Y, out hours, out minutes);

                cycle = (60 * hours + minutes) % 120;
                if (cycle > 7)
                {
                    ++steps;
                }
                if (cycle > 27)
                {
                    ++steps;
                }
                if (cycle > 37)
                {
                    ++steps;
                }
                if (cycle > 57)
                {
                    ++steps;
                }
                if (cycle > 67)
                {
                    ++steps;
                }
                if (cycle > 87)
                {
                    ++steps;
                }
                if (cycle > 97)
                {
                    ++steps;
                }
                if (cycle > 117)
                {
                    steps = 0;
                }

                destNum = (gateNum + steps) % gateCount;
                entry   = list.Entries[destNum];
            }

            if (destNum == 0)
            {
                dest = "see a road to the east and mountains in the distance to the west.";
            }
            else if (destNum == 1)
            {
                dest = "see a small escarpment to the south and a large city to the North.";
            }
            else if (destNum == 2)
            {
                dest = "see what appears to be a small peninsula covered in lush foliage.";
            }
            else if (destNum == 3)
            {
                dest = "see a small city to the south, while a vast ocean lies in all other directions.";
            }
            else if (destNum == 4)
            {
                dest = "see a large sandstone city standing on a far bank of the river to the north.";
            }
            else if (destNum == 5)
            {
                dest = "can just make out a road to the southwest and a river to the north.";
            }
            else if (destNum == 6)
            {
                dest = "see deep forest on all sides.";
            }
            else if (destNum == 7)
            {
                dest = "see a vast body of water to the east while to the west a city can be seen nearby.";
            }

            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("Through the moongate you {0}", dest)));
        }
Exemplo n.º 8
0
        public bool UseGate(Mobile m)
        {
            // ****************************************** //
            // **** Modified for Old Style Moongates **** //
            // ****************************************** //

            int hours;
            int minutes;
            int cycle;
            int steps = 0;

            int gateCount;
            int gateNum;
            int destNum;

            //int generalNum; // debugging only
            //string exactTime; // debugging only

            PMList  list;
            PMEntry entry;

            /*if (m.Criminal)
             * {
             *  m.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
             *  return true;
             * }
             * else if (Server.Spells.SpellHelper.CheckCombat(m))
             * {
             *  m.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
             *  return true;
             * }
             * else if (m.Spell != null)
             * {
             *  m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
             *  return true;
             * }
             * else*/
            if (Map == Map.Felucca || Map == Map.Trammel)
            {
                if (Map == Map.Felucca)
                {
                    list = PMList.Felucca;
                }
                else
                {
                    list = PMList.Trammel;
                }

                gateCount = list.Entries.Length;
                gateNum   = 0;

                for (int i = 0; i < gateCount; ++i)
                {
                    entry = list.Entries[i];
                    if (this.Location == entry.Location)
                    {
                        gateNum = i;
                        break;
                    }
                }

                Clock.GetTime(Map, X, Y, out hours, out minutes);

                cycle = (60 * hours + minutes) % 120;
                if (cycle > 7)
                {
                    ++steps;
                }
                if (cycle > 27)
                {
                    ++steps;
                }
                if (cycle > 37)
                {
                    ++steps;
                }
                if (cycle > 57)
                {
                    ++steps;
                }
                if (cycle > 67)
                {
                    ++steps;
                }
                if (cycle > 87)
                {
                    ++steps;
                }
                if (cycle > 97)
                {
                    ++steps;
                }
                if (cycle > 117)
                {
                    steps = 0;
                }

                destNum = (gateNum + steps) % gateCount;
                entry   = list.Entries[destNum];

                //// Debugging
                //Clock.GetTime(Map, X, Y, out generalNum, out exactTime);
                //Console.WriteLine("\ngateNum: {0}", gateNum);
                //Console.WriteLine("steps: {0}", steps);
                //Console.WriteLine("destNum: {0}", destNum);
                //Console.WriteLine("destXYZ: {0}, {1}, {2}", entry.Location.X, entry.Location.Y, entry.Location.Z );
                //Console.WriteLine("Time: " + exactTime);

                /*if (m.AccessLevel > AccessLevel.Player)
                 * {
                 *  m.SendMessage("You arrive safely in");
                 *  m.SendLocalizedMessage(entry.Number);
                 * }*/

                BaseCreature.TeleportPets(m, entry.Location, list.Map);

                //m.Combatant = null;
                //m.Warmode = false;
                //m.Hidden = true;

                m.MoveToWorld(entry.Location, list.Map);

                Effects.PlaySound(entry.Location, list.Map, 0x1FE);

                //Effects.PlaySound(m.Location, m.Map, 0x20E);
                return(false);
            }
            else
            {
                m.CloseGump(typeof(MoongateGump));
                m.SendGump(new MoongateGump(m, this));

                if (!m.Hidden || m.AccessLevel == AccessLevel.Player)
                {
                    Effects.PlaySound(m.Location, m.Map, 0x20E);
                }

                return(false);
            }
        }