• 🏆 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!

[Trigger] Help me Complete Trigger with Custom Script?

Status
Not open for further replies.
Level 18
Joined
Mar 16, 2008
Messages
721
I'm going mad trying to make an AI scrpit. I'm supplementing the script by changing ownership of the AI's heroes and making them do certain things at vendors then giving ownship back to the AI. I'm trying to get them to vendor items below item lv 5 but I can't exactly figure out the GUI translation for "item carried by udg_Red_Prince in slot (Integer A)." If anyone can point me in the right direction here, I'd appreciate it a lot. Thanks. Here's how far I got:

  • AI Red Enchant pt2
    • Events
      • Unit - A unit enters Red Ftn <gen>
    • Conditions
      • (Entering unit) Equal to Red_Prince
      • (Owner of (Entering unit)) Equal to Player 13 (Maroon)
    • Actions
      • -------- ------------------------ --------
      • -------- PAWN ITEMS BELOW ILV 5 --------
      • -------- ------------------------ --------
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item: (Item carried by Red_Prince in slot (Integer A))'s Integer Field: Level ('ilev')) Less than 5
            • Then - Actions
              • Custom script: native IssueNeutralImmediateOrderById(Player(12),udg_king_library[1], integer unitId returns boolean
            • Else - Actions
        • ...
        • ...
        • ...
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,542
They don't actually have to pawn the item, you can just remove the item and add gold to the player.

Another solution:
 
Status
Not open for further replies.
Top