• 🏆 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 Basic Triggers

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
AI BASIC TRIGGERS

Good Day everyone here's my basic GUI triggers about Artifical Intelligence ( AI ). For those who in need about AI this GUI triggers will help you!!!

This trigger were help for those who are having troubles about AI. I made this 20% near in DOTA's AI. How an AI can think like human intelligence, can manage to avoid attacks from opponents, buy items to improve AI's attack rate, attack speed, movement speed and armor base and cast spell. :rolleyes::rolleyes:


GUI BASIC TRIGGERS


SET AI

  • Events
    • Unit - A unit enters team 1 <gen>
    • Unit - A unit enters team 2 <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Entering unit) is A Hero) Equal to True) and ((((Owner of (Entering unit)) controller) Equal to Computer) and ((Owner of (Entering unit)) Equal to Player 1 (Red)))
        • Then - Actions
          • Set aiplayer[1] = (Entering unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Entering unit) is A Hero) Equal to True) and ((((Owner of (Entering unit)) controller) Equal to Computer) and ((Owner of (Entering unit)) Equal to Player 3 (Teal)))
        • Then - Actions
          • Set aiplayer[3] = (Entering unit)
        • Else - Actions
HP Heroes - when the hero's HP is low, the hero will go back to his/her own base
  • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of aiplayer[1]) Less than or equal to 40.00
        • Then - Actions
          • Unit - Order aiplayer[1] to Move To (Position of Fountain of Health 0000 <gen>)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of aiplayer[3]) Less than or equal to 40.00
        • Then - Actions
          • Unit - Order aiplayer[3] to Move To (Position of Fountain of Health 0001 <gen>)
        • Else - Actions
AI START BATTLE
  • Events
    • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Unit - Order aiplayer[1] to Move To (Position of Guard Tower 0002 <gen>)
      • Unit - Order aiplayer[3] to Move To (Position of Ancient Protector 0004 <gen>)

AI PLAYER 1- allow the hero to attack and avoid attacks from his/her opponent
  • Events
    • Time - Every 4.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of aiplayer[1]) Greater than or equal to 40.00
        • Then - Actions
          • Unit - Order aiplayer[1] to Attack-Move To (Random point in Region 003 <gen>)
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • ((Number of units in (Units within 600.00 of (Position of aiplayer[1]) matching (((Owner of (Matching unit)) Equal to Player 2 (Blue)) and (((Matching unit) is alive) Equal to True)))) Greater than or equal to 1) or ((Number of units in (Units within 600.00 of (Position of aiplayer[1]) matching ((Unit-type of (Matching unit)) Equal to Archer))) Greater than or equal to 1)
              • (Number of units in (Units within 600.00 of (Position of aiplayer[1]) matching (((Owner of (Matching unit)) Equal to Player 4 (Purple)) and (((Matching unit) is alive) Equal to True)))) Greater than or equal to 2
              • (Number of units in (Units within 600.00 of (Position of aiplayer[1]) matching (((Matching unit) is A Hero) Equal to True))) Greater than or equal to 1
              • (Number of units in (Units within 600.00 of (Position of aiplayer[1]) matching (((Matching unit) is A structure) Equal to True))) Greater than or equal to 1
              • (Percentage life of aiplayer[1]) Greater than or equal to 40.00
        • Then - Actions
          • Unit - Order aiplayer[1] to Move To (Position of (Random unit from (Units within 600.00 of ((Position of aiplayer[1]) offset by 200.00 towards 0.00 degrees) matching ((Unit-type of (Matching unit)) Equal to Rifleman))))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of aiplayer[1]) Greater than or equal to 40.00
            • Then - Actions
              • Unit - Order aiplayer[1] to Attack-Move To (Random point in Region 003 <gen>)
              • Unit - Order aiplayer[1] to Attack-Move To (Random point in Region 002 <gen>)
            • Else - Actions
              • Do nothing
          • Do nothing
AI LEARN SPELL- allow the hero to learn spell to use against his/her opponent
  • Events
    • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • For each (Integer A) from 1 to (Unspent skill points of (Triggering unit)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Attacking unit)) Equal to Paladin
            • Then - Actions
              • Hero - Learn skill for (Triggering unit): Holy Light
              • Hero - Learn skill for (Triggering unit): Divine Shield
              • Hero - Learn skill for (Triggering unit): Devotion Aura
              • Hero - Learn skill for (Triggering unit): Resurrection
            • Else - Actions
      • For each (Integer A) from 1 to (Unspent skill points of (Triggering unit)), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Attacking unit)) Equal to Lord Garithos
            • Then - Actions
              • Hero - Learn skill for (Triggering unit): Shockwave
              • Hero - Learn skill for (Triggering unit): Holy Light
              • Hero - Learn skill for (Triggering unit): Devotion Aura
              • Hero - Learn skill for (Triggering unit): Avatar
            • Else - Actions
AI BEGIN ITEMS P1
  • Events
    • Unit - A unit enters Region 004 <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Entering unit)) Equal to (Owner of aiplayer[1])
        • Then - Actions
          • Hero - Create Slippers of Agility +3 and give it to (Entering unit)
          • Hero - Create Ironwood Branch and give it to (Entering unit)
          • Hero - Create Ironwood Branch and give it to (Entering unit)
          • Hero - Create Ancient Tango and give it to (Entering unit)
          • Trigger - Turn off (This trigger)
        • Else - Actions
AI BUY ITEMS P1 - allow the hero to buy items
  • Events
    • Unit - A unit Gains a level
    • Conditions
      • (Owner of (Leveling Hero)) Equal to (Owner of aiplayer[1])
    • Actions
      • Unit Group - Pick every unit in (Units owned by (Owner of aiplayer[1])) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Hero level of (Picked unit)) Equal to 3) and ((Unit-type of (Picked unit)) Equal to Arthas)
            • Then - Actions
              • Item - Remove (Item carried by (Picked unit) of type Ironwood Branch)
              • Item - Remove (Item carried by (Picked unit) of type Ironwood Branch)
              • Hero - Create Ring of Regeneration and give it to (Picked unit)
            • Else - Actions
      • Unit Group - Pick every unit in (Units owned by (Owner of aiplayer[1])) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Hero level of (Picked unit)) Equal to 6) and ((Unit-type of (Picked unit)) Equal to Arthas)
            • Then - Actions
              • Hero - Create Ring of Protection +4 and give it to (Picked unit)
            • Else - Actions
USES TANGGO - allow the hero to use the buy items when it is purchaseable
  • Events
    • Time - Every 4.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of aiplayer[1]) Less than or equal to 60.00
        • Then - Actions
          • Hero - Order aiplayer[1] to use (Item carried by aiplayer[1] of type Ancient Tango) on (Random destructible in (Region centered at (Position of aiplayer[1]) with size (400.00, 400.00)))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of aiplayer[3]) Less than or equal to 60.00
        • Then - Actions
          • Hero - Order aiplayer[3] to use (Item carried by aiplayer[3] of type Ancient Tango) on (Random destructible in (Region centered at (Position of aiplayer[3]) with size (400.00, 400.00)))
        • Else - Actions
          • Do nothing
Contents

AI Basic Triggers (Binary)

Top