Jump to content

Quest Abduction. Tame NPC and go to quest giver


te_di

Recommended Posts

Hey! Have a problem with quest Abduction on WotLK

Bot have to use item on weakened NPC and bring him to quest giver.
I've done with cathing npc, but bot continue taming npcs because quest hasn't have complete condition "Catch the npc"
So my question is: How can i force bot go to quest giver after cathing npc?

Sorry if wrote smth incorrect, Hope you can undesrand my exploration

Thanks!

1qest.png

2qest.png

Link to comment
Share on other sites

If you tell me if he is your pet (use Dev tools, C# and past this code,) i can make you a custom code for this quest like i used for ponys in my death knight profile, i just need to know if he returns as a pet or not and quest info like what item you use on him etc.

run this code and look at logs to see if he returns as a pet or not after you use pet on him.

if(ObjectManager.GetObjectWoWUnit().Count(u => u.IsMyPet && u.Name == "Put name here"))
{
Logging.Write("Yes");
}
else
Logging.Write("no");

 

Link to comment
Share on other sites

On 8/3/2020 at 8:24 AM, TheSmokie said:

If you tell me if he is your pet (use Dev tools, C# and past this code,) i can make you a custom code for this quest like i used for ponys in my death knight profile, i just need to know if he returns as a pet or not and quest info like what item you use on him etc.

run this code and look at logs to see if he returns as a pet or not after you use pet on him.


if(ObjectManager.GetObjectWoWUnit().Count(u => u.IsMyPet && u.Name == "Put name here"))
{
Logging.Write("Yes");
}
else
Logging.Write("no");

 

Sorry for late response. Hope It's still avaliable.
I've made what you asked and:

Cannot run C# code:
Compilator Error :
e:\WRobot\Data\temp\am41c1gz.0.cs(22,12) : error CS0029:

( robotManager.Helpful.Var.SetVar("dbgOutput", VALUE_HERE); )
dbgOutput =
Execute time: 1660

=[

Link to comment
Share on other sites

Oh do it like this 

 

if(ObjectManager.GetObjectWoWUnit().Count(u => u.IsMyPet && u.Name == "Put name here") == 1)
{
Logging.Write("Yes");
}
else
Logging.Write("no");
Link to comment
Share on other sites

2 minutes ago, TheSmokie said:

Oh do it like this 

 


if(ObjectManager.GetObjectWoWUnit().Count(u => u.IsMyPet && u.Name == "Put name here") == 1)
{
Logging.Write("Yes");
}
else
Logging.Write("no");

( robotManager.Helpful.Var.SetVar("dbgOutput", VALUE_HERE); )
dbgOutput =
Execute time: 1


Now

Link to comment
Share on other sites

Hello, This code works for your quest. Thank you @droidz for the idea of removing u.IsMyPet. (Tested,)

 

public sealed class Abduction : QuestClass
{
	public Abduction()
	{
		Name = "Abduction";
		QuestId.Add(11590);
		Step.AddRange(new[] { 1, 0, 0, 0, 0 });
	}

	public override bool IsComplete()
	{
		if(ObjectManager.GetObjectWoWUnit().Count(u => u.Name == "Captured Beryl Sorcerer") == 1)
        {
			Conditions.ForceIgnoreIsAttacked = false;
		}
		return ObjectManager.GetObjectWoWUnit().Count(u => u.Name == "Captured Beryl Sorcerer") == 1 &&
					Conditions.ForceIgnoreIsAttacked == false;
	}
	public override bool Pulse()
	{
		string TarName = "Beryl Sorcerer";
		var  HostleNpc = ObjectManager.GetNearestWoWUnit(ObjectManager.GetWoWUnitByEntry(25316));

		var hotspots = new List<Vector3>()
		{
			new Vector3(3486.18f, 6074.44f, 65.86797f),
			new Vector3(3362.955f, 6091.348f, 66.686f)
		};
		Conditions.ForceIgnoreIsAttacked = true;
		if (HostleNpc != null && HostleNpc.IsValid && !ObjectManager.Me.InCombat)
		{
			GoToTask.ToPositionAndIntecractWithNpc(HostleNpc.Position, HostleNpc.Entry);
			return true;
		}
		if (ObjectManager.Target.Name == TarName)
		{
			if (ObjectManager.Me.InCombat)
			{
				Lua.LuaDoString("AttackTarget();");
				if (ObjectManager.Target.HealthPercent <= 55)
				{
					Lua.LuaDoString("StopAttack();");
					ItemsManager.UseItem(34691);
					return true;
				}
			}
			return true;
		}
		GoToTask.ToPositionAndIntecractWithNpc(hotspots[Others.Random(0, hotspots.Count - 1)], 29488, 1);
		return true;
	}
}

 

Link to comment
Share on other sites

On 8/9/2020 at 1:25 AM, TheSmokie said:

Hello, This code works for your quest. Thank you @droidz for the idea of removing u.IsMyPet. (Tested,)

 


public sealed class Abduction : QuestClass
{
	public Abduction()
	{
		Name = "Abduction";
		QuestId.Add(11590);
		Step.AddRange(new[] { 1, 0, 0, 0, 0 });
	}

	public override bool IsComplete()
	{
		if(ObjectManager.GetObjectWoWUnit().Count(u => u.Name == "Captured Beryl Sorcerer") == 1)
        {
			Conditions.ForceIgnoreIsAttacked = false;
		}
		return ObjectManager.GetObjectWoWUnit().Count(u => u.Name == "Captured Beryl Sorcerer") == 1 &&
					Conditions.ForceIgnoreIsAttacked == false;
	}
	public override bool Pulse()
	{
		string TarName = "Beryl Sorcerer";
		var  HostleNpc = ObjectManager.GetNearestWoWUnit(ObjectManager.GetWoWUnitByEntry(25316));

		var hotspots = new List<Vector3>()
		{
			new Vector3(3486.18f, 6074.44f, 65.86797f),
			new Vector3(3362.955f, 6091.348f, 66.686f)
		};
		Conditions.ForceIgnoreIsAttacked = true;
		if (HostleNpc != null && HostleNpc.IsValid && !ObjectManager.Me.InCombat)
		{
			GoToTask.ToPositionAndIntecractWithNpc(HostleNpc.Position, HostleNpc.Entry);
			return true;
		}
		if (ObjectManager.Target.Name == TarName)
		{
			if (ObjectManager.Me.InCombat)
			{
				Lua.LuaDoString("AttackTarget();");
				if (ObjectManager.Target.HealthPercent <= 55)
				{
					Lua.LuaDoString("StopAttack();");
					ItemsManager.UseItem(34691);
					return true;
				}
			}
			return true;
		}
		GoToTask.ToPositionAndIntecractWithNpc(hotspots[Others.Random(0, hotspots.Count - 1)], 29488, 1);
		return true;
	}
}

 

Thanks! I will check it!

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...