• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Trigger AI Buy Item From Shop

Status
Not open for further replies.
The best way to do this I can think of is...

At the start of the map you create a dummy that the shop can select (i.e. no locust).
Then whenever you want your AI to buy this item, you call a trigger that orders a neutral player /unused computer or whomever is free and can own the dummy and Order them by Id to buy the item. (Make sure they have enough gold or whatever is needed.)
Then you can just instantly remove the item from the dummy and create and give the item to the AI's hero.
 
Create a trigger: give it the events Unit is issued an order targeting an object/targeting a point/no target.
Edit: Buying an item will be a no target order.

Then in the actions.

JASS:
call BJDebugMsg("Order ID: " + I2S(GetIssuedOrderId()))

This will spit out a number then when you want to order your dummy to do that id you call:

JASS:
 call IssueImmediateOrderById(udg_yourUnit, #####)
 
Last edited:
Status
Not open for further replies.
Back
Top