private void HandleMapComplementaryInformationsDataMessage(GameFightJoinMessage message, ConnectedHost source) { fight = new RaidFight(message, source, source.Bot.Game.World.Map); IA = new Brain(fight); source.Bot.Game.Player.SendMessage("Fight starting..."); source.Bot.BotState = Engine.Enums.BotStatsEnum.FIGHTING; }
public static Task HandleGameFightJoinMessage(Account account, GameFightJoinMessage message) => Task.Run(() => { account.Game.Map.Update(message); account.Logger.LogInfo(LanguageManager.Translate("101"), LanguageManager.Translate("99")); account.Game.Fight.Update(message); });
public static void GameFightJoinMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { GameFightJoinMessage msg = (GameFightJoinMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { msg.Deserialize(reader); } if (account.Fight != null) { account.Fight.Fighters.Clear(); account.Fight.Options.Clear(); account.Fight.TotalLaunchBySpell.Clear(); account.Fight.LastTurnLaunchBySpell.Clear(); account.Fight.TotalLaunchByCellBySpell.Clear(); account.Fight.DurationByEffect.Clear(); account.Fight.IsFightStarted = msg.isFightStarted; account.Fight.WaitForReady = (!msg.isFightStarted && msg.canSayReady); if (account.IsLockingFight.Checked) { account.Fight.PerformAutoTimeoutFight(1000); account.Fight.LockFight(); } account.Fight.followinggroup = null; } //if (account.Path != null) //{ // account.Path.Stop = true; //} }
public void Update(GameFightJoinMessage message) { Type = (FightTypeEnum)message.FightType; IsFightStarted = message.IsFightStarted; _account.State = AccountStates.FIGHTING; FightJoined?.Invoke(); }
public static void HandleGameFightJoinMessage(Bot bot, GameFightJoinMessage message) { if (bot == null || bot.Character == null) { logger.Error("Character is not properly initialized."); return; // Can't handle the message } bot.Character.EnterFight(message); }
public RaidFight(GameFightJoinMessage msg, ConnectedHost host, MapInformations CurrentMap) { if (!(host.Bot.Game.World.Map.Data == null)) { mHost = host; } Defenders = new List <FighterModel>(); Challengers = new List <FighterModel>(); JoinigInfos = msg; FightType = (FightTypeEnum)msg.fightType; CurrentMap.Updated += ActualizeMap; Challengers.Add(new FighterModel(playedFighter.PlayerBaseInformations.Id, (short)playedFighter.PlayerBaseInformations.CellId, TeamEnum.TEAM_CHALLENGER, this)); }
public void EnterFight(GameFightJoinMessage message) { if (IsFighting()) { throw new Exception("Player already fighting !"); } var fight = new Fight(message, Map); Fighter = new PlayedFighter(this, fight); NotifyFightJoined(Fight); }
private void HandleGameFightJoinMessage(IAccount account, GameFightJoinMessage message) { lock (CheckLock) { Fighters.Clear(); Options.Clear(); TotalLaunchBySpell.Clear(); LastTurnLaunchBySpell.Clear(); TotalLaunchByCellBySpell.Clear(); DurationByEffect.Clear(); IsFightStarted = message.IsFightStarted; WaitForReady = !message.IsFightStarted && message.CanSayReady; } }
public void EnterFight(GameFightJoinMessage message) { if (IsFighting()) { throw new Exception("Player already fighting !"); } var fight = new Fight(message, Map); Fighter = new PlayedFighter(this, fight); Context = Fight; Bot.AddFrame(new FightHandler(Bot)); OnFightJoined(Fight); }
public Fight(GameFightJoinMessage msg, Map map) { Map = map; StartTime = DateTime.Now - TimeSpan.FromMilliseconds(msg.timeMaxBeforeFightStart); CanCancelFight = msg.canBeCancelled; CanSayReady = msg.canSayReady; IsSpectator = msg.isSpectator; Type = (FightTypeEnum)msg.fightType; RedTeam = new FightTeam(this, FightTeamColor.Red); BlueTeam = new FightTeam(this, FightTeamColor.Blue); if (msg.timeMaxBeforeFightStart > 0) { Phase = FightPhase.Placement; } }
public static void GameFightJoinMessageTreatment(Message message, byte[] packetDatas, AccountUC account) { GameFightJoinMessage msg = (GameFightJoinMessage)message; using (BigEndianReader reader = new BigEndianReader(packetDatas)) { msg.Deserialize(reader); } if (account.Fight != null) { account.FightData.Reset(msg.isFightStarted, msg.canSayReady); if (account.IsLockingFight.Checked && account.Fight != null) { account.FightData.PerformAutoTimeoutFight(2000); account.Fight.LockFight(); } } }
public static void HandleGameFightJoinMessage(Bot bot, GameFightJoinMessage message) { bot.Character.EnterFight(message); }
private void HandleGameFightJoinMessage(IAccount account, GameFightJoinMessage message) { Account.Network.SendToServer(new GameFightOptionToggleMessage(2)); }
private void GameFightJoinMessageHandler(DofusClient client, GameFightJoinMessage message) { // }