Exemple #1
0
        public void CreateVendor(TownIDValue town, Point3D location, Map map, TownVendorType vendorType, int vendorCount, int spawnRange, int homeRange)
        {
            XmlSpawner xmlSpawner = null;

            switch (vendorType)
            {
            case TownVendorType.Banker: xmlSpawner = new XmlSpawner(new List <string> {
                    "Banker"
                }, new List <int> {
                    vendorCount
                }); break;
            }

            if (xmlSpawner == null)
            {
                return;
            }

            xmlSpawner.MoveToWorld(location, map);
            xmlSpawner.SpawnRange = spawnRange;
            xmlSpawner.HomeRange  = homeRange;
            xmlSpawner.MaxCount   = vendorCount;

            xmlSpawner.SmartRespawn();
        }
Exemple #2
0
        public Town(TownIDValue town, Map map) : base(0x0)
        {
            Visible = false;
            Movable = false;

            //-----

            region = Region.GetRegionByIndexedRegionName(RegionName);

            Towns.TownList.Add(this);
        }
Exemple #3
0
        public static Town GetTown(TownIDValue townValue)
        {
            Town townInstance = null;

            foreach (Town instance in TownList)
            {
                if (instance == null)
                {
                    continue;
                }

                if (instance.TownID == townValue)
                {
                    return(instance);
                }
            }

            return(townInstance);
        }
Exemple #4
0
        public static void CreateTown(TownIDValue town)
        {
            Town townInstance = new Town(town, Map.Felucca);

            townInstance.CreateTown();
        }