public World(ProtoWorld proto) { Setup(); Id = proto.id; Name = proto.name; SBName = proto.sbName; Difficulty = proto.difficulty; Background = proto.background; IsLimbo = proto.isLimbo; Persist = proto.persist; AllowTeleport = !proto.restrictTp; ShowDisplays = proto.showDisplays; Blocking = proto.blocking; Opener = ""; var rnd = new Random(); if (proto.music != null) { Music = proto.music[rnd.Next(0, proto.music.Length)]; } else { Music = "Test"; } }
private void AddWorld(ProtoWorld proto, bool actAsNexus = false) { int id; if (actAsNexus) { id = World.Nexus; } else { id = (proto.id < 0) ? proto.id : Interlocked.Increment(ref _nextWorldId); } World world; DynamicWorld.TryGetWorld(proto, null, out world); if (world != null) { AddWorld(id, world); return; } AddWorld(id, new World(proto)); }
private void AddWorld(ProtoWorld proto, bool actAsNexus = false) { int id; if (actAsNexus) { id = World.Nexus; } else { id = (proto.id < 0) ? proto.id : Interlocked.Increment(ref _nextWorldId); } DynamicWorld.TryGetWorld(proto, null, out var world); if (world != null) { if (world is Marketplace && !Config.serverSettings.enableMarket) { return; } AddWorld(id, world); return; } AddWorld(id, new World(proto)); }
public DeathArena(ProtoWorld proto, Client client = null) : base(proto) { Instance = this; WorldLoot.Add(new ItemLoot("Oryx's Arena Key", 0)); _arenaState = ArenaState.NotStarted; _wave = 1; }
public Vault(ProtoWorld proto, Client client = null) : base(proto) { if (client != null) { _client = client; AccountId = _client.Account.AccountId; vaults = new LinkedList <Container>(); } }
public GuildHall(ProtoWorld proto, Client client = null) : base(proto) { if (client == null) { return; } GuildId = client.Account.GuildId; }
public PetYard(ProtoWorld proto, Client client = null) : base(proto) { if (client == null) { return; } _client = client; _accountId = _client.Account.AccountId; }
public World(ProtoWorld proto) { Setup(); Id = proto.id; Name = proto.name; SBName = proto.sbName; Difficulty = proto.difficulty; Background = proto.background; IsLimbo = proto.isLimbo; Persist = proto.persist; AllowTeleport = !proto.restrictTp; ShowDisplays = proto.showDisplays; Blocking = proto.blocking; }
public static void TryGetWorld(ProtoWorld wData, Client client, out World world) { world = null; foreach (var type in Worlds) { if (!type.Name.Equals(wData.name)) { continue; } world = (World)Activator.CreateInstance(type, wData, client); return; } }
public static void RenderFromProto(World world, IntPoint pos, ProtoWorld proto) { var manager = world.Manager; // get map stream int map = 0; if (proto.maps != null && proto.maps.Length > 1) { var rnd = new Random(); map = rnd.Next(0, proto.maps.Length); } var ms = new MemoryStream(proto.wmap[map]); var sp = new Wmap(manager.Resources.GameData); sp.Load(ms, 0); sp.ProjectOntoWorld(world, pos); }
public Tower(ProtoWorld proto, int id, int maxfloor) : base(proto) { _proto = proto; towerId = id; if (Manager.Database.TowerExist(id) == false) { Manager.Database.CreateTower(id, maxfloor); CurrentFloor = 0; } else { var currenttower = Manager.Database.GetTower(id); CurrentFloor = currenttower.CurrentFloor; } _maxfloor = maxfloor; proto = _proto; }
public Vault(ProtoWorld proto, Client client = null) : base(proto) { if (client != null) { _client = client; AccountId = _client.Account.AccountId; ExtraXML = ExtraXML.Concat(new[] { @" <Objects> <Object type=""0x0504"" id=""Vault Chest""> <Class>Container</Class> <Container/> <CanPutNormalObjects/> <CanPutSoulboundObjects/> <ShowName/> <Texture><File>lofiObj2</File><Index>0x0e</Index></Texture> <SlotTypes>0, 0, 0, 0, 0, 0, 0, 0</SlotTypes> </Object> </Objects>" }).ToArray(); vaults = new LinkedList <Container>(); } }
public DemonTower(ProtoWorld proto) : base(proto, DemonTower, 4) // 5 { }
public Test(ProtoWorld proto, Client client = null) : base(proto) { }
public Candyland(ProtoWorld proto, Client client = null) : base(proto) { }
public Realm(ProtoWorld proto, Client client = null) : base(proto) { _oryxPresent = true; _mapId = 1; }
public Nexus(ProtoWorld proto, Client client = null) : base(proto) { Proto = proto; }
public Nontridus(ProtoWorld proto, Client client = null) : base(proto) { }
public ArenaSolo(ProtoWorld proto, Client client = null) : base(proto) { _arenaState = ArenaState.CountDown; _wave = 1; }
public Davy(ProtoWorld proto, Client client = null) : base(proto) { }
public Castle(ProtoWorld proto, Client client = null, int playersEntering = 100) : base(proto) { PlayersEntering = playersEntering; }
public KeepingUltra(ProtoWorld proto, Client client = null) : base(proto) { }
public Marketplace(ProtoWorld proto, Client client = null) : base(proto) { }
public Arena(ProtoWorld proto, Client client = null) : base(proto) { CurrentState = ArenaState.NotStarted; _wave = 1; Instance = this; }
public Castle(ProtoWorld proto, Client client = null) : base(proto) { // this is to get everyone in one spawn when the Castle comes from quaking PlayersEntering = 0; }
public KrakenLair(ProtoWorld proto, Client client = null) : base(proto) { }