public ArenaPlayer(Player player, Arena arena) { lock (arena.SyncRoot) { WorldPlayer = player; OwnerArena = arena; lock (OwnerArena.ArenaPlayers.SyncRoot) { OwnerArena.ArenaPlayers.ForEach(delegate(ArenaPlayer arenaPlayer) { if (arenaPlayer.WorldPlayer == player) { OwnerArena.PlayerLeft(arenaPlayer); } }); } if ((ArenaPlayerId = OwnerArena.ArenaPlayers.GetAvailablePlayerId()) == 0) { return; } WorldPlayer.PingInitialized = false; WorldPlayer.TableId = 0; WorldPlayer.ActiveArena = arena; WorldPlayer.LastArenaId = arena.ArenaId; ActiveTeam = OwnerArena.Ruleset.Rules.HasFlag(ArenaRuleset.ArenaRule.NoTeams) ? Team.Neutral : WorldPlayer.ActiveTeam; ActiveCharacter = player.ActiveCharacter; _previousLocation = new Vector3(0, 0, 0); _previousLocationTick = 0; Location = new Vector3(0, 0, 0); Direction = 0; CurrentGridBlock = null; CurrentGridBlockFlagData = new GridBlockFlagData(); InCombatTime = new Interval(7000, false); NonFriendlyWallTime = new Interval(1000, false); FriendlyWallTime = new Interval(1000, false); ValhallaProtection = new Interval(2000, false); ActiveTime = new Interval(0, false); BoundingBox = new OrientedBoundingBox(Location, PlayerStandingSize, 0.0f); StatusFlags = StatusFlag.None; SpecialFlags = SpecialFlag.None; Effects = new Effect[21]; MoveSpeed = 0; StateReceivedCount = 0; LastStateReceived = NativeMethods.PerformanceCount; LastAttacker = null; JoinTime = DateTime.Now; HasFliedSinceHackDetect = false; MaxHp = player.ActiveCharacter.MaxHealth; if (ActiveShrine == null) { if (ActiveTeam == Team.Neutral) { CurrentHp = MaxHp; } else { return; } } else { if (ActiveShrine.IsDisabled) { Network.Send(WorldPlayer, GamePacket.Outgoing.Player.SendPlayerId(this)); Thread.Sleep(500); Network.Send(WorldPlayer, GamePacket.Outgoing.Arena.SuccessfulArenaEntry()); Thread.Sleep(100); OwnerArena.ArenaKickPlayer(this); return; } CurrentHp = ActiveShrine.IsDead ? (Int16)0 : MaxHp; } Network.Send(WorldPlayer, GamePacket.Outgoing.Player.SendPlayerId(this)); if (!WorldPlayer.Flags.HasFlag(PlayerFlag.Hidden)) { Network.SendTo(WorldPlayer, GamePacket.Outgoing.World.PlayerLeave(WorldPlayer), Network.SendToType.Tavern, false); Network.SendTo(WorldPlayer, GamePacket.Outgoing.World.PlayerJoin(WorldPlayer), Network.SendToType.Tavern, false); Network.SendToArena(this, GamePacket.Outgoing.Arena.PlayerJoin(this), false); } if (OwnerArena.ArenaPlayerHistory.FindByCharacterId(WorldPlayer.ActiveCharacter.CharacterId) == null) { OwnerArena.ArenaPlayerHistory.Add(this); } WorldPlayer.ActiveArenaPlayer = this; OwnerArena.ArenaPlayers.Add(this); OwnerArena.AveragePlayerLevel = OwnerArena.ArenaPlayers.GetAveragePlayerLevel(); } lock (OwnerArena.SyncRoot) { Network.Send(WorldPlayer, GamePacket.Outgoing.Arena.UpdateShrinePoolState(arena)); } Thread.Sleep(500); Network.Send(WorldPlayer, GamePacket.Outgoing.Arena.SuccessfulArenaEntry()); Thread.Sleep(100); lock (OwnerArena.SyncRoot) { for (Int32 i = 0; i < OwnerArena.Signs.Count; i++) { Network.Send(WorldPlayer, GamePacket.Outgoing.Arena.CastSign(this, OwnerArena.Signs[i].RawData)); } } Thread.Sleep(100); lock (OwnerArena.SyncRoot) { for (Int32 i = 0; i < OwnerArena.Walls.Count; i++) { Network.Send(WorldPlayer, GamePacket.Outgoing.Arena.CastWall(arena.Walls[i].RawData)); } } Thread.Sleep(100); lock (OwnerArena.SyncRoot) { for (Int32 i = 0; i < arena.Grid.Triggers.Count; i++) { Network.Send(WorldPlayer, GamePacket.Outgoing.Arena.ActivatedTrigger(OwnerArena.Grid.Triggers[i])); } } if (OwnerArena.Ruleset.Mode == ArenaRuleset.ArenaMode.Custom) { Network.Send(WorldPlayer, GamePacket.Outgoing.System.DirectTextMessage(WorldPlayer, String.Format("This arena has the following rules: {0}.", arena.Ruleset.Rules))); } if (OwnerArena.Ruleset.Rules.HasFlag(ArenaRuleset.ArenaRule.ExpEvent)) { Network.Send(WorldPlayer, GamePacket.Outgoing.System.DirectTextMessage(WorldPlayer, String.Format("If your team wins this match, you will earn {0:0,0} experience.", (WorldPlayer.Flags.HasFlag(PlayerFlag.MagestormPlus) ? OwnerArena.EventExp * 2f : OwnerArena.EventExp)))); } Network.Send(WorldPlayer, GamePacket.Outgoing.System.DirectTextMessage(WorldPlayer, String.Format("This arena currently has an EXP bonus of {0}%.", ((arena.Grid.ExpBonus + (Properties.Settings.Default.ExpMultiplier - 1.0f) + (WorldPlayer.Flags.HasFlag(PlayerFlag.MagestormPlus) ? 0.2f : 0.0f)) * 100)))); }