• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[AI] Specific Script Hero Order

Status
Not open for further replies.
Level 18
Joined
Mar 16, 2008
Messages
721
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