Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Big thanks to cdmichaelb (http://www.thebuddyforum.com/members/61405-cdmichaelb.html)
- * for sending me all the necessary ids for the objects on the Lost And Found achievement.
- */
- #region REFERENCES
- using System;
- using System.Linq;
- using System.Threading;
- using System.Windows.Media;
- using Styx;
- using Styx.Common;
- using Styx.Pathing;
- using Styx.Plugins;
- using Styx.WoWInternals;
- using Styx.WoWInternals.WoWObjects;
- #endregion
- namespace RepCollector
- {
- internal class RepCollector : HBPlugin
- {
- public override string Name
- {
- get { return "Rep Collector"; }
- }
- public override string Author
- {
- get { return "Hazard +tiagofmcosta"; }
- }
- public override Version Version
- {
- get { return new Version(1, 1, 2); }
- }
- public static LocalPlayer Me
- {
- get { return StyxWoW.Me; }
- }
- public override void Pulse()
- {
- Thread.Sleep(1 / 30);
- try
- {
- if (Me.Combat || Me.IsDead) return;
- OnyxEgg();
- NetherwingEgg();
- DarkSoil();
- AncientGuoLaiCache();
- LostAndFound();
- }
- catch (ThreadAbortException) {}
- }
- private static bool AncientGuoLaiCacheKey() { return Me.BagItems.FirstOrDefault(o => o.Entry == 87779) != null; }
- public static void MoveToLocation(WoWPoint loc)
- {
- while (loc.Distance(Me.Location) > 3)
- {
- if (!Flightor.MountHelper.Mounted)
- Flightor.MountHelper.MountUp();
- if (!Me.IsMoving)
- Flightor.MoveTo(loc);
- }
- }
- public static void OnyxEgg()
- {
- if (Me.GetReputationLevelWith(1271).Equals(WoWUnitReaction.Exalted))
- return;
- ObjectManager.Update();
- var objList = ObjectManager.GetObjectsOfType<WoWGameObject>()
- .Where(onyxegg => (onyxegg.Distance2D <= 40 && (onyxegg.Entry == 214945))).OrderBy(onyxegg => onyxegg.Distance).ToList();
- foreach (var onyxegg in objList)
- {
- if (!onyxegg.InLineOfSight) return;
- if (Me.Combat) return;
- MoveToLocation(WoWMovement.CalculatePointFrom(onyxegg.Location, 3));
- if (!Me.HasAura(40120) && !Me.HasAura(33943))
- Flightor.MountHelper.Dismount();
- Thread.Sleep(1000);
- onyxegg.Interact();
- Thread.Sleep(2000);
- Logging.Write(Colors.Blue, "1x Onyx Egg collected!");
- if (!Flightor.MountHelper.Mounted)
- Flightor.MountHelper.MountUp();
- return;
- }
- }
- public static void NetherwingEgg()
- {
- if (Me.GetReputationLevelWith(1015).Equals(WoWUnitReaction.Exalted))
- return;
- ObjectManager.Update();
- var objList = ObjectManager.GetObjectsOfType<WoWGameObject>()
- .Where(netherwingegg => (netherwingegg.Distance2D <= 40 && (netherwingegg.Entry == 185915))).OrderBy(netherwingegg => netherwingegg.Distance).ToList();
- foreach (var netherwingegg in objList)
- {
- if (!netherwingegg.InLineOfSight) return;
- if (Me.Combat) return;
- MoveToLocation(WoWMovement.CalculatePointFrom(netherwingegg.Location, 3));
- if (!Me.HasAura(40120) && !Me.HasAura(33943))
- Flightor.MountHelper.Dismount();
- Thread.Sleep(1000);
- netherwingegg.Interact();
- Thread.Sleep(2000);
- Logging.Write(Colors.Blue, "1x Netherwing Egg collected!");
- if (!Flightor.MountHelper.Mounted)
- Flightor.MountHelper.MountUp();
- return;
- }
- }
- public static void DarkSoil()
- {
- if (Me.GetReputationLevelWith(1272).Equals(WoWUnitReaction.Exalted))
- return;
- ObjectManager.Update();
- var objList = ObjectManager.GetObjectsOfType<WoWGameObject>()
- .Where(darksoil => (darksoil.Distance2D <= 40 && (darksoil.Entry == 210565))).OrderBy(darksoil => darksoil.Distance).ToList();
- foreach (var darksoil in objList)
- {
- if (!darksoil.InLineOfSight) return;
- if (Me.Combat) return;
- MoveToLocation(WoWMovement.CalculatePointFrom(darksoil.Location, 3));
- if (!Me.HasAura(40120) && !Me.HasAura(33943))
- Flightor.MountHelper.Dismount();
- Thread.Sleep(2000);
- darksoil.Interact();
- Thread.Sleep(3000);
- Logging.Write(Colors.Blue, "1x Dark Soil collected!");
- if (!Flightor.MountHelper.Mounted)
- Flightor.MountHelper.MountUp();
- return;
- }
- }
- public static void AncientGuoLaiCache()
- {
- if (Me.GetReputationLevelWith(1269).Equals(WoWUnitReaction.Exalted))
- return;
- ObjectManager.Update();
- var objList = ObjectManager.GetObjectsOfType<WoWGameObject>()
- .Where(ancientguolaicache => (ancientguolaicache.Distance2D <= 40 && (ancientguolaicache.Entry == 214388))).OrderBy(ancientguolaicache => ancientguolaicache.Distance).ToList();
- foreach (var ancientguolaicache in objList)
- {
- if (!AncientGuoLaiCacheKey()) return;
- if (!ancientguolaicache.InLineOfSight) return;
- if (Me.Combat) return;
- MoveToLocation(WoWMovement.CalculatePointFrom(ancientguolaicache.Location, 3));
- if (!Me.HasAura(40120) && !Me.HasAura(33943))
- Flightor.MountHelper.Dismount();
- Thread.Sleep(1000);
- ancientguolaicache.Interact();
- Thread.Sleep(3000);
- Logging.Write(Colors.Blue, "1x Ancient Guo-Lai Cache opened!");
- if (!Flightor.MountHelper.Mounted)
- Flightor.MountHelper.MountUp();
- return;
- }
- }
- public static void LostAndFound()
- {
- ObjectManager.Update();
- var objList = ObjectManager.GetObjectsOfType<WoWGameObject>()
- .Where(lostAndFound => (lostAndFound.Distance2D <= 40 && (
- lostAndFound.Entry == 213364
- || lostAndFound.Entry == 213972
- || lostAndFound.Entry == 213967
- || lostAndFound.Entry == 213970
- || lostAndFound.Entry == 213969
- || lostAndFound.Entry == 213966
- || lostAndFound.Entry == 213964
- || lostAndFound.Entry == 213968
- || lostAndFound.Entry == 213971
- || lostAndFound.Entry == 213962
- || lostAndFound.Entry == 213337
- || lostAndFound.Entry == 214439
- || lostAndFound.Entry == 213651
- || lostAndFound.Entry == 214403
- || lostAndFound.Entry == 213750
- || lostAndFound.Entry == 213653
- || lostAndFound.Entry == 213768
- || lostAndFound.Entry == 213751
- || lostAndFound.Entry == 213842
- || lostAndFound.Entry == 213765
- || lostAndFound.Entry == 214438
- || lostAndFound.Entry == 213769
- || lostAndFound.Entry == 213774
- || lostAndFound.Entry == 214407
- || lostAndFound.Entry == 213793
- || lostAndFound.Entry == 213771
- || lostAndFound.Entry == 213770
- || lostAndFound.Entry == 213782
- || lostAndFound.Entry == 213741
- || lostAndFound.Entry == 213742
- || lostAndFound.Entry == 213363
- || lostAndFound.Entry == 213366
- || lostAndFound.Entry == 213368
- || lostAndFound.Entry == 214338
- || lostAndFound.Entry == 213748
- || lostAndFound.Entry == 213362
- || lostAndFound.Entry == 214325
- || lostAndFound.Entry == 213845
- || lostAndFound.Entry == 213960
- || lostAndFound.Entry == 213961
- || lostAndFound.Entry == 213844
- || lostAndFound.Entry == 213956
- || lostAndFound.Entry == 213959
- || lostAndFound.Entry == 213749
- || lostAndFound.Entry == 213649
- || lostAndFound.Entry == 214340
- || lostAndFound.Entry == 213650
- ))).OrderBy(lostAndFound => lostAndFound.Distance).ToList();
- foreach (var lostAndFound in objList)
- {
- if (!lostAndFound.InLineOfSight) return;
- if (Me.Combat) return;
- MoveToLocation(WoWMovement.CalculatePointFrom(lostAndFound.Location, 3));
- if (!Me.HasAura(40120) && !Me.HasAura(33943))
- Flightor.MountHelper.Dismount();
- Thread.Sleep(1000);
- lostAndFound.Interact();
- Thread.Sleep(3000);
- Logging.Write(Colors.Blue, "1x Lost and Found object collected!");
- if (!Flightor.MountHelper.Mounted)
- Flightor.MountHelper.MountUp();
- return;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement