Hello everyone,
I am developing an automation script related to "World of Warcraft" in C# and have encountered some difficulties. When a character dies and enters spirit form, I need to write code to automatically control the character to click the "Release Spirit" button and talk to a specific NPC after releasing the spirit.
At present, I am not clear on how to implement this function with C# code. Specifically, I need to achieve the following steps:
Detect whether the character is dead and in spirit form.
Automatically click the "Release Spirit" button.
Move close to the NPC.
Engage in dialogue with the NPC.
I have tried some basic API calls and event listening, but I have not been successful. I don't know if anyone has experience in this area or can provide some guidance and code examples?
If someone can help me, I would be very grateful. Any suggestions, guidance, or code examples would be greatly helpful to me.
Thank you!
This is my code:(ToPositionAndIncractWithNpc unsuccessful)
robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) =>
{
if (state is wManager.Wow.Bot.States.Resurrect && ObjectManager.Me.IsDead)
{
if (ObjectManager.Me.Position.DistanceTo2D(new Vector3(-14284.96f, 288.4472f, 32.33204f)) < 2) {
var path = new Vector3(-14283.13f, 293.2209f, 31.98451f);
MovementManager.Go(PathFinder.FindPath(path),false);
MovementManager.StopMove();
var position = new Vector3(-14283.13f, 293.2209f, 31.98451f);
int npcEntryId = 1000128;
wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId);
System.Threading.Thread.Sleep(500);
Usefuls.SelectGossipOption(3);
System.Threading.Thread.Sleep(3000);
}
cancelable.Cancel = true;
}
};