Jump to content

C# Not attacking targets?


TricksterJoe
 Share

Recommended Posts

So i have this piece of code

        public sealed class DemonsAmongUs : QuestGrinderClass
        {
            public DemonsAmongUs() 
            {
                Name = "Demons Among Us";

                QuestId.AddRange(new[] { 40593 });
                if ((!Quest.HasQuest(40593) && Quest.GetQuestCompleted(40593)))
                {
                    Logging.Write(string.Format("Quest Completed [{0}]", 40593));
                    return;
                }
                else if (!Quest.HasQuest(40593) && !Quest.GetQuestCompleted(40593))
                {
                    PickUp();
                    QuestInfo();
                    return;
                }
                else if (Quest.HasQuest(40593))
                {
                    QuestInfo();
                }
                return;
            }

            public void QuestInfo()
            {
                Step.AddRange(new[] { 1, 1, 5, 1 });
                wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(-8369.698f, 240.3663f, 155.3077f), 100675, 1);
                wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(new Vector3(-8318.188, 290.8993, 156.8326), 246706);
                wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithGameObject(new Vector3(-8379.064, 322.0625, 147.0138), 246707);
                Logging.Write(string.Format("Demons Among us - Collected portals"));

                HotSpots.Add(new Vector3(-8371.924f, 268.3316f, 155.3485f));
                HotSpots.Add(new Vector3(-8306.045f, 294.0955f, 156.8326f));
                HotSpots.Add(new Vector3(-8324.408f, 242.0122f, 155.3472f));
                HotSpots.Add(new Vector3(-8346.664f, 306.8766f, 155.3472f));
                HotSpots.Add(new Vector3(-8380.933f, 321.979f, 147.1347f));
                EntryTarget.Add(100993);
            }
        }

100993 - The mob ID

It does everything fine, it collects both items (246706, 246707)

i add hotspots and entry target, but it still won't attack anything.

 

Why?

Link to comment
Share on other sites

#if VISUAL_STUDIO
using robotManager.Helpful;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using wManager.Wow.Bot.Tasks;
using wManager.Wow.Class;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
using wManager.Wow.Enums;
#endif

public class TheWillOfTheLichKing : QuestClass
{
	Vector3 _npcPos = new Vector3(2348.741, -5694.941, 384.0876, "None");

	public TheWillOfTheLichKing()
	{
		Name = "The Will Of The Lich King";
		QuestId.Add(12714);
		Step.AddRange(new[] { 0, 0, 0, 0, 0 });
	}
	public override bool IsComplete()
	{
		return ObjectManager.Me.Position.DistanceZ(_npcPos) > 30;
	}
	public override bool Pulse()
	{
		if (GoToTask.ToPositionAndIntecractWithNpc(_npcPos, 29488))
			Thread.Sleep(10 * 1000);
		return true;
	}
}

 

Link to comment
Share on other sites

2 minutes ago, camelot10 said:
#if VISUAL_STUDIO
using robotManager.Helpful;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using wManager.Wow.Bot.Tasks;
using wManager.Wow.Class;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;
using wManager.Wow.Enums;
#endif

public class TheWillOfTheLichKing : QuestClass
{
	Vector3 _npcPos = new Vector3(2348.741, -5694.941, 384.0876, "None");

	public TheWillOfTheLichKing()
	{
		Name = "The Will Of The Lich King";
		QuestId.Add(12714);
		Step.AddRange(new[] { 0, 0, 0, 0, 0 });
	}
	public override bool IsComplete()
	{
		return ObjectManager.Me.Position.DistanceZ(_npcPos) > 30;
	}
	public override bool Pulse()
	{
		if (GoToTask.ToPositionAndIntecractWithNpc(_npcPos, 29488))
			Thread.Sleep(10 * 1000);
		return true;
	}
}

 

How would implementing this in the XML go ? what about quest where u need to kill multiple mobs, or collect certain game objects? or doing both? sorry for all this questions, it's my first day actually working with WRobot and i am a bit lost :)

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
 Share

×
×
  • Create New...