BattleNet.AlphaBot.VisitMalah C# (CSharp) Метод

VisitMalah() публичный Метод

public VisitMalah ( ) : bool
Результат bool
        public bool VisitMalah()
        {
            NpcEntity malah = GetNpc("Malah");
            if (malah != null && malah != default(NpcEntity))
                TalkToTrader(malah.Id);
            else
            {
                LeaveGame();
                return false;
            }

            if (GetSkillLevel(Skills.Type.book_of_townportal) < 10)
            {
                Thread.Sleep(300);
                SendPacket(0x38, GenericServer.one, BitConverter.GetBytes(malah.Id), GenericServer.nulls);
                Thread.Sleep(2000);
                Item n = (from item in BotGameData.Items
                              where item.Value.action == (uint)Item.Action.add_to_shop
                              && item.Value.type == "tsc"
                              select item).FirstOrDefault().Value;

                Console.WriteLine("{0}: [D2GS] Buying TPs", Account);
                byte[] temp = { 0x02, 0x00, 0x00, 0x00 };
                for (int i = 0; i < 9; i++)
                {
                    SendPacket(0x32, BitConverter.GetBytes(malah.Id), BitConverter.GetBytes(n.id), GenericServer.nulls, temp);
                    Thread.Sleep(200);
                }
                Thread.Sleep(500);
            }
            if (malah != null && malah != default(NpcEntity))
                SendPacket(0x30, GenericServer.one, BitConverter.GetBytes(malah.Id));
            else
            {
                LeaveGame();
                return false;
            }

            Thread.Sleep(300);
            return true;
        }