Beispiel #1
0
        public static void LifePointsRegenBeginMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            LifePointsRegenBeginMessage msg = (LifePointsRegenBeginMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            if (account.Fight != null && account.state == Enums.Status.Fighting)
            {
                account.Fight.watch.Stop();
                account.Fight.WaitForReady   = false;
                account.Fight.IsFighterTurn  = false;
                account.Fight.IsFightStarted = false;
                account.Log(new ActionTextInformation("Combat fini ! (" + account.Fight.watch.Elapsed.Minutes + " min, " + account.Fight.watch.Elapsed.Seconds + " sec)"), 0);
                account.Fight.watch.Reset();
                account.Fight.PerformAutoTimeoutFight(2000);
                if (account.WithItemSetBox.Checked == true)
                {
                    sbyte id = (sbyte)account.PresetEndUpD.Value;
                    InventoryPresetUseMessage msg2 = new InventoryPresetUseMessage((sbyte)(id - 1));
                    account.SocketManager.Send(msg2);
                    account.Log(new ActionTextInformation("Equipement rapide numero " + Convert.ToString(id)), 5);
                }
                account.Fight.PulseRegen();
            }
            account.SetStatus(Status.None);

            //account.Path.Stop = false;
        }
Beispiel #2
0
        public static void GameFightPlacementPossiblePositionsMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            GameFightPlacementPossiblePositionsMessage msg = (GameFightPlacementPossiblePositionsMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            account.SetStatus(Status.Fighting);
            account.FightData.UpdateTurn(0);
            if (account.Fight != null)
            {
                account.Fight.PlaceCharacter(msg.positionsForChallengers.ToList());
            }
            if (account.WithItemSetBox.Checked == true)
            {
                sbyte id = (sbyte)account.PresetStartUpD.Value;
                InventoryPresetUseMessage msg2 = new InventoryPresetUseMessage((sbyte)(id - 1));
                account.SocketManager.Send(msg2);
                account.Log(new ActionTextInformation("Equipement rapide numero " + Convert.ToString(id)), 5);
            }
            GameFightReadyMessage nmsg = new GameFightReadyMessage(true);

            account.SocketManager.Send(nmsg);
            account.Log(new BotTextInformation("Send Ready !"), 5);
        }
Beispiel #3
0
        public static void GameFightPlacementPossiblePositionsMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            GameFightPlacementPossiblePositionsMessage msg = (GameFightPlacementPossiblePositionsMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            account.SetStatus(Status.Fighting);
            if (account.Fight != null)
            {
                account.Fight.PlacementCells = msg.positionsForChallengers.ToList();
                account.Fight.TurnId         = 0;
                if (account.Fight.m_Conf.Tactic != BlueSheep.Core.Fight.TacticEnum.Immobile)
                {
                    account.Fight.PlaceCharacter();
                }
            }
            //account.Fight.PerformAutoTimeoutFight(3000);
            //if (account.IsMITM)
            // account.Fight.PerformAutoTimeoutFight(3000);
            if (account.WithItemSetBox.Checked == true)
            {
                sbyte id = (sbyte)account.PresetStartUpD.Value;
                InventoryPresetUseMessage msg2 = new InventoryPresetUseMessage((sbyte)(id - 1));
                account.SocketManager.Send(msg2);
                account.Log(new ActionTextInformation("Equipement rapide numero " + Convert.ToString(id)), 5);
                account.Fight.PerformAutoTimeoutFight(500);
            }
            //LaunchWatch()
            GameFightReadyMessage nmsg = new GameFightReadyMessage(true);

            account.SocketManager.Send(nmsg);
            account.Log(new BotTextInformation("Send Ready !"), 5);
        }
Beispiel #4
0
 /// <summary>
 /// Set the fight as stopped.
 /// </summary>
 public void FightStop()
 {
     watch.Stop();
     WaitForReady   = false;
     IsFighterTurn  = false;
     IsFightStarted = false;
     IsDead         = false;
     m_Account.Log(new ActionTextInformation("Combat fini ! (" + watch.Elapsed.Minutes + " min, " + watch.Elapsed.Seconds + " sec)"), 0);
     watch.Reset();
     m_Account.SetStatus(Status.Busy);
     Reset();
     PerformAutoTimeoutFight(2000);
     if (m_Account.WithItemSetBox.Checked == true)
     {
         sbyte id = (sbyte)m_Account.PresetEndUpD.Value;
         InventoryPresetUseMessage msg2 = new InventoryPresetUseMessage((byte)(id - 1));
         m_Account.SocketManager.Send(msg2);
         m_Account.Log(new ActionTextInformation("Equipement rapide numero " + Convert.ToString(id)), 5);
     }
     PulseRegen();
 }
Beispiel #5
0
 public static void HandleInventoryPresetUse(WorldClient client, InventoryPresetUseMessage message)
 {
     client.Character.Inventory.EquipPreset(message.presetId);
 }