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

[AI] Specific Script Hero Order

Status
Not open for further replies.
Level 21
Joined
Mar 16, 2008
Messages
979
There are separate natives for AI scripts but I'm wondering if I could throw something like this into the script and have the AI purchase a specific item when it acquires another specific item. Would it matter what part of the script I throw this into? Attacking section or building section?

JASS:
    if ( ( UnitHasItemOfTypeBJ(udg_Red_King, 'I002') == true ) ) and
    if ( ( GetPlayerState(Player(0), PLAYER_STATE_RESOURCE_GOLD) >= 3000 ) ) then
        call IssueNeutralTargetOrder ( GetPlayerID(Player(0), udg_King_Vendor, I015)

Or should I just do this with some elaborate GUI system? Thinking if the AI could handle something like the above it'd be easier just to add it to the AI's script.

Thank you.
 
Last edited:
Status
Not open for further replies.
Top