What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Help With Coding Heroic Leap Plugin

naut

Community Developer
Joined
Feb 9, 2012
Messages
277
Reaction score
21
I am trying to include heroic leap into an override plugin I am creating for assisting with killing rare elite mobs.

Currently this is what i have:

_target = GetPoint();
SpellManager.Cast("Heroic Leap");
SpellManager.ClickRemoteLocation(_target);

This will cause heroic leap to be cast on my targets location. However I would like the plugin to cast heroic leap ~10 yards away from my targets location, as I am using it to jump away from a spell being cast.

Is there a way to code it to click on a location other than your current location or your targets location?

Thanks alot.
 
Hi, Naut,

Questions like this belong in the Community Developer forum.

But, to answer your question, it would look something like this...

if (Me.GotTarget)
{
var currentTarget = StyxWoW.Me.CurrentTarget;

// Calculate point 10 yards away from target, in direction target is facing...
var leapDestination =
Styx.Helpers.WoWMathHelper.CalculatePointInFront(
currentTarget,
currentTarget.RenderFacing,
10.0); // yards​

SpellManager.Cast("Heroic Leap");
SpellManager.ClickRemoteLocation(leapDestination);​

}​

cheers,
chinajade
 
Hi, Naut,

Questions like this belong in the Community Developer forum.

But, to answer your question, it would look something like this...

if (Me.GotTarget)
{
var currentTarget = StyxWoW.Me.CurrentTarget;

// Calculate point 10 yards away from target, in direction target is facing...
var leapDestination =
Styx.Helpers.WoWMathHelper.CalculatePointInFront(
currentTarget,
currentTarget.RenderFacing,
10.0); // yards​

SpellManager.Cast("Heroic Leap");
SpellManager.ClickRemoteLocation(leapDestination);​

}​

cheers,
chinajade


Thank you very much. Sorry for posting in the wrong section.
 
Firstly, I didn't want to start a new thread so if a mod could move this I would really appreciate it.

Second, when trying to use the above command I am receiving the following compile error:

Compiler Error: c:\Users\Brendon\Downloads\Honorbuddy 2.5.8877.711\Plugins\EliteHelperWarrior\EliteHelper.cs(93,6) : error CS1502: The best overloaded method match for 'Styx.Helpers.WoWMathHelper.CalculatePointInFront(Styx.WoWPoint, float, float)' has some invalid arguments

Compiler Error: c:\Users\Brendon\Downloads\Honorbuddy 2.5.8877.711\Plugins\EliteHelperWarrior\EliteHelper.cs(94,7) : error CS1503: Argument 1: cannot convert from 'Styx.WoWInternals.WoWObjects.WoWUnit' to 'Styx.WoWPoint'

Compiler Error: c:\Users\Brendon\Downloads\Honorbuddy 2.5.8877.711\Plugins\EliteHelperWarrior\EliteHelper.cs(96,7) : error CS1503: Argument 3: cannot convert from 'double' to 'float'

Compiler Error: c:\Users\Brendon\Downloads\Honorbuddy 2.5.8877.711\Plugins\EliteHelperWarrior\EliteHelper.cs(109,6) : error CS1502: The best overloaded method match for 'Styx.Helpers.WoWMathHelper.CalculatePointInFront(Styx.WoWPoint, float, float)' has some invalid arguments

Compiler Error: c:\Users\Brendon\Downloads\Honorbuddy 2.5.8877.711\Plugins\EliteHelperWarrior\EliteHelper.cs(110,7) : error CS1503: Argument 1: cannot convert from 'Styx.WoWInternals.WoWObjects.WoWUnit' to 'Styx.WoWPoint'

Compiler Error: c:\Users\Brendon\Downloads\Honorbuddy 2.5.8877.711\Plugins\EliteHelperWarrior\EliteHelper.cs(112,7) : error CS1503: Argument 3: cannot convert from 'double' to 'float'

I assume I am missing a using reference at the beginning, although I guessed and added styx.WoWPoint and it said it does not exist in the namespace.

Currently I have in my list:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Xml.Linq;
using System.Diagnostics;
using System.IO;
using System.Xml;
using System.Windows.Forms;
using System.Net;
using System.Globalization;
using System.Windows.Media;
using System.Media;
using System.Linq;

using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.Helpers;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Styx.Plugins;
using Styx.Pathing;
using Styx.WoWInternals.World;
using CommonBehaviors.Actions;
using Action = Styx.TreeSharp.Action;

If you could tell me what I am missing I would greatly appreciate it.

Full plugin:
View attachment EliteHelper.cs
 
Back
Top