Jump to content

Recommended Posts

Hey,

I would like to check if Thrown is quiped and if not, equip it.

I have this but need help with the equip function:

private void EquipThrown()
	{
		if (player.GetEquipedItemBySlot(wManager.Wow.Enums.InventorySlot.INVSLOT_RANGED) = 0)
		{
			foreach (WoWItem item in Bag.GetBagItem())
			{
				if(item.GetItemInfo.ItemName == "Heavy Throwing Dagger")
				{
					EQUIP THE ITEM
				}
				if (player.GetEquipedItemBySlot(wManager.Wow.Enums.InventorySlot.INVSLOT_RANGED) != 0)
				{
					break;
				}
			}
		}
		return;
	}

Also, is there a way so i can avoid hardcoding the thrown name? Sth like isItemUsable && itemIsRanged

Thx

Link to comment
https://wrobot.eu/forums/topic/7388-solved-equip-thrown/
Share on other sites

Figured it out. Apparently you can use items to equip them. At least in this case. It's wonky but it works:

private void EquipThrown()
	{
		if (ObjectManager.Me.GetEquipedItemBySlot(wManager.Wow.Enums.InventorySlot.INVSLOT_RANGED) == 0) // if player doesn't have a ranged weapon equipped
		{
			if (ItemsManager.HasItemById(3108))
			{
				ItemsManager.UseItem(3108);
			}
		}
		return;
	}

 

Link to comment
https://wrobot.eu/forums/topic/7388-solved-equip-thrown/#findComment-33662
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...