Пример #1
0
        public static void Setup(CommandEventArgs e)
        {
            Mobile m = e.Mobile;

            TradeMinister    minister;
            CityHerald       herald;
            GuardCaptain     capt;
            CityStone        stone;
            CityItemDonation itemdonation;
            CityPetDonation  petdonation;
            BoxOfRopes       box;
            CityMessageBoard board;

            foreach (int c in Enum.GetValues(typeof(City)))
            {
                City city             = (City)c;
                CityLoyaltySystem sys = null;

                switch (city)
                {
                case City.Moonglow: sys = CityLoyaltySystem.Moonglow; break;

                case City.Britain: sys = CityLoyaltySystem.Britain; break;

                case City.Jhelom: sys = CityLoyaltySystem.Jhelom; break;

                case City.Yew: sys = CityLoyaltySystem.Yew; break;

                case City.Minoc: sys = CityLoyaltySystem.Minoc; break;

                case City.Trinsic: sys = CityLoyaltySystem.Trinsic; break;

                case City.SkaraBrae: sys = CityLoyaltySystem.SkaraBrae; break;

                case City.NewMagincia: sys = CityLoyaltySystem.NewMagincia; break;

                case City.Vesper: sys = CityLoyaltySystem.Vesper; break;
                }

                if (sys != null)
                {
                    minister     = new TradeMinister(sys.City);
                    herald       = new CityHerald(sys.City);
                    capt         = new GuardCaptain(sys.City);
                    stone        = new CityStone(sys);
                    itemdonation = new CityItemDonation(sys.City, minister);
                    petdonation  = new CityPetDonation(sys.City, minister);
                    box          = new BoxOfRopes(sys.City);
                    board        = new CityMessageBoard(sys.City, sys.City == City.Trinsic ? 7775 : 7774);

                    if (!HasType(sys, minister.GetType()))
                    {
                        sys.Minister = minister;
                        minister.MoveToWorld(sys.Definition.TradeMinisterLocation, Map.Trammel);
                    }
                    else
                    {
                        minister.Delete();
                    }

                    if (!HasType(sys, herald.GetType()))
                    {
                        sys.Herald = herald;
                        herald.MoveToWorld(sys.Definition.HeraldLocation, Map.Trammel);
                    }
                    else
                    {
                        herald.Delete();
                    }

                    if (!HasType(sys, capt.GetType()))
                    {
                        sys.Captain = capt;
                        capt.MoveToWorld(sys.Definition.GuardsmanLocation, Map.Trammel);
                    }
                    else
                    {
                        capt.Delete();
                    }

                    if (!HasType(sys, stone.GetType()))
                    {
                        sys.Stone = stone;
                        stone.MoveToWorld(sys.Definition.StoneLocation, Map.Trammel);
                    }
                    else
                    {
                        stone.Delete();
                    }

                    if (!HasType(sys, itemdonation.GetType()))
                    {
                        itemdonation.MoveToWorld(new Point3D(sys.Definition.TradeMinisterLocation.X, sys.Definition.TradeMinisterLocation.Y - 1, sys.Definition.TradeMinisterLocation.Z), Map.Trammel);
                    }
                    else
                    {
                        itemdonation.Delete();
                    }

                    if (!HasType(sys, petdonation.GetType()))
                    {
                        petdonation.MoveToWorld(new Point3D(sys.Definition.TradeMinisterLocation.X, sys.Definition.TradeMinisterLocation.Y - 2, sys.Definition.TradeMinisterLocation.Z), Map.Trammel);
                    }
                    else
                    {
                        petdonation.Delete();
                    }

                    if (!HasType(sys, box.GetType()))
                    {
                        box.MoveToWorld(new Point3D(sys.Definition.GuardsmanLocation.X, sys.Definition.GuardsmanLocation.Y - 1, sys.Definition.GuardsmanLocation.Z), Map.Trammel);
                    }
                    else
                    {
                        box.Delete();
                    }

                    if (!HasType(sys, board.GetType()))
                    {
                        board.MoveToWorld(sys.Definition.BoardLocation, Map.Trammel);
                    }
                    else
                    {
                        board.Delete();
                    }

                    sys.CanUtilize = true;

                    m.SendMessage("{0} setup!", sys.Definition.Name);
                }
            }

            for (int i = 0; i < 3; i++)
            {
                string  name;
                Point3D p;

                switch (i)
                {
                default:
                case 0:
                    name = "Ocllo";
                    p    = new Point3D(3674, 2648, 0);
                    break;

                case 1:
                    name = "Nujel'm";
                    p    = new Point3D(3765, 1219, 0);
                    break;

                case 2:
                    name = "Serpent's Hold";
                    p    = new Point3D(3017, 3452, 15);
                    break;
                }

                Region r = Region.Regions.FirstOrDefault(reg => reg.Map == Map.Felucca && reg.Name == name);

                if (r != null)
                {
                    var slim = new SlimTheFence();

                    if (!HasType(r, slim.GetType()))
                    {
                        slim.MoveToWorld(p, Map.Felucca);
                    }
                    else
                    {
                        slim.Delete();
                    }
                }
                else
                {
                    Console.WriteLine("WARNING: {0} Region not found!", name);
                }
            }
        }
Пример #2
0
        public static void Setup(CommandEventArgs e)
        {
            Mobile m = e.Mobile;

            TradeMinister minister;
            CityHerald herald;
            GuardCaptain capt;
            CityStone stone;
            CityItemDonation itemdonation;
            CityPetDonation petdonation;
            BoxOfRopes box;
            CityMessageBoard board;

            foreach (int c in Enum.GetValues(typeof(City)))
            {
                City city = (City)c;
                CityLoyaltySystem sys = null;

                switch (city)
                {
                    case City.Moonglow: sys = CityLoyaltySystem.Moonglow; break;
                    case City.Britain: sys = CityLoyaltySystem.Britain; break;
                    case City.Jhelom: sys = CityLoyaltySystem.Jhelom; break;
                    case City.Yew: sys = CityLoyaltySystem.Yew; break;
                    case City.Minoc: sys = CityLoyaltySystem.Minoc; break;
                    case City.Trinsic: sys = CityLoyaltySystem.Trinsic; break;
                    case City.SkaraBrae: sys = CityLoyaltySystem.SkaraBrae; break;
                    case City.NewMagincia: sys = CityLoyaltySystem.NewMagincia; break;
                    case City.Vesper: sys = CityLoyaltySystem.Vesper; break;
                }

                if (sys != null)
                {
                    minister = new TradeMinister(sys.City);
                    herald = new CityHerald(sys.City);
                    capt = new GuardCaptain(sys.City);
                    stone = new CityStone(sys);
                    itemdonation = new CityItemDonation(sys.City, minister);
                    petdonation = new CityPetDonation(sys.City, minister);
                    box = new BoxOfRopes(sys.City);
                    board = new CityMessageBoard(sys.City, sys.City == City.Trinsic ? 7775 : 7774);

                    if (!HasType(sys, minister.GetType()))
                    {
                        sys.Minister = minister;
                        minister.MoveToWorld(sys.Definition.TradeMinisterLocation, Map.Trammel);
                    }
                    else
                        minister.Delete();

                    if (!HasType(sys, herald.GetType()))
                    {
                        sys.Herald = herald;
                        herald.MoveToWorld(sys.Definition.HeraldLocation, Map.Trammel);
                    }
                    else
                        herald.Delete();

                    if (!HasType(sys, capt.GetType()))
                    {
                        sys.Captain = capt;
                        capt.MoveToWorld(sys.Definition.GuardsmanLocation, Map.Trammel);
                    }
                    else
                        capt.Delete();

                    if (!HasType(sys, stone.GetType()))
                    {
                        sys.Stone = stone;
                        stone.MoveToWorld(sys.Definition.StoneLocation, Map.Trammel);
                    }
                    else
                        stone.Delete();

                    if (!HasType(sys, itemdonation.GetType()))
                        itemdonation.MoveToWorld(new Point3D(sys.Definition.TradeMinisterLocation.X, sys.Definition.TradeMinisterLocation.Y - 1, sys.Definition.TradeMinisterLocation.Z), Map.Trammel);
                    else
                        itemdonation.Delete();

                    if (!HasType(sys, petdonation.GetType()))
                        petdonation.MoveToWorld(new Point3D(sys.Definition.TradeMinisterLocation.X, sys.Definition.TradeMinisterLocation.Y - 2, sys.Definition.TradeMinisterLocation.Z), Map.Trammel);
                    else
                        petdonation.Delete();

                    if (!HasType(sys, box.GetType()))
                        box.MoveToWorld(new Point3D(sys.Definition.GuardsmanLocation.X, sys.Definition.GuardsmanLocation.Y - 1, sys.Definition.GuardsmanLocation.Z), Map.Trammel);
                    else
                        box.Delete();

                    if(!HasType(sys, board.GetType()))
                        board.MoveToWorld(sys.Definition.BoardLocation, Map.Trammel);
                    else
                        board.Delete();
                    
                    sys.CanUtilize = true;

                    m.SendMessage("{0} setup!", sys.Definition.Name);
                }
            }

            for (int i = 0; i < 3; i++)
            {
                string name;
                Point3D p;

                switch (i)
                {
                    default:
                    case 0:
                        name = "Ocllo";
                        p = new Point3D(3674, 2648, 0);
                        break;
                    case 1:
                        name = "Nujel'm";
                        p = new Point3D(3765, 1219, 0);
                        break;
                    case 2:
                        name = "Serpent's Hold";
                        p = new Point3D(3017, 3452, 15);
                        break;
                }

                Region r = Region.Regions.FirstOrDefault(reg => reg.Map == Map.Felucca && reg.Name == name);

                if (r != null)
                {
                    var slim = new SlimTheFence();

                    if (!HasType(r, slim.GetType()))
                        slim.MoveToWorld(p, Map.Felucca);
                    else
                        slim.Delete();
                }
                else
                    Console.WriteLine("WARNING: {0} Region not found!", name);
            }
            
        }