Ejemplo n.º 1
0
 protected Composite Behavior()
 {
     return(new PrioritySelector(
                new Decorator(ret => QuestId != 0 && QuestLogManager.GetQuestById(QuestId).Step > StepId,
                              new Action(r =>
     {
         Poi.Clear("Exiting SmartMove tag");
         _done = true;
     })
                              ),
                new Decorator(ret => Core.Me.Location.Distance(Position) <= Distance,
                              new Action(ret =>
     {
         MovementManager.MoveForwardStop();
         Poi.Clear("Exiting SmartMove tag");
         _done = true;
     }
                                         )
                              ),
                new Decorator(ret => Talk.DialogOpen,
                              new Action(ret => Talk.Next())
                              ),
                new Decorator(ret => !UseMesh,
                              new Action(ret => Navigator.PlayerMover.MoveTowards(Position))
                              ),
                new Decorator(ret => UseMesh,
                              CommonBehaviors.MoveAndStop(ret => Position, Distance, stopInRange: true, destinationName: Name)
                              ),
                new ActionAlwaysSucceed()
                ));
 }
Ejemplo n.º 2
0
        protected override async Task <bool> Main()
        {
            await CommonTasks.HandleLoading();

            QuestLogManager.RegisterDailies(QuestIds);

            _done = true;

            return(false);
        }
Ejemplo n.º 3
0
        protected override async Task Main()
        {
            await CommonTasks.HandleLoading();

            QuestLogManager.RegisterDailies(QuestIds);

            Log("Registration Complete");

            _done = true;
        }
Ejemplo n.º 4
0
 protected Composite Behavior()
 {
     return(new PrioritySelector(
                new Decorator(ret => Condition != null && !ConditionCheck(),
                              new Action(ret => _done = true)),
                new Decorator(ret => QuestId != 0 && StepId != 0 && QuestLogManager.GetQuestById(QuestId).Step > StepId,
                              new Action(r =>
     {
         _done = true;
     })
                              ),
                new Decorator(ret => Core.Player.IsMounted,
                              CommonBehaviors.Dismount()
                              ),
                new Decorator(ret => Talk.DialogOpen,
                              new Action(r =>
     {
         Talk.Next();
     })
                              ),
                new Decorator(ret => casted,
                              new Sequence(
                                  new Sleep(3, 5),
                                  new Action(r => casted = false)
                                  )
                              ),
                new Decorator(ret => Core.Me.Location.Distance(Position) <= Distance && IsFinished,
                              new Action(ret => _done = true)),
                new Decorator(ret => Core.Me.Location.Distance(Position) <= Distance && !casted,
                              new Action(r =>
     {
         Navigator.PlayerMover.MoveStop();
         if (!Core.Player.IsCasting)
         {
             GameObjectManager.GetObjectByNPCId(NPC).Face();
             if (ActionManager.DoAction(SpellID, GameObjectManager.GetObjectByNPCId(NPC)))
             {
                 ActionManager.DoAction(SpellID, GameObjectManager.GetObjectByNPCId(NPC));
                 casted = true;
             }
             else
             {
                 ActionManager.DoActionLocation(SpellID, Core.Player.Location);
                 casted = true;
             }
         }
     })
                              ),
                CommonBehaviors.MoveAndStop(ret => Position, Distance, stopInRange: true, destinationName: Name),
                new ActionAlwaysSucceed()
                ));
 }
Ejemplo n.º 5
0
        public static async Task SetGlamours(string Glamour)
        {
            if (Me.CurrentJob == ClassJobType.Summoner && !QuestLogManager.IsQuestCompleted(67896))
            {
                switch (EikoSettingsModel.selectedGarudaGlamour)
                {
                default:
                    if (EikoSettingsModel.Instance.SelectedGarudaGlamour != GarudaGlamour.None)
                    {
                        EikoSettingsModel.Instance.SelectedGarudaGlamour = GarudaGlamour.None;
                    }
                    break;
                }
                switch (EikoSettingsModel.selectedTitanGlamour)
                {
                default:
                    if (EikoSettingsModel.Instance.SelectedTitanGlamour != TitanGlamour.None)
                    {
                        EikoSettingsModel.Instance.SelectedTitanGlamour = TitanGlamour.None;
                    }
                    break;
                }
                switch (EikoSettingsModel.selectedIfritGlamour)
                {
                default:
                    if (EikoSettingsModel.Instance.SelectedIfritGlamour != IfritGlamour.None)
                    {
                        EikoSettingsModel.Instance.SelectedIfritGlamour = IfritGlamour.None;
                    }
                    break;
                }

                return;
            }

            if (Me.CurrentJob == ClassJobType.Arcanist)
            {
                switch (EikoSettingsModel.selectedGarudaGlamour)
                {
                default:
                    if (EikoSettingsModel.Instance.SelectedGarudaGlamour != GarudaGlamour.EmeraldCarbuncle)
                    {
                        EikoSettingsModel.Instance.SelectedGarudaGlamour = GarudaGlamour.EmeraldCarbuncle;
                    }
                    break;
                }

                switch (EikoSettingsModel.selectedTitanGlamour)
                {
                default:
                    if (EikoSettingsModel.Instance.SelectedTitanGlamour != TitanGlamour.TopazCarbuncle)
                    {
                        EikoSettingsModel.Instance.SelectedTitanGlamour = TitanGlamour.TopazCarbuncle;
                    }
                    break;
                }

                return;
            }

            if (Glamour == "Garuda")
            {
                switch (EikoSettingsModel.selectedGarudaGlamour)
                {
                case GarudaGlamour.None:
                    ChatManager.SendChat("/egiglamour \"Garuda-Egi\"");
                    break;

                case GarudaGlamour.EmeraldCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Garuda-Egi\" \"Emerald Carbuncle\"");
                    break;

                case GarudaGlamour.TopazCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Garuda-Egi\" \"Topaz Carbuncle\"");
                    break;

                case GarudaGlamour.RubyCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Garuda-Egi\" \"Ruby Carbuncle\"");
                    break;

                default:
                    ChatManager.SendChat("/egiglamour \"Garuda-Egi\"");
                    break;
                }
                if (EikoSettingsModel.Instance.SelectedEikoSummon == EikoSummonMode.Garuda)
                {
                    PetManager.DoAction(Spells.Away.Name, Me);
                    Thread.Sleep(500);
                    await Summon();
                }
            }

            if (Glamour == "Titan")
            {
                switch (EikoSettingsModel.selectedTitanGlamour)
                {
                case TitanGlamour.None:
                    ChatManager.SendChat("/egiglamour \"Titan-Egi\"");
                    break;

                case TitanGlamour.EmeraldCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Titan-Egi\" \"Emerald Carbuncle\"");
                    break;

                case TitanGlamour.TopazCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Titan-Egi\" \"Topaz Carbuncle\"");
                    break;

                case TitanGlamour.RubyCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Titan-Egi\" \"Ruby Carbuncle\"");
                    break;

                default:
                    ChatManager.SendChat("/egiglamour \"Titan-Egi\"");
                    break;
                }
                if (EikoSettingsModel.Instance.SelectedEikoSummon == EikoSummonMode.Titan)
                {
                    PetManager.DoAction(Spells.Away.Name, Me);
                    Thread.Sleep(500);
                    await Summon();
                }
            }

            if (Glamour == "Ifrit")
            {
                switch (EikoSettingsModel.selectedIfritGlamour)
                {
                case IfritGlamour.None:
                    ChatManager.SendChat("/egiglamour \"Ifrit-Egi\"");
                    break;

                case IfritGlamour.EmeraldCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Ifrit-Egi\" \"Emerald Carbuncle\"");
                    break;

                case IfritGlamour.TopazCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Ifrit-Egi\" \"Topaz Carbuncle\"");
                    break;

                case IfritGlamour.RubyCarbuncle:
                    ChatManager.SendChat("/egiglamour \"Ifrit-Egi\" \"Ruby Carbuncle\"");
                    break;

                default:
                    ChatManager.SendChat("/egiglamour \"Ifrit-Egi\"");
                    break;
                }
                if (EikoSettingsModel.Instance.SelectedEikoSummon == EikoSummonMode.Ifrit)
                {
                    PetManager.DoAction(Spells.Away.Name, Me);
                    Thread.Sleep(500);
                    await Summon();
                }
            }
        }
Ejemplo n.º 6
0
        protected override Composite CreateBehavior()
        {
            return(new PrioritySelector(
                       new Decorator(ret => !Sent && !string.IsNullOrEmpty(Message) && ATEntry == -1,
                                     new Action(r =>
            {
                ChatManager.SendChat(Message);
                Sent = true;
                if (StepId == 0 && QuestId == 0)
                {
                    _done = true;
                }
            })
                                     ),
                       new Decorator(ret => !Sent && string.IsNullOrEmpty(Message) && ATEntry != -1 && ATSubEntry != -1,
                                     new Action(r =>
            {
                // Set up injection
                IntPtr edit = Core.Memory.Process.MainWindowHandle;
                const uint WM_KEYDOWN = 0x100;
                const uint WM_KEYUP = 0x0101;
                const uint WM_CHAR = 0x0102;

                // Send keys
                PostMessage(edit, WM_KEYDOWN, (IntPtr)(Keys.Enter), IntPtr.Zero);
                PostMessage(edit, WM_KEYUP, (IntPtr)(Keys.Enter), IntPtr.Zero);
                Thread.Sleep(500);
                PostMessage(edit, WM_KEYDOWN, (IntPtr)(Keys.Tab), IntPtr.Zero);
                PostMessage(edit, WM_KEYUP, (IntPtr)(Keys.Tab), IntPtr.Zero);
                Thread.Sleep(500);
                PostMessage(edit, WM_KEYDOWN, (IntPtr)(GetKey(ATEntry)), IntPtr.Zero);
                PostMessage(edit, WM_KEYUP, (IntPtr)(GetKey(ATEntry)), IntPtr.Zero);
                Thread.Sleep(500);
                // If it's not on the first page, navigate to the correct page
                if (Page > 1)
                {
                    int i = 1;
                    while (i < Page)
                    {
                        PostMessage(edit, WM_KEYDOWN, (IntPtr)(Keys.Right), IntPtr.Zero);
                        PostMessage(edit, WM_KEYUP, (IntPtr)(Keys.Right), IntPtr.Zero);
                        Thread.Sleep(500);
                        i++;
                    }
                }
                PostMessage(edit, WM_KEYDOWN, (IntPtr)(GetKey(ATSubEntry)), IntPtr.Zero);
                PostMessage(edit, WM_KEYUP, (IntPtr)(GetKey(ATSubEntry)), IntPtr.Zero);
                Thread.Sleep(500);
                PostMessage(edit, WM_KEYDOWN, (IntPtr)(Keys.Enter), IntPtr.Zero);
                PostMessage(edit, WM_KEYUP, (IntPtr)(Keys.Enter), IntPtr.Zero);
                Thread.Sleep(500);

                // Clean up
                Sent = true;
                if (StepId == 0 && QuestId == 0)
                {
                    _done = true;
                }
            })
                                     ),
                       new Decorator(ret => QuestLogManager.GetQuestById(QuestId).Step == StepId,
                                     new ActionAlwaysSucceed()
                                     ),
                       new Decorator(ret => QuestLogManager.GetQuestById(QuestId).Step > StepId,
                                     new Action(r =>
            {
                _done = true;
            })
                                     )
                       ));
        }
Ejemplo n.º 7
0
    // this method is called when the attack kills the target
    IEnumerator AttackAndKill()
    {
        GameObject mainCamera = GameObject.Find("Main Camera");

        AudioSource[] audios = mainCamera.GetComponents <AudioSource>();
        GameObject    enemy;

        A1_Button.SetActive(false);
        A2_Button.SetActive(false);
        A3_Button.SetActive(false);
        Attack_Button.SetActive(false);
        playerAttack = true;
        player.GetComponent <Animation>().Play("Attack");
        yield return(new WaitForSeconds(.5f));

        playerAttack = false;
        if (EnemyType == 1)
        {
            enemy = GameObject.Find("Cha_Slime battle (Clone)");
            enemy.GetComponent <Animation>().Play("Dead");
        }
        else if (EnemyType == 3)
        {
            enemy = GameObject.Find("Mean Looking Troll(Clone)");
            audios[4].Play();
            trollCount--;
            enemyHealthBar.GetComponent <HealthBarManager>().InitHealthBar(enemyRef, 0);
            yield return(new WaitForSeconds(.5f));

            if (trollCount == 2)
            {
                enemyHealth = Random.Range(7, 11);
            }
            if (trollCount == 1)
            {
                enemyHealth = 14;
            }
            enemyHealthBar.GetComponent <HealthBarManager>().InitHealthBar(enemyRef, enemyHealth);
            if (trollCount != 0)
            {
                enemy.transform.localScale += new Vector3(.2f, .2f, .2f);
                assignButtons();
                A1_Button.SetActive(true);
                A2_Button.SetActive(true);
                A3_Button.SetActive(true);
                Attack_Button.SetActive(true);
            }
        }
        else if (EnemyType == 4)
        {
            enemy = GameObject.Find("KittenBattle(Clone)");
            // play meow sound
            trollCount--;
            enemyHealthBar.GetComponent <HealthBarManager>().InitHealthBar(enemyRef, 0);
            yield return(new WaitForSeconds(.5f));

            if (trollCount == 2)
            {
                enemyHealth = 3;
            }
            else if (trollCount == 1)
            {
                enemyHealth = 4;
            }
            enemyHealthBar.GetComponent <HealthBarManager>().InitHealthBar(enemyRef, enemyHealth);
            if (trollCount != 0)
            {
                assignButtons();
                A1_Button.SetActive(true);
                A2_Button.SetActive(true);
                A3_Button.SetActive(true);
                Attack_Button.SetActive(true);
            }
        }
        tutorial.SetActive(true);
        audios[1].Play();
        if ((EnemyType != 3 && EnemyType != 4) || trollCount == 0)
        {
            audios[2].volume = 0;
            audios[6].volume = 0;
            audios[3].Play();
            enemyHealthBar.GetComponent <HealthBarManager>().InitHealthBar(enemyRef, 0);
            yield return(new WaitForSeconds(2));

            if (EnemyType == 1)
            {
                enemy = GameObject.Find("Cha_Slime battle (Clone)");
                Destroy(enemy);
            }
            else if (EnemyType == 2)
            {
                enemy = GameObject.Find("Battle jack(Clone)");
                Destroy(enemy);
            }
            else if (EnemyType == 3)
            {
                enemy = GameObject.Find("Mean Looking Troll(Clone)");
                Destroy(enemy);
                audios[5].Play();
            }
            else if (EnemyType == 4)
            {
                enemy = GameObject.Find("KittenBattle(Clone)");
                Destroy(enemy);
                QuestDelegate.startQuestForZone(1);
            }

            yield return(new WaitForSeconds(2));

            int[] playerActions = new int[actions.Count];
            for (int i = 0; i < actions.Count; i++)
            {
                playerActions[i] = actions[i];
            }

            if (playerHealth == 3)
            {
                postBattle.GetComponent <PostBattleMenu>().InitPostBattleMenuWith(3, playerActions);
                QuestLogManager.masteryQuestStatusUpdated(1);
            }
            else if (playerHealth == 2)
            {
                postBattle.GetComponent <PostBattleMenu>().InitPostBattleMenuWith(2, playerActions);
            }
            else if (playerHealth == 1)
            {
                postBattle.GetComponent <PostBattleMenu>().InitPostBattleMenuWith(1, playerActions);
            }
        }
    }