trigger to buy item not working

Status
Not open for further replies.
Level 2
Joined
Mar 9, 2021
Messages
8
Buy Item
Events
Unit - A unit comes within 900.00 of Goblin Merchant 0027 <gen>
Unit - A unit comes within 900.00 of Goblin Merchant 0091 <gen>
Unit - A unit comes within 900.00 of Goblin Merchant 0110 <gen>
Unit - A unit comes within 900.00 of Goblin Merchant 0138 <gen>
Unit - A unit comes within 900.00 of Marketplace 0008 <gen>
Unit - A unit comes within 900.00 of Marketplace 0010 <gen>
Unit - A unit comes within 900.00 of Marketplace 0011 <gen>
Unit - A unit comes within 900.00 of Marketplace 0012 <gen>
Conditions
((Owner of (Triggering unit)) controller) Equal to Computer
((Triggering unit) is A Hero) Equal to True
(Item-type of (Item being manipulated)) Not equal to (Item-type of (Item carried by (Triggering unit) in slot (Integer A)))
Actions
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) Current gold) Greater than or equal to (Custom value of (Sold Item))
Then - Actions
Unit - Order Goblin Merchant 0027 <gen> to give (Sold Item) to (Triggering unit)
Unit - Order Goblin Merchant 0091 <gen> to give (Sold Item) to (Triggering unit)
Unit - Order Goblin Merchant 0110 <gen> to give (Sold Item) to (Triggering unit)
Unit - Order Goblin Merchant 0138 <gen> to give (Sold Item) to (Triggering unit)
Unit - Order Marketplace 0008 <gen> to give (Sold Item) to (Triggering unit)
Unit - Order Marketplace 0010 <gen> to give (Sold Item) to (Triggering unit)
Unit - Order Marketplace 0011 <gen> to give (Sold Item) to (Triggering unit)
Unit - Order Marketplace 0012 <gen> to give (Sold Item) to (Triggering unit)
Else - Actions
 
Level 13
Joined
Feb 5, 2018
Messages
545
Well propably, because sold item and item being manipulated does not work with "A unit comes within range of unit" event.

By the looks of this trigger you want AI to buy items from mecrhant or that the merchant gives item to them for free.

You need to order the AI hero to buy the item you desire from the merchant.

Hope this helps you to get started. I suggest that you read the starter tutorials from this site. :)



 

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,177
A fix won't do you any good if you don't learn how triggers actually work. You should read up on those tutorials before going any further otherwise you're never going to understand the fundamentals and you'll run into issues again and again.

You also didn't explain what you want the trigger to do as "trigger to buy item not working" is rather vague. We can only assume what the solution should be based on your trigger but that's difficult when the trigger doesn't really make sense.

This isn't meant to be an insult but instead a suggestion to help you improve at making triggers.

I'd start by looking into Events and Event Responses. The basic idea that for every Event there is a set of Event Responses made available to you.
In the case of this particular Event you have a single Event Response available to use, and that is Triggering Unit (the unit that came within range).
 
Status
Not open for further replies.
Top