Exemple #1
0
        private void do_test_quest_seeking_1000()
        {
            if (CurrentQuestSeeking != null)
            {
                if (CurrentQuestSeeking.quest.State == BotClient.QuestData.QuestStatus.DONE)
                {
                    do_clear_current_seeking();
                    return;
                }
                else
                {
                    if (CurrentQuestSeeking.quest.Kind != BotClient.QuestData.QuestType.TRUNK)
                    {
                        var q = runner.do_seek_random_task((quest, info) => { });
                        if (q != null && q.Kind == BotClient.QuestData.QuestType.TRUNK)
                        {
                            do_clear_current_seeking();
                            return;
                        }
                    }
                    if (CurrentQuestSeeking.MoveTo != null)
                    {
                        var obj = bot.CurrentZoneActor;
                        if (MathVector.getDistance(CurrentQuestSeeking.MoveTo.x, CurrentQuestSeeking.MoveTo.y, obj.X, obj.Y) < Config.MinSeekRange)
                        {
                            on_seek_quest_move_done(CurrentQuestSeeking);
                        }
                        else if (bot.CurrentZoneLayer.FindPath(bot.CurrentZoneActor.X, bot.CurrentZoneActor.Y, CurrentQuestSeeking.MoveTo.X, CurrentQuestSeeking.MoveTo.Y) != null)
                        {
                            if (bot.CurrentSceneType == ZeusCommon.EditorData.ZeusConstConfig.SceneType.Dungeon)
                            {
                                bot.CurrentZoneActor.SendUnitGuard(true);
                                runner.do_bs_actor_random_move_region(true, Config.MinSeekRange);
                            }
                            else
                            {
                                var agent = runner.do_start_move_agent(CurrentQuestSeeking.MoveTo.X, CurrentQuestSeeking.MoveTo.Y, Config.MinSeekRange);
                                if (agent.TryStep() == false)
                                {
                                    bot.CurrentZoneActor.SendUnitGuard(true);
                                    runner.do_bs_actor_random_move_region(true, Config.MinSeekRange);
                                }
                            }
                        }
                        else
                        {
                            runner.do_bs_actor_random_move_region(true, Config.MinSeekRange);
                        }
                    }
                    else if (CurrentQuestSeeking.NoWay)
                    {
                        if (bot.CurrentSceneType == ZeusCommon.EditorData.ZeusConstConfig.SceneType.Dungeon)
                        {
                            runner.do_bs_actor_random_move_transport(true, Config.MinSeekRange);

                            var quest = runner.do_seek_random_task(on_seek_action, true);
                            if (quest != null && quest.TemplateID == 1015)
                            {
                                runner.do_gm_finish_task(quest.TemplateID);
                                bot.CurrentRegionManager.CheckTrans(1, true);
                            }
                        }
                        else
                        {
                            runner.do_bs_actor_random_move_transport(false, Config.MinSeekRange);
                        }
                    }
                    else
                    {
                        runner.do_bs_actor_random_move_region(true, Config.MinSeekRange);
                    }
                }
            }
            else
            {
                var q = runner.do_seek_random_task(on_seek_action, true);
                if (q == null)
                {
                    runner.do_bs_actor_random_move_transport(true, Config.MinSeekRange);
                    if (runner.CurrentRandomMoveTarget != null && bot.CurrentZoneLayer.IsLoaded)
                    {
                        SetStatus(runner.CurrentRandomMoveTarget.Name + "@" + bot.CurrentZoneLayer.Data);
                    }
                }
            }
        }