public void AddMember(Character member) { lock(Members) Members.Add(member, 0); member.State.Party = this; if (Members.Count == 2) { Send(string.Concat("PCK", ownerName)); Send(string.Concat("PL", ownerID)); Send(string.Concat("PM", PartyPattern())); } else { member.NClient.Send(string.Concat("PCK", ownerName)); member.NClient.Send(string.Concat("PL", ownerID)); member.NClient.Send(string.Concat("PM", PartyPattern())); foreach (var character in Members.Keys.ToList().Where(x => x != member)) character.NClient.Send(string.Concat("PM", character.PatternOnParty())); } UpdateMembers(); }
public ChallengeFight(Character player1, Character player2, Map map) : base(FightType.CHALLENGE, map) { Fighter attacker = new CharacterFighter(player1, this); Fighter defender = new CharacterFighter(player2, this); FightInit(attacker, defender); }
public CharacterState(Character character) { Character = character; Created = false; Party = null; Followers = new List<Character>(); }
public CharacterParty(Character leader) { Members = new Dictionary<Character, int>(); lock (Members) Members.Add(leader, 1); ownerID = leader.ID; ownerName = leader.Name; }
public void ParseEffect(Character client) { var datas = Args.Split('|'); foreach (var effect in datas) { var infos = effect.Split(';'); Game.Effects.EffectAction.ParseEffect(client, int.Parse(infos[0]), infos[1]); } }
public CharacterFighter(Character player, Fight fight) : base(FighterType.CHARACTER, fight) { player.Fight = fight; player.Fighter = this; myCharacter = player; AP = Stats.GetStat(StatEnum.MaxPA).Total; MP = Stats.GetStat(StatEnum.MaxPM).Total; }
public bool CanJoin(Character Character) { if (myFighters.Count >= 8) return false; if (IsToggle(ToggleType.LOCK)) return false; if (IsToggle(ToggleType.PARTY)) if ((Character.State.Party != null) && Character.State.Party.Members.Keys.Any(x => x.ID == myLeader.ID)) return true; else return false; return true; }
public CharacterChannels(Character client) { Client = client; Channels = new List<Channel>(); AddChannel('*', true); AddChannel('#', true); AddChannel('$', true); AddChannel('p', true); AddChannel('%', true); AddChannel('i', true); AddChannel(':', true); AddChannel('?', true); AddChannel('!', true); AddChannel('^', true); }
public void SpectatorLeave(Character player) { mySpectators.Remove(player); player.State.IsSpectator = false; player.Fight = null; player.NClient.Send(FormatLeave()); }
public void PlayerJoinSpectator(Character player) { if (myState != FightState.PLAYING) return; player.GetMap().DelPlayer(player); player.State.IsSpectator = true; player.Fight = this; mySpectators.Add(player); player.NClient.Send(FormatJoinInformation()); player.NClient.Send(FormatFighterShow(GetFighters())); player.NClient.Send(FormatFightStart()); player.NClient.Send(FormatTurnList()); player.NClient.Send(FormatTurnStart()); Send("Im036;" + player.Name); }
public void PlayerJoin(Character player, int team) { FighterJoin(new CharacterFighter(player, this), team); }
public bool CanJoin(Character player, FightTeam team) { return myState == FightState.STARTING && team.CanJoin(player); }
public CharacterFaction(Character character) { this.character = character; }
public CharacterJobs(Character client) { Client = client; Options = new JobOptions(0, 0, 0); Jobs = new List<Jobs.Job>(); }
public CharacterEnemies(Character _character) { character = _character; }
private void CreateCharacter(string datas) { try { var characterDatas = datas.Split('|'); if (characterDatas[0] != "" | World.Entities.Requests.CharactersRequests.ExistsName(characterDatas[0]) == false) { var character = new Character(); if (World.Entities.Requests.CharactersRequests.CharactersList.Count > 0) character.ID = (World.Entities.Requests.CharactersRequests.CharactersList.OrderByDescending(x => x.ID).ToArray()[0].ID) + 1; else character.ID = 1; character.Name = characterDatas[0]; character.Level = Utilities.Config.GetIntElement("STARTLEVEL"); character.Class = int.Parse(characterDatas[1]); character.Sex = int.Parse(characterDatas[2]); character.Skin = int.Parse(character.Class + "" + character.Sex); character.Size = 100; character.Color = int.Parse(characterDatas[3]); character.Color2 = int.Parse(characterDatas[4]); character.Color3 = int.Parse(characterDatas[5]); switch (character.Class) { case 1: character.MapID = Utilities.Config.GetIntElement("STARTMAP_FECA"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_FECA"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_FECA"); break; case 2: character.MapID = Utilities.Config.GetIntElement("STARTMAP_OSA"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_OSA"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_OSA"); break; case 3: character.MapID = Utilities.Config.GetIntElement("STARTMAP_ENU"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_ENU"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_ENU"); break; case 4: character.MapID = Utilities.Config.GetIntElement("STARTMAP_SRAM"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_SRAM"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_SRAM"); break; case 5: character.MapID = Utilities.Config.GetIntElement("STARTMAP_XEL"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_XEL"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_XEL"); break; case 6: character.MapID = Utilities.Config.GetIntElement("STARTMAP_ECA"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_ECA"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_ECA"); break; case 7: character.MapID = Utilities.Config.GetIntElement("STARTMAP_ENI"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_ENI"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_ENI"); break; case 8: character.MapID = Utilities.Config.GetIntElement("STARTMAP_IOP"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_IOP"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_IOP"); break; case 9: character.MapID = Utilities.Config.GetIntElement("STARTMAP_CRA"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_CRA"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_CRA"); break; case 10: character.MapID = Utilities.Config.GetIntElement("STARTMAP_SADI"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_SADI"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_SADI"); break; case 11: character.MapID = Utilities.Config.GetIntElement("STARTMAP_SACRI"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_SACRI"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_SACRI"); break; case 12: character.MapID = Utilities.Config.GetIntElement("STARTMAP_PANDA"); character.MapCell = Utilities.Config.GetIntElement("STARTCELL_PANDA"); character.Dir = Utilities.Config.GetIntElement("STARTDIR_PANDA"); break; } character.CharactPoint = (character.Level - 1) * 5; character.SpellPoint = (character.Level - 1); character.Exp = Entities.Requests.LevelsRequests.ReturnLevel(character.Level).Character; character.Kamas = (long)Utilities.Config.GetIntElement("STARTKAMAS"); if (character.Class < 1 | character.Class > 12 | character.Sex < 0 | character.Sex > 1) { Client.Send("AAE"); return; } character.SpellsInventary.LearnSpells(); character.IsNewCharacter = true; lock (World.Entities.Requests.CharactersRequests.CharactersList) World.Entities.Requests.CharactersRequests.CharactersList.Add(character); lock(Client.Characters) Client.Characters.Add(character); Network.ServersHandler.AuthLinks.Send(new Network.Auth.Packets.CreatedCharacterPacket().GetPacket(Client.Infos.ID, character.Name)); Client.Send("AAK"); Client.Send("TB"); SendCharacterList(""); } else { Client.Send("AAE"); } } catch (Exception e) { Utilities.Loggers.Errors.Write(e.ToString()); } }
public CharacterFriends(Character character) { this.character = character; }