public override bool Do() { if (em == null) { return(true); // WTF! } // mount if we're really far away if (monster.DistanceToSelf >= mountRange) { if (PPather.PatherSettings.UseMount != "Never Mount") { if (PPather.PatherSettings.UseMount == "Always Mount" || (PPather.PatherSettings.UseMount == "Let Task Decide" && UseMount == true)) { Helpers.Mount.MountUp(); } } } if (GContext.Main.Me.Target != monster && tabSpam.IsReady && monster.DistanceToSelf < 50f && monster.Reaction != GReaction.Friendly) { GContext.Main.SendKey("Common.Target"); tabSpam.Reset(); } if (GetLocation().GetDistanceTo(to) > GContext.Main.MeleeDistance && monster.DistanceToSelf < 30f || updateTimer.IsReady) { // need a new path, monster moved to = GetLocation(); em = new EasyMover(ppather, to, false, true); updateTimer.Reset(); } MoveResult = em.move(howClose); if (MoveResult != EasyMover.MoveResult.Moving) { return(true); // done, can't do more } Location meLocation = new Location(GContext.Main.Me.Location); if (meLocation.GetDistanceTo(to) < howClose) { PPather.mover.Stop(); Helpers.Mount.Dismount(); monster.Face(PPather.PI / 8); return(true); } return(false); }
public override bool Do() { if (em == null) { return(true); // WTF! } Location meLocation = new Location(GContext.Main.Me.Location); float distanceToDestination = meLocation.GetDistanceTo(to); float mountRange = PPather.PatherSettings.MountRange; // mount if it's far enough away if (distanceToDestination >= mountRange) { if (PPather.PatherSettings.UseMount != "Never Mount") { if (PPather.PatherSettings.UseMount == "Always Mount" || (PPather.PatherSettings.UseMount == "Let Task Decide" && UseMount == true)) { Helpers.Mount.MountUp(); } } } MoveResult = em.move(howClose); if (MoveResult != EasyMover.MoveResult.Moving) { return(true); // done, can't do more } if (distanceToDestination < howClose && Math.Abs(meLocation.Z - to.Z) < howClose) { // we're here so dismount, if we weren't mounted it doesn't matter //Helpers.Mount.Dismount(); PPather.mover.Stop(); return(true); } return(false); }
public override bool Do() { Helpers.Mount.Dismount(); if (!ppather.IsQuestGoalDone(QuestID)) { return(true); // Quest isn't ready to handin } Functions.Interact(pathObject); while (GPlayerSelf.Me.IsCasting) { Thread.Sleep(100); } Thread.Sleep(1000); if (GossipFrame.IsVisible()) { if (!GossipFrame.ClickOptionText(QuestName)) { return(false); } Thread.Sleep(2000); // Lag } if (QuestFrame.IsVisible() && QuestFrame.IsSelect()) { if (!QuestFrame.ClickOptionText(QuestName)) { return(false); } Thread.Sleep(2000); // Lag } if (QuestFrame.IsVisible() && QuestFrame.IsContinue()) { QuestFrame.Continue(); Thread.Sleep(2000); } if (QuestFrame.IsVisible() && QuestFrame.IsComplete()) { PPather.WriteLine("HandinQuest: Great! A quest complete frame"); string quest = QuestFrame.GetCompleteTitle(); if (quest.ToLower().Contains(QuestName.ToLower())) { PPather.WriteLine("HandinQuest: Complete quest name match for " + quest); QuestFrame.SelectReward(Reward); Thread.Sleep(300); QuestFrame.Complete(); ppather.QuestCompleted(QuestID, Repeatable); Thread.Sleep(3000); return(true); } else { PPather.WriteLine("HandinQuest: Not the right quest"); GContext.Main.SendKey("Common.Escape"); Thread.Sleep(1000); ppather.QuestFailed(QuestID); return(true); // cry } } // If we're here...that means we failed to pick up the quest. // Maybe we could try a different angle if it's not an item if (!pathObject.isItem()) { Location newLoc = new Location((pathObject.getLocation().X + (GContext.Main.Me.Location.X - pathObject.getLocation().X) * 2), pathObject.getLocation().Y + ((GContext.Main.Me.Location.Y - pathObject.getLocation().Y) * 2), pathObject.getLocation().Z + ((GContext.Main.Me.Location.Z - pathObject.getLocation().Z) * 2)); em = new EasyMover(ppather, newLoc, false, true); em.move(2.5f); return(false); // Does this loop through again? } return(true); }
public override bool Do() { Helpers.Mount.Dismount(); if (ppather.IsQuestAccepted(QuestID)) { return(true); } if (pathObject != null) { Functions.Interact(pathObject); } // For quest pickup on some items while (GPlayerSelf.Me.IsCasting) { Thread.Sleep(250); } Thread.Sleep(1000); // In case of lag if (GossipFrame.IsVisible()) { if (!GossipFrame.ClickOptionText(QuestName)) { return(false); } Thread.Sleep(2000); // Lag } if (QuestFrame.IsVisible() && QuestFrame.IsSelect()) { if (!QuestFrame.ClickOptionText(QuestName)) { return(false); } Thread.Sleep(2000); // Lag } if (QuestFrame.IsVisible() && QuestFrame.IsAccept()) { string quest = QuestFrame.GetAcceptTitle(); if (quest.Contains(QuestName)) { PPather.WriteLine("PickupQuest: Woot! We have the right quest. Picking up."); ppather.QuestAccepted(QuestID); QuestFrame.Accept(); Thread.Sleep(1000); return(true); } else { // Got the wrong quest somehow GContext.Main.SendKey("Common.Escape"); ppather.QuestFailed(QuestID); return(true); } } /* * Try Continue button if it didn't have the Accept button. * This is the case with many repeatable quests. */ if (QuestFrame.IsVisible() && QuestFrame.IsContinue()) { PPather.WriteLine("Yiha! Continuing with quest..."); ppather.QuestAccepted(QuestID); QuestFrame.Continue(); Thread.Sleep(1000); return(true); } // If we're here...that means we failed to pick up the quest. // Maybe we could try a different angle if it's not an item if (!pathObject.isItem()) { Location newLoc = new Location((pathObject.getLocation().X + (GContext.Main.Me.Location.X - pathObject.getLocation().X) * 2), pathObject.getLocation().Y + ((GContext.Main.Me.Location.Y - pathObject.getLocation().Y) * 2), pathObject.getLocation().Z + ((GContext.Main.Me.Location.Z - pathObject.getLocation().Z) * 2)); em = new EasyMover(ppather, newLoc, false, true); em.move(2.5f); return(false); // Does this loop through again? } return(true); }