Example #1
0
 public MapInstance(Map map, Guid guid, bool shopAllowed, MapInstanceType type, InstanceBag instanceBag)
 {
     Buttons           = new List <MapButton>();
     XpRate            = 1;
     DropRate          = 1;
     InstanceMusic     = map.Music;
     ShopAllowed       = shopAllowed;
     MapInstanceType   = type;
     _isSleeping       = true;
     LastUserShopId    = 0;
     InstanceBag       = instanceBag;
     Clock             = new Clock(3);
     _random           = new Random();
     Map               = map;
     MapInstanceId     = guid;
     ScriptedInstances = new List <ScriptedInstance>();
     OnCharacterDiscoveringMapEvents = new List <Tuple <EventContainer, List <long> > >();
     OnMoveOnMapEvents = new ThreadSafeGenericList <EventContainer>();
     OnAreaEntryEvents = new ThreadSafeGenericList <ZoneEvent>();
     WaveEvents        = new List <EventWave>();
     OnMapClean        = new List <EventContainer>();
     _monsters         = new ThreadSafeSortedList <long, MapMonster>();
     _npcs             = new ThreadSafeSortedList <long, MapNpc>();
     _mapMonsterIds    = new ThreadSafeSortedList <int, int>();
     _mapNpcIds        = new ThreadSafeSortedList <int, int>();
     DroppedList       = new ThreadSafeSortedList <long, MapItem>();
     Portals           = new List <Portal>();
     UnlockEvents      = new List <EventContainer>();
     UserShops         = new Dictionary <long, MapShop>();
     StartLife();
 }
Example #2
0
        public MapInstance(Map map, Guid guid, bool shopAllowed, MapInstanceType type, InstanceBag instanceBag, bool dropAllowed = false)
        {
            OnSpawnEvents = new List <EventContainer>();
            Buttons       = new List <MapButton>();
            XpRate        = 0;

            if (type == MapInstanceType.BaseMapInstance)
            {
                XpRate = map.XpRate;
            }
            //check here
            MinLevel = 1;
            MaxLevel = 99;

            if (type != MapInstanceType.TimeSpaceInstance && type != MapInstanceType.RaidInstance)
            {
                switch (map.MapId)
                {
                case 154:     // Caligor's Realm
                    MinLevel = 80;
                    break;

                case 228:     // Cylloan
                    MinLevel = 88;
                    break;
                }
            }

            DropRate          = 0;
            DropAllowed       = dropAllowed;
            InstanceMusic     = map.Music;
            ShopAllowed       = shopAllowed;
            MapInstanceType   = type;
            _isSleeping       = true;
            LastUserShopId    = 0;
            InstanceBag       = instanceBag;
            Clock             = new Clock(3);
            _random           = new Random();
            Map               = map;
            MapInstanceId     = guid;
            ScriptedInstances = new List <ScriptedInstance>();
            OnCharacterDiscoveringMapEvents = new List <Tuple <EventContainer, List <long> > >();
            OnMoveOnMapEvents = new ThreadSafeGenericList <EventContainer>();
            OnAreaEntryEvents = new ThreadSafeGenericList <ZoneEvent>();
            WaveEvents        = new List <EventWave>();
            OnMapClean        = new List <EventContainer>();
            _monsters         = new ThreadSafeSortedList <long, MapMonster>();
            _delayedMonsters  = new ThreadSafeSortedList <long, MapMonster>();
            _npcs             = new ThreadSafeSortedList <long, MapNpc>();
            _mapMonsterIds    = new ThreadSafeSortedList <int, int>();
            _mapNpcIds        = new ThreadSafeSortedList <int, int>();
            DroppedList       = new ThreadSafeSortedList <long, MapItem>();
            Portals           = new List <Portal>();
            UnlockEvents      = new List <EventContainer>();
            UserShops         = new Dictionary <long, MapShop>();
            RemovedMobNpcList = new List <object>();
            StartLife();
        }
Example #3
0
        public MapInstance(Map map, Guid guid, bool shopAllowed, MapInstanceType type, InstanceBag instanceBag, bool dropAllowed = false)
        {
            OnSpawnEvents = new List <EventContainer>();
            Buttons       = new List <MapButton>();
            XpRate        = 0;

            if (type == MapInstanceType.BaseMapInstance)
            {
                XpRate = map.XpRate;
            }

            MinLevel     = 1;
            MaxLevel     = 99;
            MinHeroLevel = 0;
            MaxHeroLevel = 100;

            if (type != MapInstanceType.TimeSpaceInstance && type != MapInstanceType.RaidInstance)
            {
                switch (map.MapId)
                {
                case 154:     // Caligor's Realm
                    MinLevel = 80;
                    break;

                case 170:     // Desert
                case 171:
                case 172:
                case 173:
                case 174:
                case 175:
                case 176:
                case 177:
                case 178:
                case 179:
                case 180:
                case 181:
                case 182:
                case 183:
                case 184:
                case 185:
                case 186:
                case 187:
                case 188:
                case 189:
                case 190:
                case 191:
                case 192:
                case 193:
                case 194:
                case 195:
                case 196:
                case 197:
                case 198:
                case 199:
                case 200:
                case 201:
                case 202:
                case 203:
                case 204:
                case 205:
                case 207:
                case 208:
                case 209:
                case 210:
                case 211:
                case 212:
                case 223:
                case 224:
                case 225:
                case 226:
                case 227:
                    MinLevel = 70;
                    break;

                case 228:     //Cylloan
                case 229:
                case 230:
                case 231:
                case 232:
                case 233:
                case 234:
                case 235:
                case 236:
                case 237:
                case 238:
                case 239:
                case 240:
                case 241:
                case 242:
                case 243:
                case 244:
                case 245:
                case 246:
                    MinLevel = 85;
                    break;

                case 2628:
                case 2629:
                case 2630:
                case 2631:
                case 2632:
                case 2633:
                case 2634:
                case 2635:
                case 2636:
                case 2637:
                case 2638:
                case 2639:
                case 2640:
                case 2641:
                case 2642:
                case 2643:
                case 2644:
                case 2645:
                case 2646:
                case 2647:
                case 2648:
                case 2649:
                case 2650:
                    MinLevel     = 88;
                    MinHeroLevel = 10;
                    break;
                }
            }

            DropRate          = 0;
            DropAllowed       = dropAllowed;
            InstanceMusic     = map.Music;
            ShopAllowed       = shopAllowed;
            MapInstanceType   = type;
            _isSleeping       = true;
            LastUserShopId    = 0;
            InstanceBag       = instanceBag;
            Clock             = new Clock(3);
            _random           = new Random();
            Map               = map;
            MapInstanceId     = guid;
            ScriptedInstances = new List <ScriptedInstance>();
            OnCharacterDiscoveringMapEvents = new List <Tuple <EventContainer, List <long> > >();
            OnMoveOnMapEvents = new ThreadSafeGenericList <EventContainer>();
            OnAreaEntryEvents = new ThreadSafeGenericList <ZoneEvent>();
            WaveEvents        = new List <EventWave>();
            OnMapClean        = new List <EventContainer>();
            _monsters         = new ThreadSafeSortedList <long, MapMonster>();
            _delayedMonsters  = new ThreadSafeSortedList <long, MapMonster>();
            _npcs             = new ThreadSafeSortedList <long, MapNpc>();
            _mapMonsterIds    = new ThreadSafeSortedList <int, int>();
            _mapNpcIds        = new ThreadSafeSortedList <int, int>();
            DroppedList       = new ThreadSafeSortedList <long, MapItem>();
            Portals           = new List <Portal>();
            UnlockEvents      = new List <EventContainer>();
            UserShops         = new Dictionary <long, MapShop>();
            RemovedMobNpcList = new List <object>();
            StartLife();
        }