Пример #1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 1)
            {
                PublicMoongate closestGate = null;
                double         closestDist = 0;

                foreach (PublicMoongate gate in PublicMoongate.Moongates.Where(mg => mg.Map == User.Map))
                {
                    double dist = User.GetDistanceToSqrt(gate);

                    if (closestGate == null || dist < closestDist)
                    {
                        closestDist = dist;
                        closestGate = gate;
                    }
                }

                if (closestGate != null)
                {
                    for (int i = 0; i < 25; i++)
                    {
                        Point3D p = new Rectangle2D(closestGate.X - 5, closestGate.Y - 5, 10, 10).GetRandomSpawnPoint(User.Map);

                        if (closestGate.Map.CanFit(p.X, p.Y, p.Z, 16, false, true, true))
                        {
                            BaseCreature.TeleportPets(User, p, closestGate.Map);
                            User.MoveToWorld(p, closestGate.Map);

                            return;
                        }
                    }
                }
                else
                {
                    User.SendLocalizedMessage(1155584); // You are now open to attack!
                }
            }
            else
            {
                User.SendLocalizedMessage(1155584); // You are now open to attack!
            }
        }
Пример #2
0
        private static void DecorateTOL_OnCommand(CommandEventArgs e)
        {
            e.Mobile.SendMessage("Generating Time Of Legends world decoration, please wait.");

            Decorate.Generate("tol", "Data/Decoration/TimeOfLegends/TerMur", Map.TerMur);
            Decorate.Generate("tol", "Data/Decoration/TimeOfLegends/Felucca", Map.Felucca);

            ChampionSpawn sp = new ChampionSpawn
            {
                Type = ChampionSpawnType.DragonTurtle
            };

            sp.MoveToWorld(new Point3D(451, 1696, 65), Map.TerMur);
            sp.Active = true;
            WeakEntityCollection.Add("tol", sp);

            sp = new ChampionSpawn
            {
                SpawnRadius = 35,
                SpawnMod    = .5,
                KillsMod    = .5,
                Type        = ChampionSpawnType.DragonTurtle
            };
            sp.MoveToWorld(new Point3D(7042, 1889, 60), Map.Felucca);
            sp.Active = true;
            WeakEntityCollection.Add("tol", sp);

            PublicMoongate gate = new PublicMoongate();

            gate.MoveToWorld(new Point3D(719, 1863, 40), Map.TerMur);

            ShadowguardController.SetupShadowguard(e.Mobile);
            Engines.MyrmidexInvasion.GenerateMyrmidexQuest.Generate();

            MacawSpawner.Generate();

            CommandSystem.Handle(e.Mobile, CommandSystem.Prefix + "XmlLoad Spawns/Eodon.xml");

            e.Mobile.SendMessage("Time Of Legends world generating complete.");
        }
Пример #3
0
        public static void EventSink_Speech(SpeechEventArgs args)
        {
            Mobile       from    = args.Mobile;
            PlayerMobile speaker = from as PlayerMobile;

            if (speaker == null)
            {
                return;                  // in case they are pseudoseering
            }
            int[] keywords = args.Keywords;

            if (args.Speech.ToLower().IndexOf("i wish to buy my head") > -1)
            {
                var turnedinhead = BaseShieldGuard.PendingStatloss.FirstOrDefault(x => x.HeadOwner == speaker);
                if (turnedinhead != null)
                {
                    if (Banker.Withdraw(speaker, typeof(Gold), 30000))
                    {
                        BaseShieldGuard.PendingStatloss.Remove(turnedinhead);
                        from.SendMessage(61, "You have successfully purchased your head back from the guards.");
                        turnedinhead.TurnedIn.BankBox.DropItem(new Gold(25000));
                        turnedinhead.TurnedIn.SendMessage(61, "You have received 25,000gp for the head of " + from.RawName + ".");
                    }
                    else
                    {
                        from.SendMessage(61, "You do not have enough gold to buy back your head from the guards!");
                    }
                }
                else
                {
                    foreach (Head2 head in Head2.AllHeads)
                    {
                        if (head == null)
                        {
                            continue;
                        }
                        if (head.Player == from)
                        {
                            from.SendMessage("Select a player with whom you wish to negotiate for your head!");
                            from.CloseGump(typeof(HeadOwnerListGump));
                            from.SendGump(new HeadOwnerListGump(from));
                            return;
                        }
                    }
                    from.SendMessage("Nobody in possession of your head was found.");
                }
            }

            for (int i = 0; i < keywords.Length; ++i)
            {
                switch (keywords[i])
                {
                case 0x002A:                         // *i resign from my guild*
                {
                    if (from.Guild != null)
                    {
                        if (SpellHelper.CheckCombat(from) || PublicMoongate.CheckCombat(from))
                        {
                            from.SendMessage("You cannot leave your guild while in combat.");
                        }
                        else
                        {
                            ((Guild)from.Guild).RemoveMember(from);
                        }
                    }

                    break;
                }

                case 0x0032:                         // *i must consider my sins*
                {
                    speaker.CheckKillDecay();
                    from.SendMessage(32, "Murder Counts : {0}", from.Kills);
                    if (speaker.InStat)      //check to see if statend time is still greater than current time
                    {
                        TimeSpan remaining = (speaker.StatEnd - DateTime.UtcNow);
                        from.SendMessage(32, "You are in statloss for: {0}", FormatTimeSpan(remaining));
                    }
                    else
                    {      //always try to clear the stat loss at this time
                        // note that it's checked on a 30 minute timer (in FoodDecay.cs)
                        // so this could save them a little time
                        BaseShieldGuard.StatLossDecay(speaker);
                    }

                    /*if ( from.ShortTermMurders < Mobile.MurderCount )
                     * {
                     *      if ( from.Kills < Mobile.MurderCount ) // not red, no stat loss
                     *      {
                     *              if ( from.ShortTermMurders <= 0 )
                     *                      from.SendLocalizedMessage( 502122, Notoriety.Hues[Notoriety.Innocent] ); // Fear not, thou hast not slain the innocent.
                     *              else
                     *                      from.SendLocalizedMessage( 502124, Notoriety.Hues[Notoriety.Innocent] ); // Fear not, thou hast not slain the innocent in some time...
                     *      }
                     *      else
                     *              from.SendLocalizedMessage( 502123, Notoriety.Hues[Notoriety.Innocent] ); // You are known throughout the land as a murderous brigand.
                     * }
                     * else // stat loss
                     * {
                     *      if ( from.Kills < Mobile.MurderCount ) //not red
                     *              from.SendLocalizedMessage( 502126, Notoriety.Hues[Notoriety.Murderer] ); // If thou should return to the land of the living, the innocent shall wreak havoc upon thy soul.
                     *      else
                     *              from.SendLocalizedMessage( 502123, Notoriety.Hues[Notoriety.Murderer] ); // You are known throughout the land as a murderous brigand.
                     * }
                     * /*
                     * if( !Core.SE )
                     * {
                     *      from.SendMessage( "Short Term Murders : {0}", from.ShortTermMurders );
                     *      from.SendMessage( "Long Term Murders : {0}",  from.Kills );
                     * }
                     * else
                     * {
                     *      from.SendMessage( 0x3B2, "Short Term Murders: {0} Long Term Murders: {1}", from.ShortTermMurders, from.Kills );
                     * }
                     */
                    break;
                }

                case 0x0035:                         // i renounce my young player status*
                {
                    if (from is PlayerMobile && ((PlayerMobile)from).Young && !from.HasGump(typeof(RenounceYoungGump)))
                    {
                        from.SendGump(new RenounceYoungGump());
                    }

                    break;
                }
                }
            }
        }