ElectricWizard
Member
- Joined
- Oct 29, 2012
- Messages
- 33
- Reaction score
- 0
Looking for a plug in that will move out of stuff on the ground like lightning or poison or whatever, any help would be appreciated.
The problem is know where it is on the ground. It is a lot deeper seeded than you may thing. You will need to know what is around you and test directions you can move. But at the same time you do not know the range of the aoe. The best you can do is guesstimate and hold a direction for a certain time to make sure you are out of it. There is a bit of logic you would need to program in.. but essentially a ugly way of doing it would be to if (hasaura) {holdleftstrafe;} <-- ghetto code but you get the idea.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
using Bots.ArchaeologyBuddy;
using HBPlus;
using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.Helpers;
using Styx.Pathing;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
// ReSharper disable CheckNamespace
namespace Kane49.Honorbuddy.AvoidStuff
// ReSharper restore CheckNamespace
{
public class AvoidStuffSettings : Styx.Helpers.Settings
{
public AvoidStuffSettings(string settingsPath)
: base(settingsPath)
{
Load();
}
[Setting, DefaultValue(true)]
public bool NothingForNow { get; set; }
}
public class AvoidStuff : Styx.Plugins.HBPlugin
{
private Vector3 _currentPool = Vector3.Zero;
public override void Initialize()
{
base.Initialize();
}
public override string Author
{
get { return "Kane49"; }
}
public override string Name
{
get { return "AvoidStuff"; }
}
public override void Pulse()
{
if (!StyxWoW.Me.HasAura("Lightning Pool") || StyxWoW.Me.Location.Distance(new WoWPoint(_currentPool.X, _currentPool.Y, _currentPool.Z)) < 2f)
{
_currentPool = Vector3.Zero;
return;
}
if (_currentPool != Vector3.Zero)
{
Navigator.MoveTo(new WoWPoint(_currentPool.X, _currentPool.Y, _currentPool.Z));
return;
}
foreach (var obj in ObjectManager.GetObjectsOfType<WoWDynamicObject>().Where(ret => ret.Distance < 7))
{
var rand = new Random();
while (_currentPool == Vector3.Zero || !Navigator.CanNavigateFully(StyxWoW.Me.Location, new WoWPoint(_currentPool.X, _currentPool.Y, _currentPool.Z)))
{
var xax = rand.Next(1, 10);
var yax = rand.Next(1, 10);
var xoff = xax > 5 ? 1 : -1;
var yoff = xax > 5 ? 1 : -1;
_currentPool = new Vector3(obj.X + xoff * 5, obj.Y + yoff * 5, obj.Z);
}
LogMessage(String.Format("Avoiding: [Lightning Pool({0},{1},{2})]",obj.Location.X,obj.Location.Y,obj.Location.Z));
return;
}
return;
return;
}
public void LogMessage(string message)
{
Logging.Write(string.Format("[AvoidStuff] {0}", message));
}
public override Version Version
{
get { return new Version(0, 1); }
}
}
}
Put it in it's own folder inside your plugin folder or HB will not pick it up.Kane... so to use this do we just Copy/ paste the code into notepad, save as "outofthefire.cs" (or "my-biscuits-are-burning.cs"),) then copy to the plugins folder?
![]()