GetMoonPhase() public static méthode

public static GetMoonPhase ( Server.Map map, int x ) : MoonPhase
map Server.Map
x int
Résultat MoonPhase
Exemple #1
0
		public override void OnDoubleClick( Mobile from )
		{
			from.LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "You peer into the heavens, seeking the moons..." ); // You peer into the heavens, seeking the moons...

            switch ((int)Clock.GetMoonPhase(Map.Trammel, from.X, from.Y))
            {
                case 0: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: a new moon"); break;
                case 1: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: a waxing crescent moon"); break;
                case 2: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: in the first quarter"); break;
                case 3: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: waxing gibbous"); break;
                case 4: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: a full moon"); break;
                case 5: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: waning gibbous"); break;
                case 6: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: in its last quarter"); break;
                case 7: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: a waning crescent"); break;
                case 8: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Trammel: big and round, a satellite, and made of cheese"); break;
            }
            switch ((int)Clock.GetMoonPhase(Map.Felucca, from.X, from.Y))
            {
                case 0: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: a new moon"); break;
                case 1: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: a waxing crescent moon"); break;
                case 2: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: in the first quarter"); break;
                case 3: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: waxing gibbous"); break;
                case 4: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: a full moon"); break;
                case 5: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: waning gibbous"); break;
                case 6: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: in its last quarter"); break;
                case 7: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: a waning crescent"); break;
                case 8: from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "Felucca: big and round, a satellite, and made of cheese"); break;
            }
			//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.
						}
					}
				}
			}
		}
Exemple #2
0
        public bool UseGate(Mobile m)
        {
            if (m is BaseVendor)
            {
                return(false);
            }

            int idx = (int)Clock.GetMoonPhase(Map.Felucca, this.X, this.Y);

            if (idx < 0 || idx >= PMList.Felucca.Entries.Length)
            {
                idx = 0;                //Utility.Random( PMList.Felucca.Entries.Length );
            }
            Point3D loc = PMList.Felucca.Entries[idx].Location;

            Effects.PlaySound(loc, Map.Felucca, 0x1FE);
            if (loc != this.Location)
            {
                BaseCreature.TeleportPets(m, loc, Map.Felucca);

                m.Combatant = null;
                m.Warmode   = false;
                if (m.AccessLevel == AccessLevel.Player)
                {
                    m.Hidden = false;
                }
                m.Map      = Map.Felucca;
                m.Location = loc;
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public override void OnDoubleClick(Mobile from)
        {
            from.LocalOverheadMessage(MessageType.Regular, 0x3B2,
                                      1008155); // You peer into the heavens, seeking the moons...

            from.NetState.SendMessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3,
                                                    1008146 + (int)Clock.GetMoonPhase(Map.Trammel, from.X, from.Y), "", AffixType.Prepend, "Trammel : ",
                                                    "");
            from.NetState.SendMessageLocalizedAffix(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3,
                                                    1008146 + (int)Clock.GetMoonPhase(Map.Felucca, from.X, from.Y), "", AffixType.Prepend, "Felucca : ",
                                                    "");
        }
        private int GetDestinationIndex(Mobile m)
        {
            // Get the MoonPhase as an int for referencing array values in PMList
            int TramPhase = (int)Clock.GetMoonPhase(Map.Trammel, m.X, m.Y);
            int FelPhase  = (int)Clock.GetMoonPhase(Map.Felucca, m.X, m.Y);

            // Calculate the number of steps between the moon phases.
            // Default Steps to 1 so that we always move at least one step (when phases are the same)
            int Steps = 1;

            if (FelPhase > TramPhase)
            {
                Steps = FelPhase - TramPhase;
            }
            else if (TramPhase > FelPhase)
            {
                Steps = (8 - TramPhase) + FelPhase;
            }

            // Figure out our current location
            // Then we can use that to calculate which gate we need to move to, based on the Steps.
            int CurLoc = 0;

            for (int i = 0; i < PMList.Felucca.Entries.Length; i++)
            {
                if (PMList.Felucca.Entries[i].Location == this.Location)
                {
                    CurLoc = i;
                }
            }

            // Calculate the destination index, based on our current location and the number of steps to move.
            int destIndex = 0;

            if (CurLoc + Steps > 7)
            {
                destIndex = (CurLoc + Steps) - 8;
            }
            else
            {
                destIndex = CurLoc + Steps;
            }

            if (CurLoc == destIndex)
            {
                destIndex++;
            }
            if (CurLoc > 7)
            {
                destIndex -= destIndex;
            }
            return(destIndex);
        }
Exemple #5
0
        public void UseGate(Mobile m)
        {
            m.Combatant = null;
            m.Warmode   = false;

            int moonPhase = (int)Clock.GetMoonPhase(m.Map, m.X, m.Y);

            m.MoveToWorld(PMList.Felucca.Entries[moonPhase].Location, Map.Felucca);
            BaseCreature.TeleportPets(m, PMList.Felucca.Entries[moonPhase].Location, Map.Felucca);

            Effects.PlaySound(PMList.Felucca.Entries[moonPhase].Location, Map.Felucca, 0x1FE);

            if (!m.Hidden || m.AccessLevel == AccessLevel.Player)
            {
                Effects.PlaySound(m.Location, m.Map, 0x20E);
            }
        }
Exemple #6
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.NetState, 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.NetState, 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.
                        }
                    }
                }
            }
        }
Exemple #7
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 : ", ""));

            // Scriptiz : on ne joue pas sur felucca
            //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;

            /* Scriptiz : Code pour repérer les autres bateaux (source : Alambik) */
            // Get the maximum range the player can see
            // A cartograph master with a tracking master experience lead to see to 125 tiles: A true captain!
            int MinimumRange      = 25; //Regular 800x600 screen + "normal" extra
            int MaximumExtraRange = 100;
            int ExtraRange        = MaximumExtraRange *
                                    ((int)(from.Skills[SkillName.Cartography].Value) +
                                     (int)(from.Skills[SkillName.Tracking].Value)) / 200;
            int range = MinimumRange + ExtraRange;

            foreach (Item item in from.GetItemsInRange(range))
            {
                if (item is BaseBoat)
                {
                    // Player can see the boat
                    BaseBoat baseboat = (BaseBoat)item;
                    if (!(baseboat.Contains(from))) // On va éviter de répeter qu'on voit son propre bateau
                    {
                        /* Scriptiz : implémentation du tracking */
                        // If the player is good at tracking, let him track a mobile on the boat
                        if (from.Skills[SkillName.Tracking].Value * 2 >= from.GetDistanceToSqrt(baseboat.Location))
                        {
                            foreach (Mobile m in baseboat.GetMobilesInRange(15))
                            {
                                if (m == null)
                                {
                                    continue;
                                }
                                if (baseboat.Contains(m))
                                {
                                    from.QuestArrow = new TrackArrow(from, m, range);
                                    break;
                                }
                            }
                        }

                        // Get the name if not too far
                        string name = "un navire";
                        if (from.InRange(item.Location, MinimumRange + MaximumExtraRange / 5))
                        {
                            if (baseboat.ShipName != null)
                            {
                                name = "le" + baseboat.ShipName;
                            }
                        }

                        // Is it far?
                        string distance = "à l'horizon";
                        if (from.InRange(item.Location, MinimumRange + MaximumExtraRange * 1 / 5))
                        {
                            distance = "à côté";
                        }
                        else if (from.InRange(item.Location, MinimumRange + MaximumExtraRange * 2 / 5))
                        {
                            distance = "proche";
                        }
                        else if (from.InRange(item.Location, MinimumRange + MaximumExtraRange * 3 / 5))
                        {
                            distance = "loin";
                        }
                        else if (from.InRange(item.Location, MinimumRange + MaximumExtraRange * 4 / 5))
                        {
                            distance = "très loin";
                        }

                        // Get the relative direction of the seen boat
                        string direction;
                        // north/south
                        if (from.Y < baseboat.Y)
                        {
                            direction = "Sud";
                        }
                        else
                        {
                            direction = "Nord";
                        }
                        // east/west (Scriptiz : correction est <> ouest)
                        if (from.X < baseboat.X)
                        {
                            direction = direction + " Est";
                        }
                        else
                        {
                            direction = direction + " Ouest";
                        }

                        //Does the boat is moving?
                        string mobility = "est immobile";
                        if (baseboat.IsMoving)
                        {
                            mobility = "bouge vers ";
                            switch (baseboat.Moving)
                            {
                            case Direction.North: mobility += "le nord"; break;

                            case Direction.South: mobility += "le sud"; break;

                            case Direction.East: mobility += "l'est"; break;

                            case Direction.West: mobility += "l'ouest"; break;

                            case Direction.Up: mobility += "le nord-ouest"; break;

                            case Direction.Down: mobility += "le sud-est"; break;

                            case Direction.Left: mobility += "le sud-ouest"; break;

                            case Direction.Right: mobility += "le nord-est"; break;

                            default: break;
                            }
                        }
                        from.SendMessage("Vous voyez {0} au {1}. Il est {2} et {3}.", name, direction, distance, mobility);
                    }
                }
            }
            /* Scriptiz : fin du code de Alambik */

            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.
                        }
                    }
                }
            }
        }
Exemple #8
0
        public override void OnSingleClick(Mobile from)
        {
            int moonPhase = (int)Clock.GetMoonPhase(from.Map, from.X, from.Y);

            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("Through the moongate you {0}", PMList.Felucca.Entries[moonPhase].Description)));
        }
Exemple #9
0
        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}");
        }