1. Are you planning to upload your awesome map to Hive? Please review the rules here.
    Dismiss Notice
  2. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  3. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  4. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

Monster Showdown Ultimate v.8.9.w3x
Variables
Ofensive map triggers
Ini
Time
Exp
Message
Revive Bridge
AI
EngageSystem
Initialize AI
Debug
Items
Get Weapon 1
Get Lifesteal
Get Weapon 2
Get Weapon Ultimate 1
Get Weapon Ultimate 2
Get Weapon Ultimate 3
Other Skills
Ninja
Dark Wizzard
Shadow Assassin
Warrior
Demon
Orc Raider
Force Archer
Grand Defender
Great Knight
Mage
Kazarina
Raikan
Red Dragon
Jaina
Ranger
Assassin
Ronin
Vampire
Wazza
Commander
Goblin Bomber
Town
Tele Base
Make Invulnerable
Enter Town
Leave Town
Enter Map
Creep Spawns, Exp gaining
Creeps Start
Summon Rejects
Spawn Satryl
Spawn Lv2
Spawn Lv3
Spawn Lv4
Spawn Lv5 n 6
Spawn Lv7
Level 2
Level 3
Level 4
Level 5
Level 6
Level 7
Respawn Lv2
Zombies
Bandid
Ghosts
Archers
Enforcers
Spider
Reject dies
Satryl respawn
Scorpion dies
Evil dies
Wendigo dies
Demon Tank dies
OverLord
Respawn Level 3 n 4
Respawn Level 5
Wolf Dies
Ultimate dies
Creeps removal
Stop 1
Stop 2
Stop 3
Regions
Warp 1
Rem Secret
Quest menu
Quest
Multiboard
Leaderboard
Multiboard
Kill Creep
Hero dies
Monster Dies
Leader Dies
Hero Reward
Win
Players
Setup Colors
Check Players
Leaver
Monsters
Midle Guy
Vamp
Illidan
Brutal Guard defend
Reveal us
Creation
dies
Zombie Attacks
Streak System
SysStreakKill
SysExtraStreakKill
SysInit
SysSetupSounds
SysSetupStrings
SysStringSound
SysExtraStringSound
SysLoop
Modes
Initialize
Choose Hero
Add Heroes
Ap
Ar
Sh
Ping players
Spammable Spells
Spammable Spells Work
Repick
Random
Default
Destroy Taverns
Ping Players
Commands
Kill self
ms
ma
Auto Clean
Clean Units
Show Data
GUI Knockback System [Paladon]
---------------------------
GUI Knockback Sytem
---------------------------
Cast A Knockback
Get Knockback
Damage detection System
AIDS
Event
Damage
Textag
Cast Spell System
Ultimate cast system
Ultimate cast
Learn ultimate
Libraries
GroupUtils
xebasic
xedamage
MathBasic
TimedFadeUnit
TimedAnimationStop
TimedHandles
Group2Group
TimerUtils
BoundSentinel
Heights
AutoFly
xepreload
xefx
Ninja
Illusion Slash
Jaina
Arctic Field
Initialization
Eternal Winter Cast
Eternal Winter Sphere
Eternal Bolt Flee
Eternal Bolt Return
Red Dragon
Ground Volcano
DragonBreathCast
DragonBreathLoop
Init
Raikan
Lightning Strike
Lightning Charge
Demon
Room Of Torchering
Mega Punch
Great Kick
Insane Revenge
Insane Revenge Cast
Warrior
Blade Slash
Archer
Gravity Desforation
Kazarina
Kazarina Frenzy
Field of Enervation
Mana Freeze
Avatar of Frost
Shadow
Shadow Bolt
Mage
Teleport
Force Increase
Holy Light
Grand Defender
Spell Deflect
Bouncing Glaives
Heal Mana
Nazgrel
Summon Raiders
Chaos Form
Shadow Assassin
Init Copy
Shadow Strike
Shadow Strike Loop
Shadow Vortex
Ranger
Quick Act
QA Cast
Arrow Armageddon
AA Setup
AA Cast
AA Loop
Bonus Range
Bonus Range
Knock Arrow
Knocking Arrow
Critical Strike
Critical Strike Rem
Assassin
---------------------------
Shadow Attack
Shadow Attack sound
---------------------------
Cast Invisibility
Critical Strike Add Sirena
Critical Strike Rem Sirena
---------------------------
Ini FanOfKnives
Fan of Knives
Fan of Knives Execution
---------------------------
Empower
---------------------------
Blink Strike
Ronin
Windcut
Credits
Release Limits
Release Limits Sound
Final Attack
Vampire
Night Power
Vampiric Power
DrainCast
DrainLoop
Black Flame Initialize
Black Flame Activate
Black Flame Deactivate
Black Flame Caster Group
Black Flame Clear Dummy Data
Water Elemental
init
run 1
---------------------------
Refreshing Water
---------------------------
Double Tide Cast
Double Tide Slide
---------------------------
Attribute Change
Attribute Change AGI
Attribute Change STR
Commander
Bonus Range Sniper
Call Down
Call Down Sound
Goblin Bomber
Detonate
Detonate All
Mine Field
Mine Field Sound
Suicide
Greedy Goblin
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Revive_Hero takes unit REVIVEUNIT, integer TIMEREVIVE returns nothing
local unit x = REVIVEUNIT
local integer t = TIMEREVIVE
local real tt = 1.0
loop
exitwhen t <= 0
call DisplayTextToPlayer(GetOwningPlayer(x), 0, 0, "You will revive in " + I2S(t) + " seconds.")
set t = t - 1
call TriggerSleepAction(tt)
endloop 
call ReviveHeroLoc( x, GetRectCenter(gg_rct_Region_056), true )
 if GetPlayerController(GetOwningPlayer(x)) == MAP_CONTROL_COMPUTER then
    call SetEngageUnit(x)
 endif
set x = null
endfunction


function Texttag_Create takes string TEXTTAG_TEXT, real TEXTTAG_LOCATION_X, real TEXTTAG_LOCATION_Y, integer TEXTTAG_ALPHA_RED, integer TEXTTAG_ALPHA_GREEN, integer TEXTTAG_ALPHA_BLUE, integer TEXTTAG_ALPHA_ALPHA returns nothing
local texttag te = CreateTextTag()
local string text = TEXTTAG_TEXT
local real x = TEXTTAG_LOCATION_X
local real y = TEXTTAG_LOCATION_Y
local integer red = TEXTTAG_ALPHA_RED
local integer green = TEXTTAG_ALPHA_GREEN
local integer blue = TEXTTAG_ALPHA_BLUE
local integer alpha = TEXTTAG_ALPHA_ALPHA

call SetTextTagText(te, text, 0.024)
call SetTextTagPos(te, x, y, 0.00)
call SetTextTagColor(te, red, green, blue, alpha)
call SetTextTagVelocity(te, 0, 0.04)
call SetTextTagVisibility(te, true)
call SetTextTagFadepoint(te, 2)
call SetTextTagLifespan(te, 5)
call SetTextTagPermanent(te, false)

set te = null
endfunction
Name Type Is Array Initial Value
AbilityLevel real No
AIGamble integer No
AIHERO integer No
AIProcess integer Yes
AllPlayer force No
Ally_Status integer Yes
AM unit No
angle real Yes
AOEPPA unit No
AOEPPAdmg unit No
AOESM location No
AOESNS location No
AOESNSMU unit No
AOESSOD location No
AOESWW location No
ArchimondeGroup group No
ArrowCount real No
ArrowCountPerLevel real No
ArrowDamage real No
ArrowHashtable hashtable No
attacker_multi unit Yes
BF_Caster_Group group No
BF_Flame_Group group No
BF_Hash hashtable No
BF_Reals real Yes
BlastArrowAOE real No
BreakingGround effect No
BSLoc location Yes
BSP location No
Caster unit No
CasterOfAOESHS unit No
CasterP unit No
Casters group No
CenterCamp group No
ChargeCaster unit No
ChargeTarget unit No
CLCaster unit No
CLCount integer No
CLDummy unit No
CLEANGROUP group No
CLEANTEMP unit No
CLFacing real No
CLGroup group No
CLLevel integer No
CLMaxCount integer No
CLOwner player No
CLPosition location No
CLTable hashtable No
CLTempPoint location No
CLTempUnit unit No
Computer_Allies integer Yes
CSACP location No
CSUS unit No
CurrentFlyingHeight real No
DAC unit No
DamagePerArrow real No
DAT unit No
DEBUG boolean No
DEBUG_Gold integer No
DEBUG_GoldN integer No
DefeatStrings string Yes
DetonateAll group No
Drain_Caster unit Yes
Drain_Interval integer Yes
Drain_Life_Lightning lightning Yes
Drain_Life_Max integer No
Drain_Max integer No
Drain_Range real Yes
Drain_Targets group Yes
Drain_Value real Yes
dummyAOESSS unit No
Duration integer Yes
Duration2 integer Yes
Dust_int integer No
Earth_quakeeffect_multi effect Yes
effect_multi effect Yes
Enemies group No
ExtraStreak_Chcker boolean Yes
ExtraStreak_Kills integer Yes
ExtraStreak_Sounds sound Yes
ExtraStreak_Strings string Yes
ExtraStreak_Timer integer Yes
ExtraStreakInt integervar No
Eye_Angle real No
FireArt effect No
FireCaster unit No
FleeingBolts group No
Flying_unit group No
FOB1 unit No
FOB2 unit No
FOB3 unit No
FoK_Ability_Level integer No
FoK_Angle real No
FoK_Base_Damage real No
FoK_Caster unit No
FoK_Damage_Group group No
FoK_Detection_Area real No
FoK_Distance real No
FoK_Dummy_Group group No
FoK_Facing real No
FoK_Knives_Count integer No
FoK_Loc1 location No
FoK_Loc2 location No
FoK_Loc3 location No
FoK_Loc4 location No
FoK_Random_Movement boolean No
FoK_Random_Path boolean No
FoK_Speed real No
FoK_Spiral_Angle real No
FoK_Table hashtable No
FoK_Total_Damage real No
GETLVL integer No
HandleID integer No
HASH hashtable No
Hashtable hashtable No
Heroes unit Yes
HEROREWGROUP group No
i integervar No
i2 integer No
ice1 unit No
ice2 unit No
ice3 unit No
ice4 unit No
ice5 unit No
IDKey1Bool boolean No
IDKey1Bool2 boolean No
INIAI integer Yes
Integer integer Yes
IntegerDT integer No
intiger integer Yes
INVUGROUP group No
KazarinaDummy unit No
KazarinaGroup group No
KazarinaTemp unit No
KB_Angle real Yes
KB_Casters unit Yes
KB_CountBuffs integer No
KB_DestroyTrees boolean Yes
KB_EffectCounter integer Yes
KB_EffectCounter2 integer Yes
KB_Effects_1 string Yes
KB_Effects_2 string Yes
KB_GeneralIntegers integervar Yes
KB_KnockbackedUnits group No
KB_Levels integer Yes
KB_MaxDistance real Yes
KB_ReachedDistance real Yes
KB_ReducedReal real No
KB_ReduceSpeedReal real Yes
KB_SpecificSpeed real Yes
KB_StartPositions location Yes
KB_TempPoint location Yes
KB_TempReal real No
KB_TotalKnockUnits integer No
KB_Units unit Yes
KBA_Angle real No
KBA_Caster unit No
KBA_DestroyTrees boolean No
KBA_DistancePerLevel real No
KBA_Level integer No
KBA_SpecialEffects string Yes
KBA_Speed real No
KBA_StartingPosition location No
KBA_TargetUnit unit No
Kills integer Yes
KillsLeaderboard leaderboard No
KING unit Yes
KnockBackTimer timer No
KnockDistance real No
KnockedEffect effect No
KnockedUnit unit No
KnockFacing real No
KnockingUnit unit No
KnockPoint location No
KnockSecondPoint location No
l1 lightning No
l1_Copy lightning No
l1_Copy_Copy lightning No
l1_Copy_Copy_10 lightning No
l1_Copy_Copy_11 lightning No
l1_Copy_Copy_12 lightning No
l1_Copy_Copy_13 lightning No
l1_Copy_Copy_2 lightning No
l1_Copy_Copy_3 lightning No
l1_Copy_Copy_4 lightning No
l1_Copy_Copy_5 lightning No
l1_Copy_Copy_6 lightning No
l1_Copy_Copy_7 lightning No
l1_Copy_Copy_8 lightning No
l1_Copy_Copy_9 lightning No
Leaderboard leaderboard No
lightning1 lightning No
lightning1_Copy lightning No
lightning1_Copy_2 lightning No
lightning1_Copy_3 lightning No
lightning1_Copy_4 lightning No
lightning1_Copy_5 lightning No
lightning1_Copy_6 lightning No
lightning1_Copy_7 lightning No
loc location No
loopA integervar No
LotusAngle real No
LotusCaster unit No
LotusDummy unit No
LotusFade real No
LotusPoint location No
LotusTarget unit No
MC unit No
Messages string Yes
Mode string No
MT unit No
Names string Yes
NazgrelGroup group No
NazgrelLoc location No
NS1 unit No
NS1_Copy unit No
NS1_Copy_2 unit No
NS1_Copy_3 unit No
NS1_Copy_4 unit No
NS1_Copy_5 unit No
NS1_Copy_6 unit No
NS1_Copy_7 unit No
P1 location No
P2 location No
Palantir unit No
PassiveSpell abilcode No
PassiveSpellName string No
PINGLOC location No
Player integer No
Player_Colours string Yes
Player_Strings string Yes
PLAYERCon integer Yes
PlayerNames string Yes
PLMC location No
PLMC_Copy location No
point location No
Point location Yes
Point_A location Yes
Point_B location Yes
point_move location Yes
Points location Yes
Ponit_victim_multi location Yes
PortalP location No
PossibleHeroes group No
QAGroup group No
RAA location No
RainingArrowGroup group No
RandomInt integer Yes 1
RANGERGROUP group No
Real real Yes
RepickInt integer Yes 1
ReturningBolts group No
Ripple unit No
ROR unit No
ROR1 unit No
ROR2 unit No
ROR3 unit No
ROR4 unit No
ROR5 unit No
ROR6 unit No
ROR7 unit No
ROT location No
Sample_Group group No
Sample_Point location No
Score integer Yes 500
SOD1 location No
SOD1_Copy location No
SOD1_Copy_2 location No
SOD1_Copy_3 location No
SODarray lightning Yes
SODCaster unit No
SODmain location No
SoDtg unit No
Spheres group No
SSCaster unit Yes
SSDamage real Yes
SSDummyGroup group Yes
SSGroup group No
SSIndex integer No
SSInteger integervar No
SSInteger2 integervar No
SSMax integer No
SSPoint location Yes
SSPoint2 location Yes
SSTarget unit Yes
Stomp_Location location No
Stomper unit No
Streak_Kills integer Yes
Streak_Sounds sound Yes
Streak_Strings string Yes
STSF location No
STSFc unit No
STSFt unit No
t1 trigger No
t1_Copy trigger No
t1_Copy_2 trigger No
t1_Copy_3 trigger No
t1_Copy_4 trigger No
t1_Copy_5 trigger No
t1_Copy_6 trigger No
t1_Copy_7 trigger No
t1_Copy_8 trigger No
Target unit No
targetAOESGD unit No
Temp_Group_1 group No
Temp_Group_2 group No
Temp_Loc_1 location No
Temp_Loc_2 location No
Temp_Player_1 player No
Temp_Player_2 player No
Temp_Player_Group force No
Temp_Real_1 real No
Temp_String string No
Temp_Unit_1 unit No
TempHeroLoc location No
temploc location No
Timer timer No
TotalMessages integer Yes
UC location No
UC1 location No
Unit unit Yes
unit_C unit Yes
unitAOESNO unit No
VAMPIRES group No
Victim_multi unit Yes
VisionMod fogmodifier Yes
Way1 unit No
Way2 unit No
WEGroup group No
WTF unit No
x real No
x2 real No
y real No
y2 real No
z real No
zLoc location No
Ini
  Events
    Map initialization
  Conditions
  Actions
    Set VariableSet Names[1] = John
    Set VariableSet Names[2] = Andro
    Set VariableSet Names[3] = Zeon
    Set VariableSet Names[4] = Aon
    Set VariableSet Names[5] = Selcabrio
    Set VariableSet Names[6] = Zera
    Set VariableSet Names[7] = Neon
    Set VariableSet Names[8] = Cambrio
    Set VariableSet Names[9] = :)
    Set VariableSet Names[10] = Pook
    Set VariableSet Names[11] = Miol
    Set VariableSet Names[12] = Terrorist
    Set VariableSet Names[13] = Zombie
    Set VariableSet Names[14] = Ganp
    Set VariableSet Names[15] = :D
    Set VariableSet Names[16] = Ray
    Set VariableSet Names[17] = :O
    Set VariableSet Names[18] = xD
    Set VariableSet Names[19] = ^^
    Set VariableSet Names[20] = //\\o.o//\\
    Set VariableSet Names[21] = :P
    Set VariableSet Names[22] = Luri
    Set VariableSet Names[23] = Runo
    Set VariableSet Names[24] = ME!
    Set VariableSet Names[25] = I'm goin' to die
    Custom script: set udg_HASH = InitHashtable()
    Player - Set name of Neutral Hostile to Monsters
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Picked player) slot status) Equal to Is playing
          Then - Actions
            Set VariableSet RandomInt[(Player number of (Picked player))] = 1
            Set VariableSet RepickInt[(Player number of (Picked player))] = 1
            Set VariableSet INIAI[(Player number of (Picked player))] = 0
            Set VariableSet PLAYERCon[(Player number of (Picked player))] = 0
            Unit - Create 1.Soul for (Picked player) at (Center of Heroes <gen>) facing Default building facing degrees
            Player - Set (Picked player).Current gold to 550
            Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Heroes <gen>
            Set VariableSet VisionMod[(Player number of (Picked player))] = (Last created visibility modifier)
            Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Vision_Reg_1 <gen>
            Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Vision_Reg_3 <gen>
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                ((Picked player) controller) Equal to Computer
              Then - Actions
                Player - Set name of (Picked player) to Names[(Random integer number between 1 and 25)]
                Set VariableSet AIProcess[(Player number of (Picked player))] = 0
              Else - Actions
          Else - Actions
Time
  Events
    Time - Every 1.00 seconds of game time
  Conditions
  Actions
    Player Group - Pick every player in (All players) and do (Actions)
      Loop - Actions
        Player - Set (Picked player).Food used to (((Picked player) Food used) + 1)
        Player - Add 1 to (Picked player).Current gold
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            ((Picked player) Food used) Equal to 60
          Then - Actions
            Player - Set (Picked player).Food used to 0
            Player - Set (Picked player).Current lumber to (((Picked player) Current lumber) + 1)
          Else - Actions
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Exp_Actions takes nothing returns nothing
    call SetPlayerHandicapXPBJ( Player(0), 125.00 )
    call SetPlayerHandicapXPBJ( Player(1), 125.00 )
    call SetPlayerHandicapXPBJ( Player(2), 125.00 )
    call SetPlayerHandicapXPBJ( Player(3), 125.00 )
    call SetPlayerHandicapXPBJ( Player(4), 125.00 )
    call SetPlayerHandicapXPBJ( Player(5), 125.00 )
    call SetPlayerHandicapXPBJ( Player(6), 125.00 )
    call SetPlayerHandicapXPBJ( Player(7), 125.00 )
    call SetPlayerHandicapXPBJ( Player(8), 125.00 )
    call SetPlayerHandicapXPBJ( Player(9), 125.00 )
    call SetPlayerHandicapXPBJ( Player(10), 125.00 )
    call SetPlayerHandicapXPBJ( Player(11), 125.00 )
endfunction

//===========================================================================
function InitTrig_Exp takes nothing returns nothing
    set gg_trg_Exp = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Exp, function Trig_Exp_Actions )
endfunction

 
Message
  Events
    Map initialization
  Conditions
  Actions
    Game - Display to (All players) for 45.00 seconds the text: |cffff0000 Get hero, items, and then 2000 score to win !!!Read Quest menu to learn how to play.Modes:-ap (All Pick)-ar (All Random)Commands:-random-repick-kill self-ma-ms
Revive Bridge
  Events
    Destructible - Long Stone Bridge 0022 <gen> dies
    Destructible - Short Stone Bridge 2756 <gen> dies
    Destructible - Stone Ramp 2754 <gen> dies
    Destructible - Stone Ramp 2755 <gen> dies
    Destructible - Short Stone Bridge 4514 <gen> dies
    Destructible - Short Wooden Bridge 0799 <gen> dies
    Destructible - Short Wooden Bridge 0706 <gen> dies
    Destructible - Short Natural Bridge 4509 <gen> dies
  Conditions
  Actions
    Wait 0.01 seconds
    Destructible - Resurrect (Dying destructible) with (Max life of (Dying destructible)) life and Show birth animation
//TESH.scrollpos=18
//TESH.alwaysfold=0
//System Name: EngageSystem
//Made by: Mckill2009

//===FEATURES:
//- This system will order a unit to engage and search for enemies
//- Allows pick up item or an option to pick up only custom item type
//- Allows target random enemy units include creeps and buildings
//- Retreat away from attacker or to building when HP is low
//- Allows to learn/pick custom skill (manually set it up below)
//- Allows target refresh when duration runs out
//- Uses a global timer and group, which is not destroyed but is used during the entire game

//===HOW TO USE:
//- Make a new trigger and convert to custom text via EDIT >>> CONVERT CUSTOM TEXT
//- Copy ALL that is written here (overwrite the existing texts in the trigger)

//===KNOWN ISSUES:
//- If the target unit is unreachable, it will still lock the attack
//- This system does not support Buy and Selling of items for AI (for the meantime)

//===REQUIRES:
//- Jass New Gen Pack (JNGP) by Vexorian

library EngageSystem initializer init

globals
    //===NON-CONFIGURABLES: Meaning, do not touch this!
    private constant hashtable                        HASH = InitHashtable()
    private constant integer            FOUNTAIN_OF_HEALTH = 'nfoh'
    //private constant integer              FOUNTAIN_OF_MANA = 'nmoo' //Reserved
    private constant integer                        ATTACK = 851983
    private constant integer                          MOVE = 851986
    private constant integer                          STOP = 851972
    private constant integer                         SMART = 851971
    private integer array ITEM_TYPE
    private integer array SKILL
    private rect R
    private unit UNIT_RETREATING
    private unit UNIT_DATA
    private integer GROUP_COUNTER_ENGAGE = 0
    private integer GROUP_COUNTER_ITEM = 0
    private group ITEM_SEARCH_GROUP
    private group RETREAT_GROUP
    private trigger RETREAT_TRIGGER
    private constant group                    ENGAGE_GROUP = CreateGroup()
    private constant timer                    ENGAGE_TIMER = CreateTimer()
endglobals
   
globals
    //===CONFIGURABLES:
    private constant real                    AOE_ITEM_PICK = 500
    private constant real                AOE_TARGET_RANDOM = 5000
    private constant real              AOE_TARGET_BUILDING = 6000
    private constant real                  AOE_NEAR_TARGET = 1000
    private constant real                 AOE_TARGET_CREEP = 5000
    private constant real          AOE_RETREAT_TO_BUILDING = 5000
    private constant real                 RETREAT_DISTANCE = 2700
    private constant real                  ATTACK_DURATION = 45.
    private constant real                  ATTACK_INTERVAL = 3 //Recommended setting
    private constant real               ITEM_PICK_INTERVAL = 1 //Recommended setting
    private constant real                 RETREAT_INTERVAL = 1 //Recommended setting
    private constant real                  FOLLOW_INTERVAL = 3 //Recommended setting
    private constant real              MAX_LIFE_PERCENTAGE = 0.35 //Used for retreat
    private constant integer                 MAX_ITEM_TYPE = 3 //Should be match on how many item types created
    private constant integer              MAX_CUSTOM_SKILL = 5 //Should be match on how many skills created
    private constant integer               MAX_ITEM_PICKED = 3 //Warning: MAX is 6
    private constant boolean           ENABLE_PICK_UP_ITEM = true
    private constant boolean      ENABLE_PICK_UP_ITEM_TYPE = false //Set to false to pick every item types
    private constant boolean                ENABLE_RETREAT = true
    private constant boolean    ENABLE_RETREAT_TO_BUILDING = false
    private constant boolean      ENABLE_PICK_CUSTOM_SKILL = false
endglobals

// Set the skills and item types here!
private function SetupSkillsAndItemTypes takes nothing returns nothing
    //You must setup the skills here
    set SKILL[1] = 'A000'
    set SKILL[2] = 'A000'
    set SKILL[3] = 'A000'
    set SKILL[4] = 'A000'
    set SKILL[5] = 'A000'
    //IMPORTANT NOTE: if you increase the item types created, you should increase also the MAX_ITEM_TYPE of the globals
    set ITEM_TYPE[1] = 'will' //Default Wand of Illusion
    set ITEM_TYPE[2] = 'woms' //Default Wand of Mana Stealing
    set ITEM_TYPE[3] = 'wlsd' //Default Wand of Lightning Shield
    //set ITEM_TYPE[4] = 'ADDITIONAL ITEM'
    //set ITEM_TYPE[5] = 'ADDITIONAL ITEM'
endfunction

//===ATTACKING STRUCT:
private struct Engage
    unit hero
    unit target
    unit target2
    unit ally
    real duration
   
    static method onLocateAlly takes nothing returns boolean
        local unit u = GetFilterUnit()
        local boolean b = GetWidgetLife(u) > 0.405 and IsUnitType(u, UNIT_TYPE_STRUCTURE) and not IsUnitEnemy(u, GetOwningPlayer(UNIT_DATA))
        set u = null
        return b
    endmethod
   
    static method onSearchAttack takes nothing returns boolean
        local unit u = GetFilterUnit()
        local boolean b = GetWidgetLife(u) > 0.405 and IsUnitEnemy(u, GetOwningPlayer(UNIT_DATA))
        set u = null
        return b
    endmethod
   
    static method onRangeAttack takes nothing returns boolean
        local unit u = GetFilterUnit()
        local boolean b = GetWidgetLife(u) > 0.405 and IsUnitEnemy(u, GetOwningPlayer(UNIT_DATA)) and GetOwningPlayer(u)!=Player(PLAYER_NEUTRAL_AGGRESSIVE)
        set u = null
        return b
    endmethod
   
    static method onCreepAttack takes nothing returns boolean
        local unit u = GetFilterUnit()
        local boolean b = GetWidgetLife(u) > 0.405 and GetOwningPlayer(u)==Player(PLAYER_NEUTRAL_AGGRESSIVE)
        set u = null
        return b
    endmethod
   
    static method onLocateBuilding takes nothing returns boolean
        local unit u = GetFilterUnit()
        local boolean b = GetWidgetLife(u) > 0.405 and IsUnitType(u, UNIT_TYPE_STRUCTURE) and IsUnitEnemy(u, GetOwningPlayer(UNIT_DATA))
        set u = null
        return b
    endmethod
   
    static method onAttackNow takes nothing returns nothing
        local unit u = GetEnumUnit()
        local thistype this = LoadInteger(HASH, GetHandleId(u), 1)
        local real x = GetUnitX(.hero)
        local real y = GetUnitY(.hero)
        local integer randomatk
        set UNIT_DATA = .hero
        if .duration > 0 and GetWidgetLife(.hero) > 0.405 then
            set .duration = .duration - ATTACK_INTERVAL
            if GetWidgetLife(.target) > 0.405 and .target != null then
                call IssueTargetOrderById(.hero, ATTACK, .target)
                call IssuePointOrderById(.hero, ATTACK, GetUnitX(.target), GetUnitY(.target))
            else
                call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_NEAR_TARGET, Filter(function thistype.onSearchAttack))
                set .target2 = FirstOfGroup(bj_lastCreatedGroup)
                call IssueTargetOrderById(.hero, ATTACK, .target2)
                call IssuePointOrderById(.hero, ATTACK, GetUnitX(.target2), GetUnitY(.target2))
                if .target2==null then
                    call GroupEnumUnitsInRect(bj_lastCreatedGroup, bj_mapInitialPlayableArea, Filter(function thistype.onSearchAttack))
                    set .target2 = FirstOfGroup(bj_lastCreatedGroup)
                    call IssueTargetOrderById(.hero, ATTACK, .target2)
                    call IssuePointOrderById(.hero, ATTACK, GetUnitX(.target2), GetUnitY(.target2))
                    if .target2==null then
                        call GroupEnumUnitsInRect(bj_lastCreatedGroup, bj_mapInitialPlayableArea, Filter(function thistype.onLocateAlly))
                        set .ally = FirstOfGroup(bj_lastCreatedGroup)
                        call IssuePointOrderById(.hero, MOVE, GetUnitX(.ally), GetUnitY(.ally))
                    endif
                endif
            endif
        else
           if GetWidgetLife(.hero) > 0.405 then
                set randomatk = GetRandomInt(1, 4)
                if randomatk==1 or randomatk==2 then
                    call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_TARGET_RANDOM, Filter(function thistype.onRangeAttack))
                elseif randomatk==3 then
                    call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_TARGET_CREEP, Filter(function thistype.onCreepAttack))
                elseif randomatk==4 then
                    call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_TARGET_BUILDING, Filter(function thistype.onLocateBuilding))
                endif
                set .target = FirstOfGroup(bj_lastCreatedGroup)                
                set .duration = ATTACK_DURATION //this action resumes the timer without destroying it
            else
                call GroupRemoveUnit(ENGAGE_GROUP, .hero)
                set GROUP_COUNTER_ENGAGE = GROUP_COUNTER_ENGAGE - 1
                //call BJDebugMsg("ENGAGE UNIT COUNTER "+I2S(GROUP_COUNTER_ENGAGE))
                call .destroy(this)
            endif
        endif      
        set u = null
    endmethod
   
    static method onAttackSetup takes unit u returns Engage
        local Engage EN = Engage.create()
        local integer randomatk = GetRandomInt(1, 4)
        local real x = GetUnitX(u)
        local real y = GetUnitY(u)
        set UNIT_DATA = u
        if randomatk==1 or randomatk==2 then
            call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_TARGET_RANDOM, Filter(function thistype.onRangeAttack))
        elseif randomatk==3 then
            call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_TARGET_CREEP, Filter(function thistype.onCreepAttack))
        elseif randomatk==4 then
            call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_TARGET_BUILDING, Filter(function thistype.onLocateBuilding))
        endif
        set EN.target = FirstOfGroup(bj_lastCreatedGroup)
        set EN.hero = u
        set EN.duration = ATTACK_DURATION
        call GroupAddUnit(ENGAGE_GROUP, u)
        call SaveInteger(HASH, GetHandleId(u), 1, EN)
        set GROUP_COUNTER_ENGAGE = GROUP_COUNTER_ENGAGE + 1
        return EN
    endmethod
   
endstruct

//===ITEM PICK STRUCT:
private struct ItemPick
    unit hero
   
    private static thistype DATA
   
    static method onPickItem takes nothing returns boolean
        local thistype this = DATA
        local item it = GetFilterItem()
        local integer i = 0
        if ENABLE_PICK_UP_ITEM_TYPE then    
            loop
                set i = i+1
                if GetItemTypeId(it)==ITEM_TYPE[i] then
                    call IssueTargetOrderById(.hero, SMART, it)
                endif
                exitwhen i >= MAX_ITEM_TYPE
            endloop
        else
            call IssueTargetOrderById(.hero, SMART, it)        
        endif
        set it = null
        return false
    endmethod    

    static method enumerateItem takes nothing returns nothing
        local unit u = GetEnumUnit()
        local thistype this = LoadInteger(HASH, GetHandleId(u), 1+1)
        local real x
        local real y
        local integer index = 0
        local integer count = 0
        loop
            if (UnitItemInSlot(.hero, index) != null) then
                set count = count + 1
            endif
            set index = index + 1
            exitwhen index >= bj_MAX_INVENTORY
        endloop
       
        if GetWidgetLife(.hero) > 0.405 and count < MAX_ITEM_PICKED then
            set x = GetUnitX(.hero)
            set y = GetUnitY(.hero)
            set DATA = this
            call MoveRectTo(R, x, y)
            call EnumItemsInRect(R, function thistype.onPickItem, null)
        elseif GetWidgetLife(.hero) < 0.405 then
            set GROUP_COUNTER_ITEM = GROUP_COUNTER_ITEM - 1
            call GroupRemoveUnit(ITEM_SEARCH_GROUP, .hero)
            call .destroy(this)
            //call BJDebugMsg("ITEM COUNTER "+I2S(GROUP_COUNTER_ITEM))
        endif
        set u = null
    endmethod
   
    static method onenumerateItem takes unit hero returns thistype
        local thistype this = thistype.create()
        local timer t = CreateTimer()
        set .hero = hero
        call GroupAddUnit(ITEM_SEARCH_GROUP, .hero)
        call SaveInteger(HASH, GetHandleId(.hero), 1+1, this)
        set GROUP_COUNTER_ITEM = GROUP_COUNTER_ITEM + 1
        set t = null
        return this
    endmethod

endstruct

//===RETREAT:
private function SearchAllyBase takes nothing returns boolean
    local unit u = GetFilterUnit()
    local boolean b = GetWidgetLife(u) > 0.405 and IsUnitAlly(u, GetOwningPlayer(UNIT_RETREATING)) and IsUnitType(u, UNIT_TYPE_STRUCTURE)
    set u = null
    return b
endfunction
   
private function RetreatForHealth takes nothing returns boolean
    local unit u = GetFilterUnit()
    local boolean b
    if GetRandomInt(1,2)==1 then
        set b = GetUnitTypeId(u)==FOUNTAIN_OF_HEALTH
    else
        set b = not IsUnitEnemy(u, GetOwningPlayer(UNIT_RETREATING)) and GetWidgetLife(u) > 0.405 and IsUnitType(u, UNIT_TYPE_STRUCTURE) or GetUnitTypeId(u)==FOUNTAIN_OF_HEALTH
    endif
    set u = null
    return b
endfunction

private function DamageGroup takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit retreatpoint
    local real maxlife = GetUnitState(u, UNIT_STATE_MAX_LIFE)
    local real x
    local real y
    local real x1
    local real y1
    if GetWidgetLife(u) > 0.405 then
        if GetWidgetLife(u) <= maxlife*MAX_LIFE_PERCENTAGE then
            set x = GetUnitX(u)
            set y = GetUnitY(u)
            set UNIT_RETREATING = u
            if ENABLE_RETREAT_TO_BUILDING then
                call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_RETREAT_TO_BUILDING, function RetreatForHealth)
                set retreatpoint = FirstOfGroup(bj_lastCreatedGroup)
                call IssuePointOrderById(u, MOVE, GetUnitX(retreatpoint), GetUnitY(retreatpoint))
            else
                call GroupEnumUnitsInRange(bj_lastCreatedGroup, x, y, AOE_NEAR_TARGET, function SearchAllyBase)
                set retreatpoint = FirstOfGroup(bj_lastCreatedGroup)
                set x1 = GetUnitX(retreatpoint) + RETREAT_DISTANCE * Cos(GetUnitFacing(u)+180)
                set y1 = GetUnitY(retreatpoint) + RETREAT_DISTANCE * Sin(GetUnitFacing(u)+180)
                call IssuePointOrderById(u, MOVE, x1, y1)
            endif
        endif
    else
        call RemoveSavedInteger(HASH, GetHandleId(u), 200)    
    endif
    set retreatpoint = null
    set u = null
endfunction

//===LEARN SKILL AND PICK UP ITEM: FOR CUSTOM SKILL ONLY
private function PickSkillNow takes nothing returns boolean
    local integer i
    if GetPlayerController(GetTriggerPlayer())==MAP_CONTROL_COMPUTER then
        set i = 0
        loop
            set i = i + 1
            call SelectHeroSkill(GetTriggerUnit(), SKILL[i])        
            exitwhen i >= MAX_CUSTOM_SKILL
        endloop
    endif
    return false
endfunction

//===GROUP LOOPERS:
private function RunItemPick takes nothing returns nothing
    if GROUP_COUNTER_ITEM > 0 then
        call ForGroup(ITEM_SEARCH_GROUP, function ItemPick.enumerateItem)
    endif
endfunction

private function RunAttack takes nothing returns nothing
    if GROUP_COUNTER_ENGAGE > 0 then
        call ForGroup(ENGAGE_GROUP, function Engage.onAttackNow)
    endif
endfunction

//===INITIALIZER:
private function init takes nothing returns nothing
    local trigger t1
    local trigger t2
   
    if ENABLE_PICK_CUSTOM_SKILL then
        set t1 = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t1, EVENT_PLAYER_HERO_LEVEL)
        call TriggerAddCondition(t1, function PickSkillNow)
    endif
   
    if ENABLE_PICK_UP_ITEM then
        set t2 = CreateTrigger()
        call TriggerRegisterTimerEvent(t2, ITEM_PICK_INTERVAL, true)
        call TriggerAddAction(t2, function RunItemPick)
        set R = Rect(-AOE_ITEM_PICK, -AOE_ITEM_PICK, AOE_ITEM_PICK, AOE_ITEM_PICK)
        set ITEM_SEARCH_GROUP = CreateGroup()
    endif
   
    if ENABLE_RETREAT then
        set RETREAT_TRIGGER = CreateTrigger()
        call TriggerAddAction(RETREAT_TRIGGER, function DamageGroup)
        set RETREAT_GROUP = CreateGroup()
    endif
    call SetupSkillsAndItemTypes()
    call TimerStart(ENGAGE_TIMER, ATTACK_INTERVAL, true, function RunAttack)
    set t1 = null
    set t2 = null
endfunction

//===SETUP EVERYTHING:
function SetEngageUnit takes unit u returns nothing
    if not IsUnitType(u, UNIT_TYPE_STRUCTURE) then
        call Engage.onAttackSetup(u)
   
        if ENABLE_PICK_UP_ITEM and GetPlayerController(GetOwningPlayer(u))==MAP_CONTROL_COMPUTER and IsUnitType(u, UNIT_TYPE_HERO) then
            call ItemPick.onenumerateItem(u)
        endif
       
        if ENABLE_RETREAT then
            call GroupAddUnit(RETREAT_GROUP, u)
            if not HaveSavedInteger(HASH, GetHandleId(u), 200) then
                call SaveInteger(HASH, GetHandleId(u), 200, 1)
                call TriggerRegisterUnitEvent(RETREAT_TRIGGER, u, EVENT_UNIT_DAMAGED)
            endif
        endif
    endif
endfunction

endlibrary
Initialize AI
  Events
    Unit - A unit enters (Entire map)
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        ((Triggering unit) is A Hero) Equal to True
        INIAI[(Player number of (Owner of (Triggering unit)))] Equal to 0
  Actions
    Set VariableSet INIAI[(Player number of (Owner of (Triggering unit)))] = 1
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Ninja
      Then - Actions
        Hero - Learn skill for (Triggering unit): Root and attack
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Dark Wizzard
      Then - Actions
        Hero - Learn skill for (Triggering unit): Meteor Shoter
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Shadow Assassin
      Then - Actions
        Hero - Learn skill for (Triggering unit): Darkness
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Warrior
      Then - Actions
        Hero - Learn skill for (Triggering unit): Strength of a Bear
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Orc Raider
      Then - Actions
        Hero - Learn skill for (Triggering unit): Summon Raiders
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Demon
      Then - Actions
        Hero - Learn skill for (Triggering unit): Explode Hit
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Force Archer
      Then - Actions
        Hero - Learn skill for (Triggering unit): Multy Shoter
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Grand Defender
      Then - Actions
        Hero - Learn skill for (Triggering unit): Bouncing Glaives
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Great Knight
      Then - Actions
        Hero - Learn skill for (Triggering unit): Summon Reinforcements
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Mage
      Then - Actions
        Hero - Learn skill for (Triggering unit): Summon Priest
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Queen of Suffering
      Then - Actions
        Hero - Learn skill for (Triggering unit): Enervation
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Raikan
      Then - Actions
        Hero - Learn skill for (Triggering unit): Lightning Aura
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Red Dragon
      Then - Actions
        Hero - Learn skill for (Triggering unit): Baned
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Wizzard
      Then - Actions
        Hero - Learn skill for (Triggering unit): Frost Wave
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Ranger
      Then - Actions
        Hero - Learn skill for (Triggering unit): Target Practice
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Assassin
      Then - Actions
        Hero - Learn skill for (Triggering unit): Blink Strike
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Samurai
      Then - Actions
        Hero - Learn skill for (Triggering unit): Final Attack
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Vampire
      Then - Actions
        Hero - Learn skill for (Triggering unit): Bat Form
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Water Elemental
      Then - Actions
        Hero - Learn skill for (Triggering unit): Attribute Change
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Commander
      Then - Actions
        Hero - Learn skill for (Triggering unit): Sniper Form
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Unit-type of (Triggering unit)) Equal to Goblin Bomber
      Then - Actions
        Hero - Learn skill for (Triggering unit): Land Mine
      Else - Actions
    Hero - Create Boots of Speed and give it to (Triggering unit)
    Hero - Create Ankh of Reincarnation and give it to (Triggering unit)
    Hero - Create Potion of Greater Healing and give it to (Triggering unit)
    Player - Add -550 to (Owner of (Triggering unit)).Current gold
Debug
  Events
    Player - Player 1 (Red) types a chat message containing -debug (stringnoformat) as An exact match
  Conditions
  Actions
    Game - Display to (All players) for 15.00 seconds the text: Debug is enabled, various game information will be displayed.
    Set VariableSet DEBUG = True
Get Weapon 1
  Events
    Unit - A unit enters Region_056 <gen>
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 1000
        AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 0
        (Unit-type of (Triggering unit)) Not equal to Dummy Caster
  Actions
    Set VariableSet AIProcess[(Player number of (Owner of (Triggering unit)))] = (AIProcess[(Player number of (Owner of (Triggering unit)))] + 1)
    Set VariableSet AIGamble = (Random integer number between 1 and 4)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 1
      Then - Actions
        Hero - Create Sword and give it to (Triggering unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 2
      Then - Actions
        Hero - Create Ninjas Blades and give it to (Triggering unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 3
      Then - Actions
        Hero - Create Archer Bow and give it to (Triggering unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 4
      Then - Actions
        Hero - Create Wizzards Wand and give it to (Triggering unit)
      Else - Actions
    Player - Add -1000 to (Owner of (Triggering unit)).Current gold
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DEBUG Equal to True
      Then - Actions
        Game - Display to (All players) for 10.00 seconds the text: === Debug ===
        Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought an item for 1000 gold.)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 1000
      Then - Actions
        Hero - Create Mask of Death and give it to (Triggering unit)
        Set VariableSet AIProcess[(Player number of (Owner of (Triggering unit)))] = (AIProcess[(Player number of (Owner of (Triggering unit)))] + 1)
        Player - Add -1000 to (Owner of (Triggering unit)).Current gold
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DEBUG Equal to True
          Then - Actions
            Game - Display to (All players) for 10.00 seconds the text: === Debug ===
            Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought item lifesteal for 1000 gold.)
          Else - Actions
      Else - Actions
Get Lifesteal
  Events
    Unit - A unit enters Region_056 <gen>
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 1000
        AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 1
        (Unit-type of (Triggering unit)) Not equal to Dummy Caster
  Actions
    Set VariableSet AIProcess[(Player number of (Owner of (Triggering unit)))] = (AIProcess[(Player number of (Owner of (Triggering unit)))] + 1)
    Hero - Create Mask of Death and give it to (Triggering unit)
    Player - Add -1000 to (Owner of (Triggering unit)).Current gold
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DEBUG Equal to True
      Then - Actions
        Game - Display to (All players) for 10.00 seconds the text: === Debug ===
        Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought item lifesteal for 1000 gold.)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 1000
      Then - Actions
        Set VariableSet AIProcess[(Player number of (Owner of (Triggering unit)))] = (AIProcess[(Player number of (Owner of (Triggering unit)))] + 1)
        Player - Add -1000 to (Owner of (Triggering unit)).Current gold
        Set VariableSet AIGamble = (Random integer number between 1 and 4)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 1
          Then - Actions
            Hero - Create Sword and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 2
          Then - Actions
            Hero - Create Ninjas Blades and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 3
          Then - Actions
            Hero - Create Archer Bow and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 4
          Then - Actions
            Hero - Create Wizzards Wand and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DEBUG Equal to True
          Then - Actions
            Game - Display to (All players) for 10.00 seconds the text: === Debug ===
            Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought an item for 1000 gold.)
          Else - Actions
      Else - Actions
Get Weapon 2
  Events
    Unit - A unit enters Region_056 <gen>
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 1000
        AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 2
        (Unit-type of (Triggering unit)) Not equal to Dummy Caster
  Actions
    Set VariableSet AIProcess[(Player number of (Owner of (Triggering unit)))] = (AIProcess[(Player number of (Owner of (Triggering unit)))] + 1)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 5000
      Then - Actions
        Hero - Create Mask of Death and give it to (Triggering unit)
        Player - Add -5000 to (Owner of (Triggering unit)).Current gold
        Set VariableSet AIGamble = (Random integer number between 1 and 5)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 1
          Then - Actions
            Hero - Create Spear Of Great Knights and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 2
          Then - Actions
            Hero - Create Amazon Bow and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 3
          Then - Actions
            Hero - Create Giant Sword and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 4
          Then - Actions
            Hero - Create Assassin Claws and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 5
          Then - Actions
            Hero - Create Mages Wand and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DEBUG Equal to True
          Then - Actions
            Game - Display to (All players) for 10.00 seconds the text: === Debug ===
            Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought an item for 4000 / 5000 gold.)
          Else - Actions
      Else - Actions
        Player - Add -1000 to (Owner of (Triggering unit)).Current gold
        Set VariableSet AIGamble = (Random integer number between 1 and 4)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 1
          Then - Actions
            Hero - Create Sword and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 2
          Then - Actions
            Hero - Create Ninjas Blades and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 3
          Then - Actions
            Hero - Create Archer Bow and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            AIGamble Equal to 4
          Then - Actions
            Hero - Create Wizzards Wand and give it to (Triggering unit)
          Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            DEBUG Equal to True
          Then - Actions
            Game - Display to (All players) for 10.00 seconds the text: === Debug ===
            Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought an item for 1000 gold.)
          Else - Actions
Get Weapon Ultimate 1
  Events
    Unit - A unit enters Region_056 <gen>
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 5000
        (Unit-type of (Triggering unit)) Not equal to Dummy Caster
        Or - Any (Conditions) are true
          Conditions
            AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 3
            AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 4
  Actions
    Set VariableSet AIProcess[(Player number of (Owner of (Triggering unit)))] = (AIProcess[(Player number of (Owner of (Triggering unit)))] + 1)
    Set VariableSet AIGamble = (Random integer number between 1 and 5)
    Item - Remove (Item carried by (Triggering unit) of type Ankh of Reincarnation)
    Item - Remove (Item carried by (Triggering unit) of type Potion of Greater Healing)
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 5
      Then - Actions
        Player - Add 1000 to (Owner of (Triggering unit)).Current gold
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 1
      Then - Actions
        Hero - Create Spear Of Great Knights and give it to (Triggering unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 2
      Then - Actions
        Hero - Create Amazon Bow and give it to (Triggering unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 3
      Then - Actions
        Hero - Create Giant Sword and give it to (Triggering unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 4
      Then - Actions
        Hero - Create Assassin Claws and give it to (Triggering unit)
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIGamble Equal to 5
      Then - Actions
        Hero - Create Mages Wand and give it to (Triggering unit)
      Else - Actions
    Player - Add -5000 to (Owner of (Triggering unit)).Current gold
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DEBUG Equal to True
      Then - Actions
        Game - Display to (All players) for 10.00 seconds the text: === Debug ===
        Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought an item for 5000 gold.)
      Else - Actions
Get Weapon Ultimate 2
  Events
    Unit - A unit enters Region_056 <gen>
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 5000
        (Unit-type of (Triggering unit)) Not equal to Dummy Caster
        Or - Any (Conditions) are true
          Conditions
            AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 5
            AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 6
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 5
      Then - Actions
        Item - Remove (Item carried by (Triggering unit) in slot 2)
        Item - Remove (Item carried by (Triggering unit) in slot 4)
        Player - Add 1000 to (Owner of (Triggering unit)).Current gold
      Else - Actions
    Set VariableSet AIProcess[(Player number of (Owner of (Triggering unit)))] = (AIProcess[(Player number of (Owner of (Triggering unit)))] + 1)
    Hero - Create Spear Of Great Knights and give it to (Triggering unit)
    Player - Add -5000 to (Owner of (Triggering unit)).Current gold
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DEBUG Equal to True
      Then - Actions
        Game - Display to (All players) for 10.00 seconds the text: === Debug ===
        Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought an item for 5000 gold.)
      Else - Actions
Get Weapon Ultimate 3
  Events
    Unit - A unit enters Region_056 <gen>
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        ((Owner of (Triggering unit)) Current gold) Greater than or equal to 5000
        (Unit-type of (Triggering unit)) Not equal to Dummy Caster
        AIProcess[(Player number of (Owner of (Triggering unit)))] Equal to 7
  Actions
    Set VariableSet AIProcess[(Player number of (Owner of (Triggering unit)))] = (AIProcess[(Player number of (Owner of (Triggering unit)))] + 1)
    Item - Remove (Item carried by (Triggering unit) in slot 1)
    Player - Add 150 to (Owner of (Triggering unit)).Current gold
    Hero - Create Spear Of Great Knights and give it to (Triggering unit)
    Player - Add -5000 to (Owner of (Triggering unit)).Current gold
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        DEBUG Equal to True
      Then - Actions
        Game - Display to (All players) for 10.00 seconds the text: === Debug ===
        Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + bought an item for 5000 gold.)
      Else - Actions
Ninja
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Ninja
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
      Then - Actions
        Hero - Learn skill for (Triggering unit): Root and attack
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 9
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Field of Weaknes
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Ninja Speed
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Invisible Speed
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Ultimate Speed
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Ultimate Speed
        Hero - Learn skill for (Triggering unit): Invisible Speed
        Hero - Learn skill for (Triggering unit): Ninja Speed
        Hero - Learn skill for (Triggering unit): Field of Weaknes
        Hero - Learn skill for (Triggering unit): Root and attack
      Else - Actions
Dark Wizzard
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to Dark Wizzard
            (Unit-type of (Triggering unit)) Equal to Dark Phoenix
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Multy Shoter
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Hard Force
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Shadow Shot
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Life absorb
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Meteor Lord
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Meteor Lord
        Hero - Learn skill for (Triggering unit): Life absorb
        Hero - Learn skill for (Triggering unit): Shadow Shot
        Hero - Learn skill for (Triggering unit): Hard Force
        Hero - Learn skill for (Triggering unit): Multy Shoter
      Else - Actions
Shadow Assassin
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Shadow Assassin
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Darkness
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Appear
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Dark Void
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Shadow Vortex
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Haunt
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Haunt
        Hero - Learn skill for (Triggering unit): Shadow Vortex
        Hero - Learn skill for (Triggering unit): Dark Void
        Hero - Learn skill for (Triggering unit): Appear
        Hero - Learn skill for (Triggering unit): Darkness
      Else - Actions
Warrior
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Warrior
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Strength of a Bear
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Slam
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Clap
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): WhirlWind
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Lightning Slash
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Lightning Slash
        Hero - Learn skill for (Triggering unit): WhirlWind
        Hero - Learn skill for (Triggering unit): Clap
        Hero - Learn skill for (Triggering unit): Slam
        Hero - Learn skill for (Triggering unit): Strength of a Bear
      Else - Actions
Demon
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Demon
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Explode Hit
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Mega Punch
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Great Kick
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Room Of Torchering
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Insane Revenge
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Insane Revenge
        Hero - Learn skill for (Triggering unit): Room Of Torchering
        Hero - Learn skill for (Triggering unit): Great Kick
        Hero - Learn skill for (Triggering unit): Mega Punch
        Hero - Learn skill for (Triggering unit): Explode Hit
      Else - Actions
Orc Raider
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        Or - Any (Conditions) are true
          Conditions
            (Unit-type of (Triggering unit)) Equal to Orc Raider
            (Unit-type of (Triggering unit)) Equal to Chaos Orc Raider
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Summon Raiders
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Ensnare
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Enchanted Blades
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Demonic Wave
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Chaos Form
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Chaos Form
        Hero - Learn skill for (Triggering unit): Demonic Wave
        Hero - Learn skill for (Triggering unit): Enchanted Blades
        Hero - Learn skill for (Triggering unit): Ensnare
        Hero - Learn skill for (Triggering unit): Summon Raiders
      Else - Actions
Force Archer
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Force Archer
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Multy Shoter
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Poison Arrows
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Greater Heal
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Gravity Desforation
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Doom Arrow
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Doom Arrow
        Hero - Learn skill for (Triggering unit): Gravity Desforation
        Hero - Learn skill for (Triggering unit): Greater Heal
        Hero - Learn skill for (Triggering unit): Poison Arrows
        Hero - Learn skill for (Triggering unit): Multy Shoter
      Else - Actions
Grand Defender
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Grand Defender
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Bouncing Glaives
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Mana Shield
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Absolute Silence
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Finger of Death
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Spell Deflection
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Spell Deflection
        Hero - Learn skill for (Triggering unit): Finger of Death
        Hero - Learn skill for (Triggering unit): Absolute Silence
        Hero - Learn skill for (Triggering unit): Mana Shield
        Hero - Learn skill for (Triggering unit): Bouncing Glaives
      Else - Actions
Great Knight
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Great Knight
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
      Then - Actions
        Hero - Learn skill for (Triggering unit): Summon Reinforcements
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Evoid
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 9
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Throw Hammer
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Shield of Holynes
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Mortal Spirit
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Mortal Spirit
        Hero - Learn skill for (Triggering unit): Shield of Holynes
        Hero - Learn skill for (Triggering unit): Throw Hammer
        Hero - Learn skill for (Triggering unit): Evoid
        Hero - Learn skill for (Triggering unit): Summon Reinforcements
      Else - Actions
Mage
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Mage
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Summon Priest
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Force Increase
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Will Increase
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Teleportation
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Holy Light
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Holy Light
        Hero - Learn skill for (Triggering unit): Teleportation
        Hero - Learn skill for (Triggering unit): Will Increase
        Hero - Learn skill for (Triggering unit): Force Increase
        Hero - Learn skill for (Triggering unit): Summon Priest
      Else - Actions
Kazarina
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Queen of Suffering
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Enervation
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 9
            (Level of (Triggering unit)) Equal to 18
      Then - Actions
        Hero - Learn skill for (Triggering unit): Mana Freeze
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Field of Enervation
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Avatar of Frost
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Shadow Bolt
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Shadow Bolt
        Hero - Learn skill for (Triggering unit): Avatar of Frost
        Hero - Learn skill for (Triggering unit): Field of Enervation
        Hero - Learn skill for (Triggering unit): Mana Freeze
        Hero - Learn skill for (Triggering unit): Enervation
      Else - Actions
Raikan
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Raikan
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Lightning Aura
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Lightning Charge
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Burning Lightning
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Heavy Lightning
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Great Lightning
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Great Lightning
        Hero - Learn skill for (Triggering unit): Heavy Lightning
        Hero - Learn skill for (Triggering unit): Burning Lightning
        Hero - Learn skill for (Triggering unit): Lightning Charge
        Hero - Learn skill for (Triggering unit): Lightning Aura
      Else - Actions
Red Dragon
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Red Dragon
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Baned
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Flame Strike
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Phoenix Strike
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Summon Ground Volcano
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Flamming Breath
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Flamming Breath
        Hero - Learn skill for (Triggering unit): Summon Ground Volcano
        Hero - Learn skill for (Triggering unit): Phoenix Strike
        Hero - Learn skill for (Triggering unit): Flame Strike
        Hero - Learn skill for (Triggering unit): Baned
      Else - Actions
Jaina
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Wizzard
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Frost Wave
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Blink
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Frost Nova
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Arctic Field
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Eternal Winter
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Eternal Winter
        Hero - Learn skill for (Triggering unit): Arctic Field
        Hero - Learn skill for (Triggering unit): Frost Nova
        Hero - Learn skill for (Triggering unit): Blink
        Hero - Learn skill for (Triggering unit): Frost Wave
      Else - Actions
Ranger
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Ranger
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Target Practice
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Quick Act
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Knocking Arrow
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Marksmanship
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Arrow Armageddon
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Arrow Armageddon
        Hero - Learn skill for (Triggering unit): Marksmanship
        Hero - Learn skill for (Triggering unit): Knocking Arrow
        Hero - Learn skill for (Triggering unit): Quick Act
        Hero - Learn skill for (Triggering unit): Target Practice
      Else - Actions
Assassin
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Assassin
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1
            (Level of (Triggering unit)) Equal to 18
            (Level of (Triggering unit)) Equal to 19
            (Level of (Triggering unit)) Equal to 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Blink Strike
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 2
            (Level of (Triggering unit)) Equal to 4
            (Level of (Triggering unit)) Equal to 15
            (Level of (Triggering unit)) Equal to 17
      Then - Actions
        Hero - Learn skill for (Triggering unit): Empower
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 3
            (Level of (Triggering unit)) Equal to 5
            (Level of (Triggering unit)) Equal to 7
            (Level of (Triggering unit)) Equal to 9
      Then - Actions
        Hero - Learn skill for (Triggering unit): Fan of Knives
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 6
            (Level of (Triggering unit)) Equal to 8
            (Level of (Triggering unit)) Equal to 11
            (Level of (Triggering unit)) Equal to 13
      Then - Actions
        Hero - Learn skill for (Triggering unit): Disappear
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 10
            (Level of (Triggering unit)) Equal to 12
            (Level of (Triggering unit)) Equal to 14
            (Level of (Triggering unit)) Equal to 16
      Then - Actions
        Hero - Learn skill for (Triggering unit): Shadow Attack
      Else - Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        (Level of (Triggering unit)) Greater than 20
      Then - Actions
        Hero - Learn skill for (Triggering unit): Shadow Attack
        Hero - Learn skill for (Triggering unit): Disappear
        Hero - Learn skill for (Triggering unit): Fan of Knives
        Hero - Learn skill for (Triggering unit): Empower
        Hero - Learn skill for (Triggering unit): Blink Strike
      Else - Actions
Ronin
  Events
    Unit - A unit Gains a level
  Conditions
    And - All (Conditions) are true
      Conditions
        ((Owner of (Triggering unit)) controller) Equal to Computer
        (Unit-type of (Triggering unit)) Equal to Samurai
  Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        Or - Any (Conditions) are true
          Conditions
            (Level of (Triggering unit)) Equal to 1