Jump to content

get target position as Vector


craine

Recommended Posts

Hey, back on wRobot again !

 

Is there the possibility in c# to get the position of a target/npc/gameobject as a vector for the pathfinder ?

Something like:

lua.RunMactroText("/tar NPC");
Vector3 NPC = wManager.Wow.Bot.Whatever.GetTargetPosition();

wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(NPC, XXXXX, 0, false);

Or something that can have the same effect.

It's useful for npc that spawn right behind you or after you interact with a mob. 

Any ideas ?

Link to comment
Share on other sites

Vector3 NpcLoc = ObjectManager.GetWoWUnitByName("TheNPCName").FirstOrDefault().Position;
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(NpcLoc, 1111, -1, false);

1111 being the npc ID, -1 is gossip option

 

edit: keep in mind i haven't touched the api for couple months so it may cause a error if you use this code. I don't remember everything anymore

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...