﻿<?xml version="1.0" encoding="utf-8"?>
<EasyQuestProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <QuestsSorted>
    <QuestsSorted Action="RunCode" NameClass="Var.SetVar(&quot;MyVarName_SelectedTask&quot;, Others.Random(1, 2));&#xD;&#xA;Logging.Write(&quot;v = &quot; + Var.GetVar&lt;int&gt;(&quot;MyVarName_SelectedTask&quot;));&#xD;&#xA;&#xD;&#xA;robotManager.Helpful.Var.SetVar(&quot;randomGrindTimer&quot;, System.DateTime.Now);" />
    <QuestsSorted Action="Pulse" NameClass="to25Grind1" />
    <QuestsSorted Action="Pulse" NameClass="to25Grind2" />
    <QuestsSorted Action="RunCode" NameClass="if (ObjectManager.Me.Level &lt; 25)&#xD;&#xA;{&#xD;&#xA;    QuestHelper.LoadOneStepBefore(&quot;to25Grind1&quot;);&#xD;&#xA;}" />
  </QuestsSorted>
  <NpcQuest />
  <Npc />
  <EasyQuests>
    <EasyQuest>
      <Name>23 to 25 Grind 1</Name>
      <QuestId />
      <QuestType>KillAndLoot</QuestType>
      <QuestClass xsi:type="KillAndLootEasyQuestClass">
        <HotSpots>
          <Vector3 X="-3096.558" Y="-2398.481" Z="7.549261" />
          <Vector3 X="-3099.003" Y="-2401.405" Z="8.938045" />
        </HotSpots>
        <EntryTarget>
          <int>1400</int>
        </EntryTarget>
        <IsGrinderNotQuest>true</IsGrinderNotQuest>
        <IsHotspots>true</IsHotspots>
      </QuestClass>
      <ObjectiveCount1>0</ObjectiveCount1>
      <ObjectiveCount2>0</ObjectiveCount2>
      <ObjectiveCount3>0</ObjectiveCount3>
      <ObjectiveCount4>0</ObjectiveCount4>
      <ObjectiveCount5>0</ObjectiveCount5>
      <AutoDetectObjectiveCount1>false</AutoDetectObjectiveCount1>
      <AutoDetectObjectiveCount2>false</AutoDetectObjectiveCount2>
      <AutoDetectObjectiveCount3>false</AutoDetectObjectiveCount3>
      <AutoDetectObjectiveCount4>false</AutoDetectObjectiveCount4>
      <AutoDetectObjectiveCount5>false</AutoDetectObjectiveCount5>
      <CanCondition>return Var.GetVar&lt;int&gt;("MyVarName_SelectedTask") == 1;</CanCondition>
      <IsCompleteCondition>return !CanConditions() || ObjectManager.Me.Level &gt; 25 || robotManager.Helpful.Var.GetVar&lt;System.DateTime&gt;("randomGrindTimer").AddMinutes(RandomTimer.random.Next(15, 80)) &lt; System.DateTime.Now;</IsCompleteCondition>
      <RepeatableQuest>false</RepeatableQuest>
      <NotRequiredInQuestLog>false</NotRequiredInQuestLog>
      <PickUpQuestOnItem>false</PickUpQuestOnItem>
      <PickUpQuestOnItemID>0</PickUpQuestOnItemID>
      <Comment />
      <GossipOptionRewardItem>1</GossipOptionRewardItem>
      <RequiredQuest>0</RequiredQuest>
      <MaxLevel>100</MaxLevel>
      <MinLevel>0</MinLevel>
      <WoWClass>None</WoWClass>
    </EasyQuest>
    <EasyQuest>
      <Name>23 to 25 Grind 2</Name>
      <QuestId />
      <QuestType>KillAndLoot</QuestType>
      <QuestClass xsi:type="KillAndLootEasyQuestClass">
        <HotSpots>
          <Vector3 X="-3005.429" Y="-2651.023" Z="8.003415" />
          <Vector3 X="-2959.886" Y="-2692.726" Z="14.63142" />
        </HotSpots>
        <EntryTarget>
          <int>1417</int>
          <int>1015</int>
        </EntryTarget>
        <IsGrinderNotQuest>true</IsGrinderNotQuest>
        <IsHotspots>true</IsHotspots>
      </QuestClass>
      <ObjectiveCount1>0</ObjectiveCount1>
      <ObjectiveCount2>0</ObjectiveCount2>
      <ObjectiveCount3>0</ObjectiveCount3>
      <ObjectiveCount4>0</ObjectiveCount4>
      <ObjectiveCount5>0</ObjectiveCount5>
      <AutoDetectObjectiveCount1>false</AutoDetectObjectiveCount1>
      <AutoDetectObjectiveCount2>false</AutoDetectObjectiveCount2>
      <AutoDetectObjectiveCount3>false</AutoDetectObjectiveCount3>
      <AutoDetectObjectiveCount4>false</AutoDetectObjectiveCount4>
      <AutoDetectObjectiveCount5>false</AutoDetectObjectiveCount5>
      <CanCondition>return Var.GetVar&lt;int&gt;("MyVarName_SelectedTask") == 2;</CanCondition>
      <IsCompleteCondition>return !CanConditions() || ObjectManager.Me.Level &gt; 25 || robotManager.Helpful.Var.GetVar&lt;System.DateTime&gt;("randomGrindTimer").AddMinutes(RandomTimer.random.Next(15, 80)) &lt; System.DateTime.Now;
</IsCompleteCondition>
      <RepeatableQuest>false</RepeatableQuest>
      <NotRequiredInQuestLog>false</NotRequiredInQuestLog>
      <PickUpQuestOnItem>false</PickUpQuestOnItem>
      <PickUpQuestOnItemID>0</PickUpQuestOnItemID>
      <Comment />
      <GossipOptionRewardItem>1</GossipOptionRewardItem>
      <RequiredQuest>0</RequiredQuest>
      <MaxLevel>100</MaxLevel>
      <MinLevel>0</MinLevel>
      <WoWClass>None</WoWClass>
    </EasyQuest>
  </EasyQuests>
  <Script>public class QuestHelper
{

    public static void AbandonQuest(string name)
    {
        string luaExecute = @"
            for logId=1,GetNumQuestLogEntries() do
                local questTitle, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete = GetQuestLogTitle(logId);
                if ( questTitle == ""{0}"" ) then
                    SelectQuestLogEntry(logId);
                    SetAbandonQuest();
                    AbandonQuest();
                    return;
                end
            end
        ";

        Lua.LuaDoString(string.Format(luaExecute, name));
    }

    public static void LoadStep(string stepName)
    {
        var p = wManager.Wow.Helpers.Quest.QuesterCurrentContext.Profile as Quester.Profile.QuesterProfile;
        if (p != null)
        {
            for (int i = 0; i &lt; p.QuestsSorted.Count; i++)
            {
                if (p.QuestsSorted[i].NameClass == stepName)
                {
                    wManager.Wow.Helpers.Quest.QuesterCurrentContext.CurrentStep = i - 1;
                    break;
                }
            }
        }
    }

   public static void LoadOneStepBefore(string stepName)
    {
        var p = wManager.Wow.Helpers.Quest.QuesterCurrentContext.Profile as Quester.Profile.QuesterProfile;
        if (p != null)
        {
            for (int i = 0; i &lt; p.QuestsSorted.Count; i++)
            {
                if ( p.QuestsSorted[i].NameClass == stepName)
                {
                    wManager.Wow.Helpers.Quest.QuesterCurrentContext.CurrentStep = i - 2;
                    break;
                }
            }
        }
    }
}


public class RandomTimer
{
    public static Random random;

    public RandomTimer()
    {
        random = new Random();
    }
}
</Script>
  <OffMeshConnections />
  <BlacklistNpc />
  <BlacklistNpcType />
  <Blackspots />
</EasyQuestProfile>