• 🏆 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] GUI made AI Problem (Level 90 trigger challenge)

Status
Not open for further replies.
Level 17
Joined
Dec 11, 2014
Messages
2,004
Ok I Have Made an ORPG Map with 8 players. but it was Empty in SP, So I Decided to make an AI For it. I Used Triggers for the AI, Not AI Editor.
What it does:At first, the game Runs a Cinematic. then if the Play is Singleplayer, Finds the Singleplayers' Hero by setting integers.
At the same time, The Players choose their hero by dialogues. When they choose a Hero, a Unit is Removed ''(Hero (male2))'' and Another unit comes as it.


NOTE: I Don't Care about leaks Right Now, I'll fix them at the End, SO PLEASE DON'T COMMENT: LEAKS!/DON'T USE WAITS!


  • Init Cinematic
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Hero_Unready_Player[1] = Hero (Male 2) 0087 <gen>
      • Set Hero_Unready_Player[2] = Hero (Male 2) 0409 <gen>
      • Set Hero_Unready_Player[3] = Hero (Male 2) 0412 <gen>
      • Set Hero_Unready_Player[4] = Hero (Male 2) 0417 <gen>
      • Set Hero_Unready_Player[5] = Hero (Male 2) 0418 <gen>
      • Set Hero_Unready_Player[6] = Hero (Male 2) 0419 <gen>
      • Set Hero_Unready_Player[7] = Hero (Male 2) 0420 <gen>
      • Set Hero_Unready_Player[8] = Hero (Male 2) 0421 <gen>
        • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
          • Loop - Actions
            • Set Hero_Unready_Player_Facing[(Integer A)] = (Facing of Hero_Unready_Player[(Integer A)])
            • Set Hero_Unready_Player_Point[(Integer A)] = (Position of Hero_Unready_Player[(Integer A)]
      • -------- From this on, It's the Cinematic. NOT IMPORTANT--------
      • -------- Bla Bla Bla Bla Bla--------
      • Trigger - Run Single Player Detecting <gen> (ignoring conditions)

  • Single Player Detecting
    • Events
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Current game is singleplayer Equal to (==) True
        • Then - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 (Red) controller) Equal to (==) User
            • Then - Actions
              • Set Integer_SP = 1
              • Set SinglePlayer_Is_On[Integer_SP] = True
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Player 2 (Blue) controller) Equal to (==) User
                • Then - Actions
                  • Set Integer_SP = 2
                  • Set SinglePlayer_Is_On[Integer_SP] = True
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Player 3 (Teal) controller) Equal to (==) User
                    • Then - Actions
                      • Set Integer_SP = 3
                      • Set SinglePlayer_Is_On[Integer_SP] = True
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Player 4 (Purple) controller) Equal to (==) User
                        • Then - Actions
                          • Set Integer_SP = 4
                          • Set SinglePlayer_Is_On[Integer_SP] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Player 5 (Yellow) controller) Equal to (==) User
                            • Then - Actions
                              • Set Integer_SP = 5
                              • Set SinglePlayer_Is_On[Integer_SP] = True
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Player 6 (Orange) controller) Equal to (==) User
                                • Then - Actions
                                  • Set Integer_SP = 6
                                  • Set SinglePlayer_Is_On[Integer_SP] = True
                                • Else - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Player 7 (Green) controller) Equal to (==) User
                                    • Then - Actions
                                      • Set Integer_SP = 7
                                      • Set SinglePlayer_Is_On[Integer_SP] = True
                                    • Else - Actions
                                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Player 8 (Pink) controller) Equal to (==) User
                                        • Then - Actions
                                          • Set Integer_SP = 8
                                          • Set SinglePlayer_Is_On[Integer_SP] = True
                                        • Else - Actions
                                          • Do nothing
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
        • Then - Actions
          • Game - Display to (All players) the text: Singleplayer Detect...
          • Trigger - Run Creation Of Heroes <gen> (ignoring conditions)
        • Else - Actions
          • Do nothing


Then, it runs Creation of Heroes, A Trigger that, well, creates Computer AI Heroes, NOT PLAYER HEROES. and adds Them to a Player group needed later.

  • Creation Of Heroes
    • Events
    • Conditions
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) controller) Equal to (==) Computer
        • Then - Actions
          • Player Group - Add Player 1 (Red) to AI__Player
          • Player - Set name of Player 1 (Red) to |cFFFF0000Arad MNK|...
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) controller) Equal to (==) Computer
        • Then - Actions
          • Player Group - Add Player 2 (Blue) to AI__Player
          • Player - Set name of Player 2 (Blue) to |cFF3A7FC5Venger07|...
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) controller) Equal to (==) Computer
        • Then - Actions
          • Player Group - Add Player 3 (Teal) to AI__Player
          • Player - Set name of Player 3 (Teal) to |cFF7EBFF1FINLANDMA...
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) controller) Equal to (==) Computer
        • Then - Actions
          • Player Group - Add Player 4 (Purple) to AI__Player
          • Player - Set name of Player 4 (Purple) to |cFF540081StoPCampi...
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) controller) Equal to (==) Computer
        • Then - Actions
          • Player Group - Add Player 5 (Yellow) to AI__Player
          • Player - Set name of Player 5 (Yellow) to |cFFFFCC00Sylvie|r
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) controller) Equal to (==) Computer
        • Then - Actions
          • Player Group - Add Player 6 (Orange) to AI__Player
          • Player - Set name of Player 6 (Orange) to |cFFFE8A0ERex.|r
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 7 (Green) controller) Equal to (==) Computer
        • Then - Actions
          • Player Group - Add Player 7 (Green) to AI__Player
          • Player - Set name of Player 7 (Green) to |cFF00FF00Orcnet|r
        • Else - Actions
          • Do nothing
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) controller) Equal to (==) Computer
        • Then - Actions
          • Player Group - Add Player 8 (Pink) to AI__Player
          • Player - Set name of Player 8 (Pink) to |cFFE55BB0andreario...
        • Else - Actions
          • Do nothing
      • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player[(Integer A)] controller) Equal to (==) Computer
            • Then - Actions
              • Set AI_Hero_Chance_Number = (Random integer number between 1 and 4)
              • Unit - Remove Hero_Unready_Player[(Integer A)] from the game
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • AI_Hero_Chance_Number Equal to (==) 1
                  • Then - Actions
                    • Unit - Create 1 |c00640000Warrior|r for Player[(Integer A)] at Hero_Unready_Player_Point[(Integer A)] facing Hero_Unready_Player_Facing[(Integer A)] degrees
                    • Set Hero_Player[(Integer A)] = (Last created unit)
                    • Unit Group - Add Hero_Player[(Integer A)] to AI_Group_Warrior
                    • Hero - Learn skill for (Last created unit): Quick Slash
                  • Else - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • AI_Hero_Chance_Number Equal to (==) 2
                      • Then - Actions
                        • Unit - Create 1 |c00FFFF00Priest|r for Player[(Integer A)] at Hero_Unready_Player_Point[(Integer A)] facing Hero_Unready_Player_Facing[(Integer A)] degrees
                        • Set Hero_Player[(Integer A)] = (Last created unit)
                        • Unit Group - Add Hero_Player[(Integer A)] to AI_Group_Priest
                        • Hero - Learn skill for Hero_Player[(Integer A)]: Holy Light For Priest
                      • Else - Actions
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • AI_Hero_Chance_Number Equal to (==) 3
                          • Then - Actions
                            • Unit - Create 1 |c000000FFWizard|r for Player[(Integer A)] at Hero_Unready_Player_Point[(Integer A)] facing Hero_Unready_Player_Facing[(Integer A)] degrees
                            • Set Hero_Player[(Integer A)] = (Last created unit)
                            • Unit Group - Add Hero_Player[(Integer A)] to AI_Group_Wizard
                            • Hero - Learn skill for Hero_Player[(Integer A)]: Chain Lightning For Wizard
                          • Else - Actions
                            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • AI_Hero_Chance_Number Equal to (==) 4
                              • Then - Actions
                                • Unit - Create 1 |c0096FF96Ranger|r for Player[(Integer A)] at Hero_Unready_Player_Point[(Integer A)] facing Hero_Unready_Player_Facing[(Integer A)] degrees
                                • Set Hero_Player[(Integer A)] = (Last created unit)
                                • Unit Group - Add Hero_Player[(Integer A)] to AI_Group_Ranger
                                • Hero - Learn skill for Hero_Player[(Integer A)]: Poisonous Shot
                              • Else - Actions
                                • Do nothing
            • Else - Actions
              • Do nothing
      • Custom script: call RemoveLocation(udg_Hero_Unready_Player_Point[1])
      • Custom script: call RemoveLocation(udg_Hero_Unready_Player_Point[2])
      • Custom script: call RemoveLocation(udg_Hero_Unready_Player_Point[3])
      • Custom script: call RemoveLocation(udg_Hero_Unready_Player_Point[4])
      • Custom script: call RemoveLocation(udg_Hero_Unready_Player_Point[5])
      • Custom script: call RemoveLocation(udg_Hero_Unready_Player_Point[6])
      • Custom script: call RemoveLocation(udg_Hero_Unready_Player_Point[7])
      • Custom script: call RemoveLocation(udg_Hero_Unready_Player_Point[8])
        • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Player[(Integer A)] controller) Equal to (==) Computer
              • Then - Actions
                • Unit - Order Hero_Player[(Integer A)] to Right-Click Hero_Player[Integer_SP]
              • Else - Actions
                • Do nothing
OK, That's it. the Heroes create, and other triggers (not listed) work.
BUT, the heroes don't Cast abilities. so I Created A Trigger for each hero-type to Learn and Cast.
Notice: Maximum Hero level= 20. Normal Abilities=4 levels Ultimates= 3 levels.
Priest:
Ability 1. Holy light: Our well-known holy light with the difference it can heal self.
Ability 2. Healing Wave: again no difference with the vanilla.
Ability 3. Devotion aura: again no difference with the vanilla.
Ability 4. Mass Healing: Same as Tranquility (Ultimate)

Now, Triggers for AI:
  • Skill Learning Priest
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Leveling Hero)) Equal to (==) |c00FFFF00Priest|r
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
      • (Owner of (Leveling Hero)) Not equal to (!=) Player[Integer_SP]
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of (Leveling Hero)) Equal to (==) 2
        • Then - Actions
          • Hero - Learn skill for (Leveling Hero): Healing Wave For Priest
          • Set AI_Boolean_Priest_has_HW[(Player number of (Owner of (Leveling Hero)))] = True
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Leveling Hero)) Equal to (==) 3
            • Then - Actions
              • Hero - Learn skill for (Leveling Hero): Devotion Aura
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Hero level of (Leveling Hero)) Equal to (==) 4
                • Then - Actions
                  • Hero - Learn skill for (Leveling Hero): Attribute Bonus
                  • Set AI_Boolean_Priest_Level_HL[(Player number of (Owner of (Leveling Hero)))] = True
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Hero level of (Leveling Hero)) Greater than or equal to (>=) 5
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 6
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 12
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 18
                    • Then - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AI_Boolean_Priest_Level_HL[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                        • Then - Actions
                          • Unit - Increase level of Holy Light For Priest for (Leveling Hero)
                          • Set AI_Boolean_Priest_Level_HL[(Player number of (Owner of (Leveling Hero)))] = False
                          • Set AI_Boolean_Priest_Level_HW[(Player number of (Owner of (Leveling Hero)))] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AI_Boolean_Priest_Level_HW[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                            • Then - Actions
                              • Unit - Increase level of Healing Wave For Priest for (Leveling Hero)
                              • Set AI_Boolean_Priest_Level_HW[(Player number of (Owner of (Leveling Hero)))] = False
                              • Set AI_Boolean_Priest_Level_DA[(Player number of (Owner of (Leveling Hero)))] = True
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AI_Boolean_Priest_Level_DA[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                                • Then - Actions
                                  • Unit - Increase level of Devotion Aura for (Leveling Hero)
                                  • Set AI_Boolean_Priest_Level_DA[(Player number of (Owner of (Leveling Hero)))] = False
                                  • Set AI_Boolean_Priest_Level_AB[(Player number of (Owner of (Leveling Hero)))] = True
                                • Else - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AI_Boolean_Priest_Level_AB[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                                    • Then - Actions
                                      • Unit - Increase level of Attribute Bonus for (Leveling Hero)
                                      • Set AI_Boolean_Priest_Level_AB[(Player number of (Owner of (Leveling Hero)))] = False
                                      • Set AI_Boolean_Priest_Level_HL[(Player number of (Owner of (Leveling Hero)))] = True
                                    • Else - Actions
                                      • Do nothing
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Hero level of (Leveling Hero)) Equal to (==) 6
                        • Then - Actions
                          • Hero - Learn skill for (Leveling Hero): Mass Healing For Priest
                          • Set AI_Boolean_Priest_has_MH[(Player number of (Owner of (Leveling Hero)))] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Hero level of (Leveling Hero)) Equal to (==) 12
                            • Then - Actions
                              • Unit - Increase level of Mass Healing For Priest for (Leveling Hero)
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Hero level of (Leveling Hero)) Equal to (==) 18
                                • Then - Actions
                                  • Unit - Increase level of Mass Healing For Priest for (Leveling Hero)
                                • Else - Actions
                                  • Do nothing
                              • Do nothing
                          • Do nothing
                      • Do nothing
  • Spells of Priest
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of Hero_Player[(Integer A)]) Less than or equal to (<=) ((Max life of Hero_Player[(Integer A)]) / 2.00)
            • Then - Actions
              • Unit Group - Pick every unit in AI_Group_Priest and do (Actions)
                • Loop - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Not equal to (!=) Player[Integer_SP]
                      • ((Owner of (Picked unit)) is an ally of Player[(Integer A)]) Equal to (==) True
                    • Then - Actions
                      • Set AI_Spell_Chance_Number = (Random integer number between 1 and 2)
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • AI_Spell_Chance_Number Equal to (==) 1
                            • (Mana of (Picked unit)) Greater than or equal to (>=) 65.00
                          • Then - Actions
                            • Unit - Order (Picked unit) to (Name of Holy Light For Priest) Hero_Player[Integer_SP]
                          • Else - Actions
                            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • AI_Spell_Chance_Number Equal to (==) 2
                                • (Mana of (Picked unit)) Greater than or equal to (>=) 90.00
                                • AI_Boolean_Priest_has_HW[(Player number of (Owner of (Picked unit)))] Equal to (==) True
                              • Then - Actions
                                • Unit - Order (Picked unit) to (Name of Holy Light For Priest) Hero_Player[Integer_SP]
                              • Else - Actions
                                • Do nothing
                    • Else - Actions
                      • Do nothing
            • Else - Actions
              • Do nothing
  • Ultimate of Priest
    • Events
      • Time - Every 120.00 seconds of game time
    • Conditions
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of Hero_Player[(Integer A)]) Less than or equal to (<=) ((Max life of Hero_Player[(Integer A)]) / 2.00)
              • (Is Hero_Player[(Integer A)] near (Picked unit) and withing a range of 700.00) Equal to (==) True
            • Then - Actions
              • Unit Group - Pick every unit in AI_Group_Priest and do (Actions)
                • Loop - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Not equal to (!=) Player[Integer_SP]
                      • ((Owner of (Picked unit)) is an ally of Player[(Integer A)]) Equal to (==) True
                      • (Mana of (Picked unit)) Greater than or equal to (>=) 800.00
                      • AI_Boolean_Priest_has_MH[(Player number of (Owner of (Picked unit)))] Equal to (==) True
                    • Then - Actions
                      • Unit - Order (Picked unit) to (Name of Mass Healing For Priest) Hero_Player[Integer_SP]
                    • Else - Actions
                      • Do nothing
            • Else - Actions
              • Do nothing
But They Don't Do the Spells.

Warrior:
Ability 1. Quick Slash: Based on Storm Bolt With a Different Model and Icon
Ability 2. Critical Strike: No difference between the Original
Ability 3. Aura of War: Based on Tauren chieftain aura
Ability 4. Fan of Knives: Based on the Normal fan of knive, Slightly changed stats (Ultimate)

  • Skill learning Warrior
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Leveling Hero)) Equal to (==) |c00640000Warrior|r
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
      • (Owner of (Leveling Hero)) Not equal to (!=) Player[Integer_SP]
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of (Leveling Hero)) Equal to (==) 2
        • Then - Actions
          • Hero - Learn skill for (Leveling Hero): Critical Strike
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Leveling Hero)) Equal to (==) 3
            • Then - Actions
              • Hero - Learn skill for (Leveling Hero): Aura Of War (Cairne)
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Hero level of (Leveling Hero)) Equal to (==) 4
                • Then - Actions
                  • Hero - Learn skill for (Leveling Hero): Attribute Bonus
                  • Set AI_Boolean_Warrior_Level_QS[(Player number of (Owner of (Leveling Hero)))] = True
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Hero level of (Leveling Hero)) Greater than or equal to (>=) 5
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 6
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 12
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 18
                    • Then - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AI_Boolean_Warrior_Level_QS[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                        • Then - Actions
                          • Unit - Increase level of Quick Slash for (Leveling Hero)
                          • Set AI_Boolean_Warrior_Level_QS[(Player number of (Owner of (Leveling Hero)))] = False
                          • Set AI_Boolean_Warrior_Level_CS[(Player number of (Owner of (Leveling Hero)))] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AI_Boolean_Warrior_Level_CS[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                            • Then - Actions
                              • Unit - Increase level of Critical Strike for (Leveling Hero)
                              • Set AI_Boolean_Warrior_Level_CS[(Player number of (Owner of (Leveling Hero)))] = False
                              • Set AI_Boolean_Warrior_Level_AoW[(Player number of (Owner of (Leveling Hero)))] = True
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AI_Boolean_Warrior_Level_AoW[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                                • Then - Actions
                                  • Unit - Increase level of Aura Of War (Cairne) for (Leveling Hero)
                                  • Set AI_Boolean_Warrior_Level_AoW[(Player number of (Owner of (Leveling Hero)))] = False
                                  • Set AI_Boolean_Warrior_Level_AB[(Player number of (Owner of (Leveling Hero)))] = True
                                • Else - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AI_Boolean_Warrior_Level_AB[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                                    • Then - Actions
                                      • Unit - Increase level of Attribute Bonus for (Leveling Hero)
                                      • Set AI_Boolean_Warrior_Level_AB[(Player number of (Owner of (Leveling Hero)))] = False
                                      • Set AI_Boolean_Warrior_Level_QS[(Player number of (Owner of (Leveling Hero)))] = True
                                    • Else - Actions
                                      • Do nothing
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Hero level of (Leveling Hero)) Equal to (==) 6
                        • Then - Actions
                          • Hero - Learn skill for (Leveling Hero): Fan of Knives For Warrior
                          • Set AI_Boolean_Warrior_has_FoK[(Player number of (Owner of (Leveling Hero)))] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Hero level of (Leveling Hero)) Equal to (==) 12
                            • Then - Actions
                              • Unit - Increase level of Fan of Knives For Warrior for (Leveling Hero)
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Hero level of (Leveling Hero)) Equal to (==) 18
                                • Then - Actions
                                  • Unit - Increase level of Fan of Knives For Warrior for (Leveling Hero)
                                • Else - Actions
                                  • Do nothing
                              • Do nothing
                          • Do nothing
                      • Do nothing
  • Spells of Warrior
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
      • (Unit-type of (Attacked unit)) Equal to (==) |c00640000Warrior|r
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Attacked unit)) Not equal to (!=) Player[Integer_SP]
        • Then - Actions
          • Set AI_Spell_Chance_Number = (Random integer number between 1 and 2)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Mana of (Attacked unit)) Greater than or equal to (>=) 75.00
                • AI_Spell_Chance_Number Equal to (==) 1
              • Then - Actions
                • Unit - Order (Attacked unit) to (Name of Quick Slash ) (Position of (Attacking unit))
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Mana of (Attacked unit)) Greater than or equal to (>=) 200.00
                    • AI_Boolean_Warrior_has_FoK[(Player number of (Owner of (Picked unit)))] Equal to (==) True
                    • AI_Spell_Chance_Number Equal to (==) 2
                  • Then - Actions
                    • Unit - Order (Attacked unit) to (Name of Fan of Knives For Warrior)
                  • Else - Actions
                    • Do nothing
        • Else - Actions
          • Do nothing
Doesn't Work...

Wizard:
Ability 1. Chain lightning: Again no difference
Ability 2. Blizzard: No changes...
Ability 3. Earthquake: Again...
Ability 4. Flame strike: Normal one with a low cooldown (Ultimate)

EDIT: Wizards' Chain lightning works.

  • Spell learning Wizard
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Leveling Hero)) Equal to (==) |c000000FFWizard|r
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
      • (Owner of (Leveling Hero)) Not equal to (!=) Player[Integer_SP]
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of (Leveling Hero)) Equal to (==) 2
        • Then - Actions
          • Hero - Learn skill for (Leveling Hero): Blizzard For Wizard
          • Set AI_Boolean_Wizard_has_B[(Player number of (Owner of (Leveling Hero)))] = True
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Leveling Hero)) Equal to (==) 3
            • Then - Actions
              • Hero - Learn skill for (Leveling Hero): Earthquake For Wizard
              • Set AI_Boolean_Wizard_has_E[(Player number of (Owner of (Leveling Hero)))] = True
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Hero level of (Leveling Hero)) Equal to (==) 4
                • Then - Actions
                  • Hero - Learn skill for (Leveling Hero): Attribute Bonus
                  • Set AI_Boolean_Wizard_Level_CL[(Player number of (Owner of (Leveling Hero)))] = True
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Hero level of (Leveling Hero)) Greater than or equal to (>=) 5
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 6
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 12
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 18
                    • Then - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AI_Boolean_Wizard_Level_CL[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                        • Then - Actions
                          • Unit - Increase level of Chain Lightning For Wizard for (Leveling Hero)
                          • Set AI_Boolean_Wizard_Level_CL[(Player number of (Owner of (Leveling Hero)))] = False
                          • Set AI_Boolean_Wizard_Level_B[(Player number of (Owner of (Leveling Hero)))] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AI_Boolean_Wizard_Level_B[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                            • Then - Actions
                              • Unit - Increase level of Blizzard For Wizard for (Leveling Hero)
                              • Set AI_Boolean_Wizard_Level_B[(Player number of (Owner of (Leveling Hero)))] = False
                              • Set AI_Boolean_Wizard_Level_E[(Player number of (Owner of (Leveling Hero)))] = True
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AI_Boolean_Wizard_Level_E[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                                • Then - Actions
                                  • Unit - Increase level of Earthquake For Wizard for (Leveling Hero)
                                  • Set AI_Boolean_Wizard_Level_E[(Player number of (Owner of (Leveling Hero)))] = False
                                  • Set AI_Boolean_Wizard_Level_AB[(Player number of (Owner of (Leveling Hero)))] = True
                                • Else - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AI_Boolean_Wizard_Level_AB[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                                    • Then - Actions
                                      • Unit - Increase level of Devotion Aura for (Leveling Hero)
                                      • Set AI_Boolean_Wizard_Level_AB[(Player number of (Owner of (Leveling Hero)))] = False
                                      • Set AI_Boolean_Wizard_Level_CL[(Player number of (Owner of (Leveling Hero)))] = True
                                    • Else - Actions
                                      • Do nothing
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Hero level of (Leveling Hero)) Equal to (==) 6
                        • Then - Actions
                          • Hero - Learn skill for (Leveling Hero): Flame Strike For Wizard
                          • Set AI_Boolean_Wizard_has_FS[(Player number of (Owner of (Leveling Hero)))] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Hero level of (Leveling Hero)) Equal to (==) 12
                            • Then - Actions
                              • Unit - Increase level of Flame Strike For Wizard for (Leveling Hero)
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Hero level of (Leveling Hero)) Equal to (==) 18
                                • Then - Actions
                                  • Unit - Increase level of Flame Strike For Wizard for (Leveling Hero)
                                • Else - Actions
                                  • Do nothing
                              • Do nothing
                          • Do nothing
                      • Do nothing
  • Spells of Wizard
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
      • (Unit-type of (Attacked unit)) Equal to (==) |c000000FFWizard|r
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Attacked unit)) Not equal to (!=) Player[Integer_SP]
        • Then - Actions
          • Set AI_Spell_Chance_Number = (Random integer number between 1 and 4)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • AI_Spell_Chance_Number Equal to (==) 1
                • AI_Boolean_Wizard_has_B[(Player number of (Owner of (Attacked unit)))] Equal to (==) True
                • (Mana of (Attacked unit)) Greater than or equal to (>=) 75.00
              • Then - Actions
                • Unit - Order (Attacked unit) to (Name of Blizzard For Wizard) (Position of (Attacking unit))
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Mana of (Attacked unit)) Greater than or equal to (>=) 120.00
                    • AI_Spell_Chance_Number Equal to (==) 2
                  • Then - Actions
                    • Unit - Order (Attacked unit) to (Name of Chain Lightning For Wizard) (Position of (Attacking unit))
                  • Else - Actions
                    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Mana of (Attacked unit)) Greater than or equal to (>=) 350.00
                        • AI_Spell_Chance_Number Equal to (==) 3
                        • ((Attacking unit) is A structure) Equal to (==) True
                        • AI_Boolean_Wizard_has_E[(Player number of (Owner of (Attacked unit)))] Equal to (==) True
                      • Then - Actions
                        • Unit - Order (Attacked unit) to (Name of Earthquake For Wizard) (Position of (Attacking unit))
                      • Else - Actions
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Mana of (Attacked unit)) Greater than or equal to (>=) 135.00
                            • AI_Spell_Chance_Number Equal to (==) 4
                            • AI_Boolean_Wizard_has_FS[(Player number of (Owner of (Attacked unit)))] Equal to (==) True
                          • Then - Actions
                            • Unit - Order (Attacked unit) to (Name of Flame Strike For Wizard) (Position of (Attacking unit))
                          • Else - Actions
        • Else - Actions
          • Do nothing
Ranger:
as long as I Saw the AI Doesn't work, i stopped. So no need for it to know.


So, Where is my mistake?
Anyone who helps me, Obviously Gets (REP).
 
Last edited:
Level 21
Joined
Nov 4, 2013
Messages
2,017
I encountered similar problems. If you use For Each Integer A to B then you use If/Then/Else (Multiple Actions) function, the function for integer A and B will work ONLY for the "If" part. The "Then" and "Else" will NOT work with integer A and B. To solve that, you must re-add the For Each Integer A to B function in the "Then" and "Else" part.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
I encountered similar problems. If you use For Each Integer A to B then you use If/Then/Else (Multiple Actions) function, the function for integer A and B will work ONLY for the "If" part. The "Then" and "Else" will NOT work with integer A and B. To solve that, you must re-add the For Each Integer A to B function in the "Then" and "Else" part.

That only explains ''Spells of Priest'', not all. (maybe not even that), no offense

BTW, Thanks for the tip
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I encountered similar problems. If you use For Each Integer A to B then you use If/Then/Else (Multiple Actions) function, the function for integer A and B will work ONLY for the "If" part. The "Then" and "Else" will NOT work with integer A and B. To solve that, you must re-add the For Each Integer A to B function in the "Then" and "Else" part.

You sure?
JASS:
function Trig_Untitled_Trigger_001_Func001Func001C takes nothing returns boolean
    return true
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 10
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Untitled_Trigger_001_Func001Func001C() ) then
            //do something
        else
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction
Sounds legit.
However it is indeed better to use normal variables instead of integer a and b.

NOTE: I Don't Care about leaks Right Now, I'll fix them at the End, SO PLEASE DON'T COMMENT: LEAKS!/DON'T USE WAITS!
DoNothing() though -_-
It is not a leak... or whatever, but you just choose to lower the performance.

Anyway, if NONE of the spells work, you should be looking at if the learning or player checks are right.

What I suggest is using a few of those triggers but remove the events.
When you create the units, you add events for those specific units to those triggers.
That way, you don't need all those checks if the unit is AI controlled because then only the AI controlled units will fire those events.

Also, it might be helpfull to search a bit about AI Behavior Trees and Thread Perception
 
Ugh, why people hate this : bj_isSinglePlayer?
It's good for checking Singleplayer, then loop through all players and see if the player is user or computer (and not certain exclusive players that doesn't need this AI), less work.

There's a chance AI is reordered before he can even cast the said spell. In order to avoid this, all triggers need a timeout between casting. Also, do they possess all requirements and mana?

Check if AI has the spell through debug messages.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
In order to avoid this, all triggers need a timeout between casting. Also, do they possess all requirements and mana?




Ok, The best example is the Priest, It has Leveling, Timeout, Mana check and Requirements.

There's a chance AI is reordered before he can even cast the said spell.

You ''might'' be right. I've seen this on Requiem of The Gods. The Tauren Rockbreaker has a Toggleable ability that makes him do war stomp. but if he attacks, it won't. I'll Check it in non-combat mode.

Check if AI has the spell through debug messages.

Ok, I Admit it, i'm new to Triggering and stuff.
You Mean I Must Check AI Editor?
 
Ok, The best example is the Priest, It has Leveling, Timeout, Mana check and Requirements.



You ''might'' be right. I've seen this on Requiem of The Gods. The Tauren Rockbreaker has a Toggleable ability that makes him do war stomp. but if he attacks, it won't. I'll Check it in non-combat mode.



Ok, I Admit it, i'm new to Triggering and stuff.
You Mean I Must Check AI Editor?

I refer to the abilities, do they have proper mana to use the said ability, has them learned and so on?

An ability can be interrupted from activation with another order given to the unit, exclusions are "Instant Cast" abilities like Berserk, unless they have "Casting Time".

No, just add a Game Message showing if the ability is learned or not.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
I refer to the abilities, do they have proper mana to use the said ability, has them learned and so on?

An ability can be interrupted from activation with another order given to the unit, exclusions are "Instant Cast" abilities like Berserk, unless they have "Casting Time".

No, just add a Game Message showing if the ability is learned or not.

Got it! Thx in Advance and +Rep to all who have subscribed.

EDIT1: Hive says you have given too much reputation points today. come back in 24 hours or whatever. (i could only give daffa rep lol gonna give others tomorrow)

EDIT 2: That's Right. They are interrupted. I Used Debug and it showed it. for Especially Priest, Because it keeps looping ''Heal''.
BTW Thanks, It is now solved. (Not Solved, check edit 3) REP Willbe given Tomorrow. (explained In Edit 1)

EDIT 3: Oh damn, The Priest Spell is Interrupted by itself! Instead of Casting single time every 10 seconds, IT CASTS 2-4 TIMES!!!, Even If everyone have full health!!!! IT IS NOT SOLVED!!!!!
 
Last edited:
Refrain from bumping prior to 48 hours rules.

Does the spell has a Cooldown less than 1 second (to allow succession)? If not, then it might explain why AI can use it in rapid succession, and AI also has odd behaviors with spells anyway.
An easy fix is to add a small Cooldown to the spell which should handle the issue. Also, some healing spell disregards health status (scrolls mostly).
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
Exactly, The Debug Is like:
"Priest Casts Holy light"
"Priest Casts Holy light"
"Priest Casts Holy light"
"Priest Casts Holy light"
But I don't see Any holy light, I mean the condition:
  • (Life of Hero_Player[(Integer A)]) Less than or equal to (<=) ((Max life of Hero_Player[(Integer A)]) / 2.00)
Isn't correct, but Warcraft Goes past it and Debugs Multiple times, without Any Spells Casted.
NOTE: I used only "1" Priest, so don't say that's because you have multiple Priests.
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
Exactly, The Debug Is like:
"Priest Casts Holy light"
"Priest Casts Holy light"
"Priest Casts Holy light"
"Priest Casts Holy light"
But I don't see Any holy light, I mean the condition:
  • (Life of Hero_Player[(Integer A)]) Less than or equal to (<=) ((Max life of Hero_Player[(Integer A)]) / 2.00)
Isn't correct, but Warcraft Goes past it and Debugs Multiple times, without Any Spells Casted.
NOTE: I used only "1" Priest, so don't say that's because you have multiple Priests.

I told you why. Since you are using an If/Then/Else (Multiple functions) with For each integer 1 to 8, the Hero_Player[Integer A] = No unit so the holy light is ordered on no unit therefore the priest will never cast it. Have you already followed my suggestion? If you did so, then I'd have to analyse your triggers again.
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
Hey, RPG with AI is really a neat idea. ;) I'm still reading through the thread and hope there is something I can help.

EDIT:
So, what's your current problem now? Does the AI cast the ability already? If I read your trigger in the first post,
  • Unit - Order (Picked unit) to (Name of Holy Light For Priest) Hero_Player[Integer_SP]
will not work. You should use the order string instead of ability's name. If I understand (Name of Holy Light For Priest) correctly, it will return the ability's name instead of the order string. In case you don't know where to check the order string of your ability, you can find it at: Object Editor > Abilities > Your ability > Text - Order string - Use/Turn On.

This is just an example:
If your ability's order string is "heal" (human priest's heal), the trigger would be something like this:
  • Unit - Order (Picked unit) to Human Priest - Heal Hero_Player[Integer_SP]
Since I think you are using UMSWE (your trigger is special GUI code provided by UMSWE), where you can specify the order string by yourself, your trigger would be something like this:
  • Unit - Order (Picked unit) to heal Hero_Player[Integer_SP]
Second thing you can do is to check whether the ability is already learned correctly by AI or not yet by using the same method of displaying debug messages (printing learned ability's level).
 
Last edited:
Level 17
Joined
Dec 11, 2014
Messages
2,004
Hey, RPG with AI is really a neat idea. ;) I'm still reading through the thread and hope there is something I can help.

Thanks!

EDIT:
So, what's your current problem now? Does the AI cast the ability already? If I read your trigger in the first post,
  • Unit - Order (Picked unit) to (Name of Holy Light For Priest) Hero_Player[Integer_SP]
will not work.

It works, But ONLY For warrior and Wizard! (yeah some things in this thread must be changed...)
My current and current problem Is Priest. (I Think daffa got it...)
please Read the comments for My problem. (permanlink #16)
Thx in advance!
 
If the mana never wasted despite the debugs, then it's an issue on Warcraft processing or the condition passed. It's also possible that the unit passed through the argument equals to null, have you checked the unit through debug before running the conditional process?

Sorry, I was having issues on my end and almost forgot about this thread.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
Can you show me the newest trigger for priest?

Of Course! I'll do it in like 1 hour (got some work to do)

EDIT:
  • Skill Learning Priest
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Leveling Hero)) Equal to (==) |c00FFFF00Priest|r
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
      • (Owner of (Leveling Hero)) Not equal to (!=) Player[Integer_SP]
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of (Leveling Hero)) Equal to (==) 2
        • Then - Actions
          • Hero - Learn skill for (Leveling Hero): Healing Wave For Priest
          • Set AI_Boolean_Priest_has_HW[(Player number of (Owner of (Leveling Hero)))] = True
          • Game - Display to (All players) the text: Given Priest: Heali...
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero level of (Leveling Hero)) Equal to (==) 3
            • Then - Actions
              • Hero - Learn skill for (Leveling Hero): Devotion Aura
              • Game - Display to (All players) the text: Given Priest: Devot...
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Hero level of (Leveling Hero)) Equal to (==) 4
                • Then - Actions
                  • Hero - Learn skill for (Leveling Hero): Attribute Bonus
                  • Set AI_Boolean_Priest_Level_HL[(Player number of (Owner of (Leveling Hero)))] = True
                  • Game - Display to (All players) the text: Attribute Bonus
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Hero level of (Leveling Hero)) Greater than or equal to (>=) 5
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 6
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 12
                      • (Hero level of (Leveling Hero)) Not equal to (!=) 18
                    • Then - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • AI_Boolean_Priest_Level_HL[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                        • Then - Actions
                          • Unit - Increase level of Holy Light For Priest for (Leveling Hero)
                          • Game - Display to (All players) the text: Increased Holy ligh...
                          • Set AI_Boolean_Priest_Level_HL[(Player number of (Owner of (Leveling Hero)))] = False
                          • Set AI_Boolean_Priest_Level_HW[(Player number of (Owner of (Leveling Hero)))] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • AI_Boolean_Priest_Level_HW[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                            • Then - Actions
                              • Unit - Increase level of Healing Wave For Priest for (Leveling Hero)
                              • Game - Display to (All players) the text: Increased Healing w...
                              • Set AI_Boolean_Priest_Level_HW[(Player number of (Owner of (Leveling Hero)))] = False
                              • Set AI_Boolean_Priest_Level_DA[(Player number of (Owner of (Leveling Hero)))] = True
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • AI_Boolean_Priest_Level_DA[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                                • Then - Actions
                                  • Unit - Increase level of Devotion Aura for (Leveling Hero)
                                  • Game - Display to (All players) the text: Increased devotion
                                  • Set AI_Boolean_Priest_Level_DA[(Player number of (Owner of (Leveling Hero)))] = False
                                  • Set AI_Boolean_Priest_Level_AB[(Player number of (Owner of (Leveling Hero)))] = True
                                • Else - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • AI_Boolean_Priest_Level_AB[(Player number of (Owner of (Leveling Hero)))] Equal to (==) True
                                    • Then - Actions
                                      • Unit - Increase level of Attribute Bonus for (Leveling Hero)
                                      • Game - Display to (All players) the text: Increased Attribute
                                      • Set AI_Boolean_Priest_Level_AB[(Player number of (Owner of (Leveling Hero)))] = False
                                      • Set AI_Boolean_Priest_Level_HL[(Player number of (Owner of (Leveling Hero)))] = True
                                    • Else - Actions
                                      • Do nothing
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Hero level of (Leveling Hero)) Equal to (==) 6
                        • Then - Actions
                          • Hero - Learn skill for (Leveling Hero): Mass Healing For Priest
                          • Game - Display to (All players) the text: Leaned: Mass Healin...
                          • Set AI_Boolean_Priest_has_MH[(Player number of (Owner of (Leveling Hero)))] = True
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Hero level of (Leveling Hero)) Equal to (==) 12
                            • Then - Actions
                              • Unit - Increase level of Mass Healing For Priest for (Leveling Hero)
                              • Game - Display to (All players) the text: Increased Mass Heal...
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Hero level of (Leveling Hero)) Equal to (==) 18
                                • Then - Actions
                                  • Unit - Increase level of Mass Healing For Priest for (Leveling Hero)
                                  • Game - Display to (All players) the text: Increased Mass Heal...
                                • Else - Actions
                                  • Do nothing
                              • Do nothing
                          • Do nothing
                      • Do nothing
  • Spells of Priest
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of Hero_Player[(Integer A)]) Less than or equal to (<=) ((Max life of Hero_Player[(Integer A)]) / 2.00)
            • Then - Actions
              • Unit Group - Pick every unit in AI_Group_Priest and do (Actions)
                • Loop - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Not equal to (!=) Player[Integer_SP]
                      • ((Owner of (Picked unit)) is an ally of Player[(Integer A)]) Equal to (==) True
                    • Then - Actions
                      • Set AI_Spell_Chance_Number = (Random integer number between 1 and 2)
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • AI_Spell_Chance_Number Equal to (==) 1
                            • (Mana of (Picked unit)) Greater than or equal to (>=) 65.00
                          • Then - Actions
                            • Game - Display to (All players) the text: Priest does Holy li...
                            • Unit - Order (Picked unit) to (Name of Holy Light For Priest) Hero_Player[Integer_SP]
                          • Else - Actions
                            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • AI_Spell_Chance_Number Equal to (==) 2
                                • (Mana of (Picked unit)) Greater than or equal to (>=) 90.00
                                • AI_Boolean_Priest_has_HW[(Player number of (Owner of (Picked unit)))] Equal to (==) True
                              • Then - Actions
                                • Unit - Order (Picked unit) to (Name of Healing Wave For Priest) Hero_Player[Integer_SP]
                                • Game - Display to (All players) the text: Priest does Healing...
                              • Else - Actions
                                • Do nothing
                    • Else - Actions
                      • Do nothing
            • Else - Actions
              • Do nothing
  • Ultimate of Priest
    • Events
      • Time - Every 120.00 seconds of game time
    • Conditions
      • SinglePlayer_Is_On[Integer_SP] Equal to (==) True
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of Hero_Player[(Integer A)]) Less than or equal to (<=) ((Max life of Hero_Player[(Integer A)]) / 2.00)
              • (Is Hero_Player[(Integer A)] near (Picked unit) and withing a range of 700.00) Equal to (==) True
            • Then - Actions
              • Unit Group - Pick every unit in AI_Group_Priest and do (Actions)
                • Loop - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Not equal to (!=) Player[Integer_SP]
                      • ((Owner of (Picked unit)) is an ally of Player[(Integer A)]) Equal to (==) True
                      • (Mana of (Picked unit)) Greater than or equal to (>=) 800.00
                      • AI_Boolean_Priest_has_MH[(Player number of (Owner of (Picked unit)))] Equal to (==) True
                    • Then - Actions
                      • Unit - Order (Picked unit) to (Name of Mass Healing For Priest) Hero_Player[Integer_SP]
                      • Game - Display to (All players) the text: Priest does Mass He...
                    • Else - Actions
                      • Do nothing
            • Else - Actions
              • Do nothing
If the mana never wasted despite the debugs, then it's an issue on Warcraft processing or the condition passed. It's also possible that the unit passed through the argument equals to null, have you checked the unit through debug before running the conditional process?

Er... No. Gonna check.

Sorry, I was having issues on my end and almost forgot about this thread.

No problem.
 
Last edited:
Status
Not open for further replies.
Top