int BattleMapPolicy()
        {
            if (CurMapID == CurMissionMap.MapID)
            {
                if (CurMapID != LoadBattleMapID)
                {
                    Program.client.Update();
                    Thread.Sleep(1000);
                    UpdateMap(bGroupExploreModel);

                    LoadBattleMapID = CurMapID;
                    FilterMonsterList.Clear();
                    PassedDoor.Clear();
                    areaCrossList.Clear();
                    AddedCrossPoint.Clear();
                    ClickedBoxList.Clear();
                    LootFilter.Clear();
                    curGroup = -1;

                    Program.client.ClearTrophyFilter();

                    //    bGroupExploreModel = false;//判断
                    bNeedCross = false; //判断探索还是穿越
                    bCrossing  = false; //判断穿越中还是移动到穿越点
                    bNeedCastBattleOnceSkill = true;
                }
            }
            if (CurMapID == pollutantMapID)
            {
                if (CurMapID != LoadPollutantMapID)
                {
                    Program.client.Update();
                    Thread.Sleep(1000);
                    UpdatePollutantMap();

                    LoadPollutantMapID = CurMapID;
                    FilterMonsterList.Clear();
                    ClickedBoxList.Clear();
                    LootFilter.Clear();
                    Program.client.ClearTrophyFilter();
                }
            }
            return(1);
        }
예제 #2
0
        bool  Init()
        {
            Pos pos = Program.client.GetPlayerPos();

            TargetPoint.x = (ushort)(pos.X * 0.092);
            TargetPoint.y = (ushort)(pos.Y * 0.092);
            //   GetExplorePoint(ref TargetPoint.x, ref TargetPoint.y);
            ClickedBoxList.Clear();

            //设置初始状态,拿到任务地图列表,当前任务地图
            string strKey = Program.config.MissionMapList[Program.runtime.curMissionMapIndex];

            if (Program.gdata.AllBattleMap.TryGetValue(strKey, out CurMissionMap) == false)
            {
                System.Windows.Forms.MessageBox.Show("Test");
                return(false);
            }
            if (CurMissionMap.MapID == 9837 || CurMissionMap.MapID == 63025 || CurMissionMap.MapID == 21866)
            {
                bGroupExploreModel = true;
            }
            else
            {
                bGroupExploreModel = false;
            }
            //Program.runtime.curMissionMapIndex;

            bNeedCastBattleOnceSkill = true;

            Selling = false;
            Saveing = false;
            //   bNeedSave = true;
            //   bSaledComplete = false;
            //设置起始状态
            curStatus = Status.Mission;
            Program.client.ClearTrophyFilter();
            return(true);
        }
예제 #3
0
        /// ///////////////////////////////////////////////
        ///
        bool ChangeToNextMissionMap()
        {
            FilterMonsterList.Clear();
            PassedDoor.Clear();
            areaCrossList.Clear();
            AddedCrossPoint.Clear();
            ClickedBoxList.Clear();
            LootFilter.Clear();
            Program.client.ClearTrophyFilter();

            bGroupExploreModel = false; //判断
            bNeedCross         = false; //判断探索还是穿越
            bCrossing          = false; //判断穿越中还是移动到穿越点


            Program.runtime.curMissionMapIndex++;
            if (Program.config.MissionMapList.Count == Program.runtime.curMissionMapIndex)
            {
                Program.runtime.curMissionMapIndex = 0;
            }
            string strKey = Program.config.MissionMapList[Program.runtime.curMissionMapIndex];

            if (Program.gdata.AllBattleMap.TryGetValue(strKey, out CurMissionMap) == false)
            {
                CurMissionMap = null;
                System.Windows.Forms.MessageBox.Show("Test");
                return(false);
            }
            if (CurMissionMap.MapID == 9837 || CurMissionMap.MapID == 63025 || CurMissionMap.MapID == 21866)
            {
                bGroupExploreModel = true;
            }
            else
            {
                bGroupExploreModel = false;
            }
            return(true);
        }
예제 #4
0
        bool HandInit()
        {
            Pos pos = Program.client.GetPlayerPos();

            TargetPoint.x = (ushort)(pos.X * 0.092);
            TargetPoint.y = (ushort)(pos.Y * 0.092);
            //   GetExplorePoint(ref TargetPoint.x, ref TargetPoint.y);
            ClickedBoxList.Clear();

            //设置初始状态,拿到任务地图列表,当前任务地图

            bGroupExploreModel = false;
            //Program.runtime.curMissionMapIndex;

            bNeedCastBattleOnceSkill = true;

            //   bNeedSave = true;
            //   bSaledComplete = false;
            //设置起始状态
            curStatus = Status.Mission;
            Program.client.ClearTrophyFilter();
            return(true);
        }
예제 #5
0
        int HandMissionAnalysis()
        {
            //如果不在任务地点,去任务地点

            //如果在城里,如果需要去传送门,则去传送门,否则去传送点
            if (InTown())
            {
                MessageBox.Show("輔助模式,請在目標探索地圖開啟輔助程式");
                return(0);
            }



            if (CurMapID != LoadBattleMapID)
            {
                Program.client.Update();
                Thread.Sleep(1000);
                UpdateMap(bGroupExploreModel);


                LoadBattleMapID = CurMapID;
                FilterMonsterList.Clear();
                PassedDoor.Clear();
                areaCrossList.Clear();
                AddedCrossPoint.Clear();
                ClickedBoxList.Clear();
                LootFilter.Clear();
                curGroup = -1;

                Program.client.ClearTrophyFilter();

                //    bGroupExploreModel = false;//判断
                bNeedCross = false; //判断探索还是穿越
                bCrossing  = false; //判断穿越中还是移动到穿越点
                bNeedCastBattleOnceSkill = true;
                //    Thread.Sleep(1000);
            }
            int curTickCount = System.Environment.TickCount;

            //贫血小退
            if (Program.config.LogoutType == 0)
            {
                int data = player.HP;
                if (data < Program.config.LogOutData)
                {
                    ReturnRolePolicy();
                    if ((curTickCount - lastReturnTime) < 1000 * 60)
                    {
                        LogoutCount++;
                    }
                    else
                    {
                        LogoutCount = 0;
                    }
                    lastReturnTime = curTickCount;
                    if (LogoutCount > 5)
                    {
                        LogoutCount = 0;
                        curStatus   = Status.GotoBack;
                        SetNeedGoBack();
                        bNeedResetBattleMapInfo = true;
                        ChangeToNextMissionMap();
                        //bNeedResetBattleMapID = true;
                        //pollutantMapID = 0;//污染地穴地图ID
                        //LoadPollutantMapID = 0;
                        //pollutantGatePos = null;//门位置
                        //pollutantComplete = false;//已经刷完
                        //bEnterPollutanting = false;//正在进入污染地穴
                    }
                    Thread.Sleep(1000);
                    return(0);
                }
            }
            else if (Program.config.LogoutType == 1)
            {
                int data = player.Shield;
                if (data < Program.config.LogOutData)
                {
                    ReturnRolePolicy();
                    if ((curTickCount - lastReturnTime) < 1000 * 60)
                    {
                        LogoutCount++;
                    }
                    else
                    {
                        LogoutCount = 0;
                    }
                    lastReturnTime = curTickCount;
                    if (LogoutCount > 5)
                    {
                        LogoutCount = 0;
                        curStatus   = Status.GotoBack;
                        SetNeedGoBack();
                        bNeedResetBattleMapInfo = true;
                        ChangeToNextMissionMap();
                        //bNeedResetBattleMapID = true;
                        //ChangeToNextMissionMap();

                        //pollutantMapID = 0;//污染地穴地图ID
                        //LoadPollutantMapID = 0;
                        //pollutantGatePos = null;//门位置
                        //pollutantComplete = false;//已经刷完
                        //bEnterPollutanting = false;//正在进入污染地穴
                    }
                    Thread.Sleep(1000);
                    return(0);
                }
            }
            //如果需要施放光环
            if ((curTickCount - LastCheckHaloTime) > (5 * 1000))
            {
                if (Program.config.bAutoUpSkill)
                {
                    Program.client.UpSkill();
                }
                if (Program.config.haloSkill.Count > 0)
                {
                    foreach (var item in Program.config.haloSkill)
                    {
                        if (Program.client.IsBuffExists(item) == false)
                        {
                            Program.client.CastUntargetSkill((short)player.Pos.x, (short)player.Pos.y, (short)item, 8);
                            Thread.Sleep(1000);
                        }
                    }
                }
                LastCheckHaloTime = curTickCount;
            }
            if (bNeedCastBattleOnceSkill)
            {
                if (Program.config.battleOnceSkill.Count > 0)
                {
                    foreach (var item in Program.config.battleOnceSkill)
                    {
                        Program.client.CastUntargetSkill((short)player.Pos.x, (short)player.Pos.y, (short)item, 8);
                        Thread.Sleep(1000);
                    }
                }
                bNeedCastBattleOnceSkill = false;
            }
            //区域传送点
            if (bGroupExploreModel)
            {
                //
                if (curGroup != -1)
                {
                    foreach (var item in areaCrossList)
                    {
                        //如果没被处理过
                        if (AddedCrossPoint.Contains(item.Pos))
                        {
                            continue;
                        }
                        CrossPoint crossPoint = new CrossPoint();
                        crossPoint.firstGroup = GetCurGroup(player.Pos.x, player.Pos.y);
                        crossPoint.firstPos.x = item.Pos.x;
                        crossPoint.firstPos.y = item.Pos.y;
                        allCrossPoint.Add(crossPoint);
                        AddedCrossPoint.Add(item.Pos);
                        SetPassAbleArea(item.Pos.x, item.Pos.y);
                    }
                }
            }


            ////////////////////////////////药剂

            ActDrinkFlask(curTickCount);

            ////////////////////////////////////
            // //如果有门在身边,则点
            SDoor Door = SearchDoor();

            if (Door != null)
            {
                //  Program.client.ActiveTarget(DoorObjPtr);
                ActOpenDoor(Door);
                return(0);
            }

            /////////////////////////////////////
            int nMonsterCount = 0;
            List <SMonsterInfo> NearbyMonster = null;
            SMonsterInfo        targetMonster = SearchMonsterAndLootNew(out nMonsterCount, out NearbyMonster);

            if (targetMonster != null)
            {
                KillMonsterNew(targetMonster, nMonsterCount, NearbyMonster, curTickCount);
                return(0);
            }
            TrophyInfo trophy = SearchLoot();

            if (trophy != null)
            {
                ActHandLootTrophy(trophy);
                return(0);
            }



            SBox Box = null;

            if (TargetBox.ID != 0)
            {
                Box = TargetBox;
            }
            else
            {
                Box = SearchBox();
                if (Box != null)
                {
                    TargetBox.ID     = Box.ID;
                    TargetBox.ObjPtr = Box.ObjPtr;
                    TargetBox.Pos.x  = Box.Pos.x;
                    TargetBox.Pos.y  = Box.Pos.y;
                }
            }
            //如果有宝箱
            if (Box != null)
            {
                //检测阻塞
                if (player.Pos == lastPlayerPos && Box.Pos == lastTargetPoint)
                {
                    blockCount++;
                    nSleepTime = 50;
                }
                else
                {
                    blockCount = 0;
                }
                lastPlayerPos.x   = player.Pos.x;
                lastPlayerPos.y   = player.Pos.y;
                lastTargetPoint.x = Box.Pos.x;
                lastTargetPoint.y = Box.Pos.y;
                if (blockCount > 3)
                {
                    ClickedBoxList.Add(Box.ID);
                    TargetBox.ID = 0;
                    nSleepTime   = 50;
                    return(0);
                }
                //获取A*距离,过大的走过去
                double dis = CalcDis(Box.Pos, player.Pos);
                if (dis > 15)
                {
                    ActSafeMove(Box.Pos);
                }
                else
                {
                    if (Box.Color > 0)
                    {
                        //釋放圖騰
                        CastTTSkillNow(curTickCount);

                        //釋放陷阱
                        CastTrapSkillNow(curTickCount, player.Pos);

                        //施放护盾技能
                        CastShieldSkillNow(curTickCount);
                    }
                    // 否则点击
                    Program.client.ActiveTarget(Box.ObjPtr);
                    //   ClickedBoxList.Add(Box.ID);
                    TargetBox.ID = 0;
                }

                nSleepTime = 50;
                return(0);
            }

            ////卡位检测

            //////////////////////////////////////////打怪探索
            ActDrinkSpeedFlask(curTickCount);

            //if (bGroupExploreModel)
            //{
            //    return GroupExplore();
            //}
            return(ActHandNormalExplore());
        }