Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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);
 });
Exemplo n.º 3
0
        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;
            //}
        }
Exemplo n.º 4
0
        public void Update(GameFightJoinMessage message)
        {
            Type           = (FightTypeEnum)message.FightType;
            IsFightStarted = message.IsFightStarted;

            _account.State = AccountStates.FIGHTING;
            FightJoined?.Invoke();
        }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
 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));
 }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 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;
     }
 }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
        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;
            }
        }
Exemplo n.º 11
0
        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();
                }
            }
        }
Exemplo n.º 12
0
 public static void HandleGameFightJoinMessage(Bot bot, GameFightJoinMessage message)
 {
     bot.Character.EnterFight(message);
 }
Exemplo n.º 13
0
 private void HandleGameFightJoinMessage(IAccount account, GameFightJoinMessage message)
 {
     Account.Network.SendToServer(new GameFightOptionToggleMessage(2));
 }
Exemplo n.º 14
0
 private void GameFightJoinMessageHandler(DofusClient client, GameFightJoinMessage message)
 {
     //
 }