- Joined
- Jun 2, 2009
- Messages
- 1,233
Hello everyone. Last year i was created AI system for my AoS map (moba) and i wanted to share it with you. Before we go into details, let me warn you first. This system created by myself and probably it is not well optimized and includes bugs. Probably. This is what i thinking. In other words, we can improve my system if you want.
Contents. 1) Heroes list 2) Select heroes 3) Set their lanes 4) Telling them leave your lane 5) Teach them to skills 6-) Order them to follow specific route and/or creeps 7) 7-) Order them when they have stucked 8) Order them to base for the heal 9-) Order them to their lanes after heal 10-) Fall back if friendly creeps died by tower 11-) Send them to the base for heal 12-) Fall back if attacked by enemy creep 13-) Fall back if heroes attacks to them 14-) NextTarget, CurrentTarget, Previous Target setup 15) Setting towers 16) Cast spells (aoe) 17) Cast spells (target) 18) Stop casting spells on non-hero units.
1) Heroes list
First of all we have to set Heroes. Here is the example from my map.
2) Select Heroes
We are picking all players from 1 to 12 and if their controller equal to computer, create random hero from the list. There are few conditions in here.
If their player lumber less than or equal to 6, that means they are from team 1. If not, team 2.
Another restrictions in here, if they will select a hero, other AI controlled players and human players are not able to select their heroes and turning on lane decide.
Special thanks to @Antares A for the LoopInt, HeroChoosen[randomInt] system. I am able to prevent AI and players pick their own heroes with this system.
3-) Set their lanes
I assume your map have a 3 lanes just like the moba maps. There are 3 corridors are available. 2 For bottom, 2 for top and 1 for middle.
Before do that, we have a few variiables
First of all we are rolling the dice. We will use 1 for bottom, 2 for top and 3 for middle.
Set PN = (Player number of (Picked player))
Set Roll = (Random integer number between 1 and 3)
If the player will added to their lane, we will set LaneKararBOT(player number of picked player) True
4-) Telling them to leave your lane.
You want to play on middle corridor but one of the bots assigned in there. What will happens now?In my map we have a 120 seconds for the change their corridors. First we have to set integer when we enter the region.
We have a 3 corridors and when we enter the region, AI will check which slot is empty, and we will send the AI to selected corridor.
Your friend went to the middle lane. And you went to the top lane. If we will not increase this number, bot will not detect your friend and tries to goes there.
5-) Teach them to skills
This one was a tricky one. Because there are 2 options in there.
1-) When they have selected and entered the map.
2-) When they leveled up.
I have found great solution for that.
Additionally this trigger works when they have leveled up.
6-) Order them to follow specific route and/or creeps.
Let me tell you what happens here. Every seconds i am picking every unit within HerolarBotDevil (team 1) heroes and checking few conditions.
Booleans are self explanatory.
TempGroup are checking only for one thing. Creeps of the Clan Devil (team 1) within 500 range.
If there are more than 1 creep, i am sending them to their NextTarget (i will talk about Next, current and previous targets later)
If else, that means there are no creeps around the AI do not give order.
Bots can be stucked sometimes and it is hard to detect where they stucked. I was thinking how to detect where they, then i have changed my way of thinking.
Why they are not stuck on the lanes? Because they are detecting creeps. Then i have decided to send them to the lanes. I am simply picking units around the bots and if there are no creeps around, that means it is stucked. I am simply sending them to last tower they have according to their lanes. I will talk about towers later.
This simple trigger sending them to their bases for the regeneration. During the process i am adding them to the Regen unit group.
After their heal is completed, we have to send them again to their lanes.
This one was a difficult to me and i remember i was spend 3 or 4 days because of this. I am checking how many creeps left while attacking tower. And i have just realized, why i am checking tower based.
This trigger picks creeps within 500 range of the "attacked creep by tower" and orders bot to the previous tower.
This periodic trigger simply checks every units within Regen groups and orders them for the base.
When creeps attacks one of your bots, they are falling back for a while. In here i have set another condition in here. I am checking their levels and i am not runing this trigger when their levels are greater than 21.
If enemy heroes attacks them, they are checking for their level difference. If the attacker level is higher than attacked unit, i am simply sending them to their back.
I have created 3 RegionArray triggers for the detect their locations. I am increasing their custom values when they are entered specific regions. There are 20 copies of this trigger for specific regions.
We should tell the bots where they have to fall back. Towers are key structures for this and i am sending them to the last tower for their lanes. My system is simple. When you start the game, i am setting Tower 3 = DevilTowerTop. If Tower 3 destroys, i am setting DevilTowerTop2 as DevilTowerTop.
And here is my worst nightmare of my AI system. Still it is not stable because uhm.. I don't know how to explain this. They are acting like they are canceling orders.
I have created this trigger because bots we're casting spells on creeps. And somehow they are losing their mana, this is why i am adding mana to them.
And i hope it will be useful for anything who need it.
Contents. 1) Heroes list 2) Select heroes 3) Set their lanes 4) Telling them leave your lane 5) Teach them to skills 6-) Order them to follow specific route and/or creeps 7) 7-) Order them when they have stucked 8) Order them to base for the heal 9-) Order them to their lanes after heal 10-) Fall back if friendly creeps died by tower 11-) Send them to the base for heal 12-) Fall back if attacked by enemy creep 13-) Fall back if heroes attacks to them 14-) NextTarget, CurrentTarget, Previous Target setup 15) Setting towers 16) Cast spells (aoe) 17) Cast spells (target) 18) Stop casting spells on non-hero units.
1) Heroes list
First of all we have to set Heroes. Here is the example from my map.
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
Set BotHerolar[1] = Arcane Mistress Lady Violet
-
Set BotHerolar[2] = Elementalist Kalsz Myst
-
Set BotHerolar[3] = Flame Master Zagan Hellfire
-
Set BotHerolar[4] = Monk Chris Battleaid
-
2) Select Heroes
We are picking all players from 1 to 12 and if their controller equal to computer, create random hero from the list. There are few conditions in here.
If their player lumber less than or equal to 6, that means they are from team 1. If not, team 2.
Another restrictions in here, if they will select a hero, other AI controlled players and human players are not able to select their heroes and turning on lane decide.
Special thanks to @Antares A for the LoopInt, HeroChoosen[randomInt] system. I am able to prevent AI and players pick their own heroes with this system.
-
Time - Elapsed game time is 20.00 seconds
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Player((Integer A))) controller) Equal to Computer
-
BotHeroSecti[(Integer A)] Equal to False
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Player number of (Player((Integer A)))) Less than or equal to 6
-
-
Then - Actions
-
For each (Integer LoopInt) from 0 to 1, do (Actions)
-
Loop - Actions
-
Set randomInt = (Random integer number between 1 and 13)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HeroChoosen[randomInt] Equal to False
-
-
Then - Actions
-
Set LoopInt = 1
-
-
Else - Actions
-
Set LoopInt = 0
-
-
-
-
-
Set BotHeroSecti[(Integer A)] = True
-
Unit - Create 1 BotHerolar[randomInt] for (Player((Integer A))) at (Center of MarketUst <gen>) facing Default building facing degrees
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
-
Player - Make BotHerolar[randomInt] Unavailable for training/construction by (Picked player)
-
-
-
Neutral Building - Remove BotHerolar[randomInt] from all marketplaces
-
Set zU_AIHero[(Integer A)] = (Last created unit)
-
Set HeroChoosen[randomInt] = True
-
Unit Group - Add (Last created unit) to HerolarALL
-
Unit Group - Add (Last created unit) to HerolarBotALL
-
Unit Group - Add (Last created unit) to HerolarBotDevil
-
Unit Group - Add (Last created unit) to HerolarDevilAll
-
Player Group - Add (Player((Integer A))) to ClanDevilPlayers
-
Player Group - Add (Player((Integer A))) to ClanDevilBotlar
-
Player Group - Add (Player((Integer A))) to Botlar
-
Set HeroCountDevil = (HeroCountDevil + 1)
-
-
Else - Actions
-
For each (Integer LoopInt) from 0 to 1, do (Actions)
-
Loop - Actions
-
Set randomInt = (Random integer number between 1 and 13)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
HeroChoosen[randomInt] Equal to False
-
-
Then - Actions
-
Set LoopInt = 1
-
-
Else - Actions
-
Set LoopInt = 0
-
-
-
-
-
Set BotHeroSecti[(Integer A)] = True
-
Unit - Create 1 BotHerolar[randomInt] for (Player((Integer A))) at (Center of GameGuideReaper <gen>) facing Default building facing degrees
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
-
Player - Make BotHerolar[randomInt] Unavailable for training/construction by (Picked player)
-
-
-
Set zU_AIHero[(Integer A)] = (Last created unit)
-
Set HeroChoosen[randomInt] = True
-
Unit Group - Add (Last created unit) to HerolarALL
-
Unit Group - Add (Last created unit) to HerolarBotALL
-
Unit Group - Add (Last created unit) to HerolarReaperALL
-
Unit Group - Add (Last created unit) to HerolarBotReaper
-
Player Group - Add (Player((Integer A))) to ClanReaperPlayers
-
Player Group - Add (Player((Integer A))) to ClanReaperBotlar
-
Player Group - Add (Player((Integer A))) to Botlar
-
Set HeroCountReaper = (HeroCountReaper + 1)
-
-
-
-
Else - Actions
-
-
-
-
Wait 3.00 seconds
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Trigger - Run HeroSectirmeDevam <gen> (checking conditions)
-
Wait 102.00 seconds
-
Trigger - Turn off LaneKararTakim1Gelismis <gen>
-
Trigger - Turn off LaneKararTakim2Gelismis <gen>
-
Trigger - Turn off BotToptanGitDevil <gen>
-
Trigger - Turn off BotMiddenGitDevil <gen>
-
Trigger - Turn off BotBottanGitDevil <gen>
-
Trigger - Turn off BotToptanGitReaper <gen>
-
Trigger - Turn off BotMiddenGitReaper <gen>
-
Trigger - Turn off BotBottanGitReaper <gen>
-
3-) Set their lanes
I assume your map have a 3 lanes just like the moba maps. There are 3 corridors are available. 2 For bottom, 2 for top and 1 for middle.
Before do that, we have a few variiables
First of all we are rolling the dice. We will use 1 for bottom, 2 for top and 3 for middle.
Set PN = (Player number of (Picked player))
Set Roll = (Random integer number between 1 and 3)
If the player will added to their lane, we will set LaneKararBOT(player number of picked player) True
4-) Telling them to leave your lane.
You want to play on middle corridor but one of the bots assigned in there. What will happens now?In my map we have a 120 seconds for the change their corridors. First we have to set integer when we enter the region.
We have a 3 corridors and when we enter the region, AI will check which slot is empty, and we will send the AI to selected corridor.
-
Events
-
Unit - A unit enters 3 <gen>
-
-
Conditions
-
((Owner of (Triggering unit)) controller) Equal to User
-
-
Actions
-
Set xDevilSayiTop = (xDevilSayiTop + 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
xDevilSayiMid Not equal to 1
-
-
Then - Actions
-
Set xDevilSayiTop = (xDevilSayiTop - 1)
-
Set xDevilSayiMid = (xDevilSayiMid + 1)
-
Unit Group - Pick every unit in (Random 1 units from zUG_LanerDevilTOP) and do (Actions)
-
Loop - Actions
-
Unit Group - Remove (Picked unit) from zUG_LanerDevilTOP
-
Unit Group - Add (Picked unit) to zUG_LanerDevilMID
-
Unit - Order (Picked unit) to Attack-Move To (Center of DevilOrtaKule)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
xDevilSayiBot Not equal to 2
-
-
Then - Actions
-
Set xDevilSayiTop = (xDevilSayiTop - 1)
-
Set xDevilSayiBot = (xDevilSayiBot + 1)
-
Unit Group - Pick every unit in (Random 1 units from zUG_LanerDevilTOP) and do (Actions)
-
Loop - Actions
-
Unit Group - Remove (Picked unit) from zUG_LanerDevilTOP
-
Unit Group - Add (Picked unit) to zUG_LanerDevilBOT
-
Unit - Order (Picked unit) to Attack-Move To (Center of DevilAltKule)
-
-
-
-
-
-
-
-
TopLaneHooman
-
Events
-
Unit - A unit leaves 3 <gen>
-
-
Conditions
-
((Owner of (Triggering unit)) controller) Equal to User
-
-
Actions
-
Set xDevilSayiTop = (xDevilSayiTop - 1)
-
-
Your friend went to the middle lane. And you went to the top lane. If we will not increase this number, bot will not detect your friend and tries to goes there.
5-) Teach them to skills
This one was a tricky one. Because there are 2 options in there.
1-) When they have selected and entered the map.
2-) When they leveled up.
I have found great solution for that.
-
Events
-
Unit - A unit enters (Entire map)
-
-
Conditions
-
(Unspent skill points of (Triggering unit)) Equal to 1
-
(Hero level of (Triggering unit)) Equal to 1
-
((Triggering unit) is in HerolarBotALL) Equal to True
-
-
Actions
-
Trigger - Run GainLevel <gen> (ignoring conditions)
-
Additionally this trigger works when they have leveled up.
-
Events
-
Unit - A unit Gains a level
-
-
Conditions
-
((Triggering unit) is in HerolarBotALL) Equal to True
-
-
Actions
-
Hero - Learn skill for (Triggering unit): Nether Pulse //
-
Hero - Learn skill for (Triggering unit): Arcane Explosion //
-
6-) Order them to follow specific route and/or creeps.
Let me tell you what happens here. Every seconds i am picking every unit within HerolarBotDevil (team 1) heroes and checking few conditions.
Booleans are self explanatory.
-
Events
-
Time - Every 1.00 seconds of game time
-
Conditions
-
Actions
-
Unit Group - Pick every unit in HerolarBotDevil and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(zU_AIHero[(Integer B)] is in zUG_RegenDevil) Equal to False
-
zBool_AIFallBackCREEP[(Player number of (Owner of (Picked unit)))] Equal to False
-
zBool_AIFallBackHERO[(Player number of (Owner of (Picked unit)))] Equal to False
-
zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] Equal to False
-
And - All (Conditions) are true
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
((Picked unit) is in zUG_TankOFF_DEVIL) Equal to False
-
((Picked unit) is in zUG_TankDEF_DEVIL) Equal to False
-
-
-
-
-
-
-
-
-
-
TempGroup are checking only for one thing. Creeps of the Clan Devil (team 1) within 500 range.
If there are more than 1 creep, i am sending them to their NextTarget (i will talk about Next, current and previous targets later)
If else, that means there are no creeps around the AI do not give order.
-
Then - Actions
-
Set TempPoint = (Position of (Picked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Greater than or equal to 1
-
-
Then - Actions
-
Set TempLoc = (Center of NextTarget[(Player number of (Owner of (Picked unit)))])
-
Unit - Order (Picked unit) to Attack-Move To TempLoc
-
Custom script: call DestroyGroup (udg_TempGroup)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
-
-
Else - Actions
Bots can be stucked sometimes and it is hard to detect where they stucked. I was thinking how to detect where they, then i have changed my way of thinking.
Why they are not stuck on the lanes? Because they are detecting creeps. Then i have decided to send them to the lanes. I am simply picking units around the bots and if there are no creeps around, that means it is stucked. I am simply sending them to last tower they have according to their lanes. I will talk about towers later.
-
HeroTakilincaDevil
-
Events
-
Time - Every 2.00 seconds of game time
-
-
Conditions
-
LordSavasiBasladi Equal to False
-
-
Actions
-
For each (Integer A) from 2 to 6, do (Actions)
-
Loop - Actions
-
Set TempPoint = (Position of zU_AIHero[(Integer A)])
-
Set TempGroup = (Units within 500.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Less than or equal to 0
-
And - All (Conditions) are true
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
zBool_AIFallBackCREEP[(Integer A)] Equal to False
-
zBool_AIFallBackHERO[(Integer A)] Equal to False
-
zBool_AIFallBackTOWER[(Integer A)] Equal to False
-
(zU_AIHero[(Integer A)] is in zUG_RegenDevil) Equal to False
-
(zU_AIHero[(Integer A)] is in zUG_TankOFF_DEVIL) Equal to False
-
(zU_AIHero[(Integer A)] is in zUG_TankDEF_DEVIL) Equal to False
-
-
-
-
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(zU_AIHero[(Integer A)] is in zUG_LanerDevilTOP) Equal to True
-
-
Then - Actions
-
Unit - Order zU_AIHero[(Integer A)] to Attack-Move To (Center of DevilUstKule)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(zU_AIHero[(Integer A)] is in zUG_LanerDevilMID) Equal to True
-
-
Then - Actions
-
Unit - Order zU_AIHero[(Integer A)] to Attack-Move To (Center of DevilOrtaKule)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(zU_AIHero[(Integer A)] is in zUG_LanerDevilBOT) Equal to True
-
-
Then - Actions
-
Unit - Order zU_AIHero[(Integer A)] to Attack-Move To (Center of DevilAltKule)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
-
-
-
-
-
-
Else - Actions
-
-
-
-
-
This simple trigger sending them to their bases for the regeneration. During the process i am adding them to the Regen unit group.
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
((Attacked unit) is A Hero) Equal to True
-
(Percentage life of zU_AIHero[(Player number of (Owner of (Attacked unit)))]) Less than or equal to 30.00
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Player number of (Owner of zU_AIHero[(Player number of (Owner of (Attacked unit)))])) Less than or equal to 6
-
-
Then - Actions
-
Unit Group - Add zU_AIHero[(Player number of (Owner of (Attacked unit)))] to zUG_RegenDevil
-
Unit Group - Add zU_AIHero[(Player number of (Owner of (Attacked unit)))] to zUG_RegenALL
-
-
Else - Actions
-
Unit Group - Add zU_AIHero[(Player number of (Owner of (Attacked unit)))] to zUG_RegenALL
-
Unit Group - Add zU_AIHero[(Player number of (Owner of (Attacked unit)))] to zUG_RegenReaper
-
-
-
After their heal is completed, we have to send them again to their lanes.
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in (Units in ClanDevilBaseIcerisi <gen> matching (((Integer((Percentage life of (Matching unit)))) Greater than or equal to 95) and (((Matching unit) is in HerolarBotALL) Equal to True))) and do (Actions)
-
Loop - Actions
-
Unit Group - Remove (Picked unit) from zUG_RegenDevil
-
Unit Group - Remove (Picked unit) from zUG_RegenALL
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_LanerDevilTOP) Equal to True
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of DevilUstKule)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_LanerDevilBOT) Equal to True
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of DevilAltKule)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_LanerDevilMID) Equal to True
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of DevilOrtaKule)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_TankDEF_DEVIL) Equal to True
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of DevilAltKule)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_TankOFF_DEVIL) Equal to True
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of DevilsTankSpawn <gen>)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_LanerDevilDEFANS) Equal to True
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of DevilBase <gen>)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_LanerReaperDEFANS) Equal to True
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of ReaperBase <gen>)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
LordSavasiBasladi Equal to True
-
-
Then - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Center of ReaperBase <gen>)
-
-
Else - Actions
-
-
-
-
This one was a difficult to me and i remember i was spend 3 or 4 days because of this. I am checking how many creeps left while attacking tower. And i have just realized, why i am checking tower based.
This trigger picks creeps within 500 range of the "attacked creep by tower" and orders bot to the previous tower.
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
zBool_AIFallBackTOWER[(Player number of (Owner of (Attacked unit)))] Equal to False
-
-
Actions
-
-------- Top --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Attacking unit) Equal to Soul Tower Level 1 0037 <gen>
-
-
Then - Actions
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Less than or equal to 2
-
-
Then - Actions
-
Custom script: call DestroyGroup (udg_TempGroup)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) is in HerolarBotDevil) Equal to True) and (((Matching unit) is in zUG_TankOFF_DEVIL) Equal to False)))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
Set zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] = True
-
Unit - Order (Picked unit) to Move To (Center of DevilUstKule)
-
Unit Group - Remove (Picked unit) from zUG_DALANLAR_DEVIL
-
Countdown Timer - Start BotKuledenKacmaTimer[(Player number of (Owner of (Picked unit)))] as a One-shot timer that will expire in 2.00 seconds
-
-
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
-
-
Else - Actions
-
-------- Reaper Tower 2, 3 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Attacked unit) is in zUG_CreepsDevil) Equal to True
-
Or - Any (Conditions) are true
-
Conditions
-
(Attacking unit) Equal to Soul Tower Level 2 0036 <gen>
-
(Attacking unit) Equal to Soul Tower Level 3 0027 <gen>
-
-
-
-
Then - Actions
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Less than or equal to 2
-
-
Then - Actions
-
Custom script: call DestroyGroup (udg_TempGroup)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) is in HerolarBotDevil) Equal to True) and (((Matching unit) is in zUG_TankOFF_DEVIL) Equal to False)))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
Set zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] = True
-
Unit - Order (Picked unit) to Move To (Center of DevilUstKule)
-
Unit Group - Remove (Picked unit) from zUG_DALANLAR_DEVIL
-
Countdown Timer - Start BotKuledenKacmaTimer[(Player number of (Owner of (Picked unit)))] as a One-shot timer that will expire in 2.00 seconds
-
-
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
-
-
Else - Actions
-
-
-
-
-------- Bottom --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Attacking unit) Equal to Soul Tower Level 1 0038 <gen>
-
((Attacked unit) is in zUG_CreepsDevil) Equal to True
-
-
Then - Actions
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Less than or equal to 2
-
-
Then - Actions
-
Custom script: call DestroyGroup (udg_TempGroup)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) is in HerolarBotDevil) Equal to True) and (((Matching unit) is in zUG_TankOFF_DEVIL) Equal to False)))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
Set zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] = True
-
Unit - Order (Picked unit) to Move To (Center of DevilAltKule)
-
Unit Group - Remove (Picked unit) from zUG_DALANLAR_DEVIL
-
Countdown Timer - Start BotKuledenKacmaTimer[(Player number of (Owner of (Picked unit)))] as a One-shot timer that will expire in 2.00 seconds
-
-
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
-
-
Else - Actions
-
-------- Reaper Tower 2, 3 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Attacked unit) is in zUG_CreepsDevil) Equal to True
-
Or - Any (Conditions) are true
-
Conditions
-
(Attacking unit) Equal to Soul Tower Level 2 0034 <gen>
-
(Attacking unit) Equal to Soul Tower Level 3 0029 <gen>
-
-
-
-
Then - Actions
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Less than or equal to 2
-
-
Then - Actions
-
Custom script: call DestroyGroup (udg_TempGroup)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) is in HerolarBotDevil) Equal to True) and (((Matching unit) is in zUG_TankOFF_DEVIL) Equal to False)))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
Set zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] = True
-
Unit - Order (Picked unit) to Move To (Center of DevilAltKule)
-
Unit Group - Remove (Picked unit) from zUG_DALANLAR_DEVIL
-
Countdown Timer - Start BotKuledenKacmaTimer[(Player number of (Owner of (Picked unit)))] as a One-shot timer that will expire in 2.00 seconds
-
-
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
-
-
Else - Actions
-
-
-
-
-------- Middle --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Attacked unit) is in zUG_CreepsDevil) Equal to True
-
Or - Any (Conditions) are true
-
Conditions
-
(Attacking unit) Equal to Soul Tower Level 2 0035 <gen>
-
(Attacking unit) Equal to Soul Tower Level 3 0028 <gen>
-
-
-
-
Then - Actions
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Less than or equal to 2
-
-
Then - Actions
-
Custom script: call DestroyGroup (udg_TempGroup)
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Set TempPoint = (Position of (Attacked unit))
-
Set TempGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) is in HerolarBotDevil) Equal to True) and (((Matching unit) is in zUG_TankOFF_DEVIL) Equal to False)))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
Set zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] = True
-
Unit - Order (Picked unit) to Move To (Center of DevilOrtaKule)
-
Unit Group - Remove (Picked unit) from zUG_DALANLAR_DEVIL
-
Countdown Timer - Start BotKuledenKacmaTimer[(Player number of (Owner of (Picked unit)))] as a One-shot timer that will expire in 2.00 seconds
-
-
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
-
-
Else - Actions
-
-
This periodic trigger simply checks every units within Regen groups and orders them for the base.
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in zUG_RegenReaper and do (Actions)
-
Loop - Actions
-
Unit Group - Order zUG_RegenReaper to Move To (Center of PreviousTarget[(Player number of (Owner of (Picked unit)))])
-
-
-
Unit Group - Pick every unit in zUG_RegenDevil and do (Actions)
-
Loop - Actions
-
Unit Group - Order zUG_RegenDevil to Move To (Center of PreviousTarget[(Player number of (Owner of (Picked unit)))])
-
-
-
When creeps attacks one of your bots, they are falling back for a while. In here i have set another condition in here. I am checking their levels and i am not runing this trigger when their levels are greater than 21.
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
((Attacked unit) is in zUG_RegenALL) Equal to False
-
((Attacked unit) is in HerolarBotDevil) Equal to True
-
((Attacking unit) is in zUG_CreepsReaper) Equal to True
-
zBool_AIFallBackCREEP[(Player number of (Owner of (Attacked unit)))] Equal to False
-
(Level of (Attacked unit)) Less than or equal to 21
-
-
Actions
-
Set zBool_AIFallBackCREEP[(Player number of (Owner of (Attacked unit)))] = True
-
Set TempPoint = ((Position of (Attacked unit)) offset by 375.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])) - 0.00) degrees)
-
Unit - Order (Attacked unit) to Move To TempPoint
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Countdown Timer - Start CreeptenKacmaBittiSeysi[(Player number of (Owner of (Attacked unit)))] as a One-shot timer that will expire in 5.00 seconds
-
Wait (2.00 - ((Real((Level of (Attacked unit)))) x 0.10)) seconds
-
Set TempGroup = (Units within 500.00 of (Position of (Attacked unit)) matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Greater than or equal to 1
-
-
Then - Actions
-
Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[(Player number of (Owner of (Attacked unit)))])
-
-
Else - Actions
-
Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of (Attacked unit)))])
-
-
-
-
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
And there are 10 times for 10 slots just like this.
-
Timer2Kacma
-
Events
-
Time - CreeptenKacmaBittiSeysi[2] expires
-
-
Conditions
-
Actions
-
Set zBool_AIFallBackCREEP[2] = False
-
-
If enemy heroes attacks them, they are checking for their level difference. If the attacker level is higher than attacked unit, i am simply sending them to their back.
-
Events
-
Unit - A unit Is attacked
-
Conditions
-
((Attacking unit) is in ReaperHerolariPlayer) Equal to True
-
(Attacked unit) Equal to zU_AIHero[2]
-
zBool_AIFallBackHERO[2] Equal to False
-
((Attacked unit) is in zUG_RegenDevil) Equal to False
-
((Attacked unit) is in CHANNEL) Equal to False
-
-
Actions
-
Set xINT_TEMP[2] = (Level of (Attacking unit))
-
-------- 15 --------
-
Set xINT_TEMP2[2] = (Level of (Attacked unit))
-
-------- 10 --------
-
Set xINT_TEMP3[2] = (xINT_TEMP[2] - xINT_TEMP2[2])
-
-------- 5 --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
xINT_TEMP3[2] Greater than or equal to 3
-
-
Then - Actions
-
Set zBool_AIFallBackHERO[2] = True
-
Set TempPoint = ((Position of (Attacked unit)) offset by 800.00 towards ((Angle from (Position of (Attacking unit)) to (Center of PreviousTarget[2])) - 0.00) degrees)
-
Unit - Order (Attacked unit) to Move To TempPoint
-
Custom script: call RemoveLocation (udg_TempPoint)
-
Wait 4.00 seconds
-
Set zBool_AIFallBackHERO[2] = False
-
Set TempGroup = (Units within 800.00 of (Position of (Attacked unit)) matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup) Greater than or equal to 1
-
-
Then - Actions
-
Unit - Order zU_AIHero[(Player number of (Owner of (Attacked unit)))] to Attack-Move To (Center of NextTarget[2])
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
Else - Actions
-
Custom script: call DestroyGroup (udg_TempGroup)
-
-
-
-
-
-
Else - Actions
-
-
-
I have created 3 RegionArray triggers for the detect their locations. I am increasing their custom values when they are entered specific regions. There are 20 copies of this trigger for specific regions.
-
Events
-
Unit - A unit enters 0 <gen>
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Triggering unit) is in HerolarBotDevil) Equal to True
-
-
Then - Actions
-
Set CurrentTarget[(Player number of (Owner of (Triggering unit)))] = 0 <gen>
-
Set NextTarget[(Player number of (Owner of (Triggering unit)))] = 1 <gen>
-
Set PreviousTarget[(Player number of (Owner of (Triggering unit)))] = GameGuideDevil <gen>
-
Unit - Set the custom value of (Entering unit) to 27
-
Set i_customvalue[(Player number of (Owner of (Triggering unit)))] = 1
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Triggering unit) is in HerolarBotReaper) Equal to True
-
-
Then - Actions
-
Set CurrentTarget[(Player number of (Owner of (Triggering unit)))] = 0 <gen>
-
Set NextTarget[(Player number of (Owner of (Triggering unit)))] = GameGuideDevil <gen>
-
Set PreviousTarget[(Player number of (Owner of (Triggering unit)))] = DevilSpawn2 <gen>
-
Unit - Set the custom value of (Entering unit) to 27
-
Set i_customvalue[(Player number of (Owner of (Triggering unit)))] = 1
-
-
Else - Actions
-
-
-
-
-
We should tell the bots where they have to fall back. Towers are key structures for this and i am sending them to the last tower for their lanes. My system is simple. When you start the game, i am setting Tower 3 = DevilTowerTop. If Tower 3 destroys, i am setting DevilTowerTop2 as DevilTowerTop.
-
Events
-
Map initialization
-
Conditions
-
Actions
-
Set ClanDevilPlayer = Player 1 (Red)
-
Set ClanReaperPlayer = Player 7 (Green)
-
Set DevilOrtaKule = 22 <gen>
-
Set DevilAltKule = DevilSol <gen>
-
Set DevilUstKule = DevilSag <gen>
-
Set ReaperOrtaKule = 24 <gen>
-
Set ReaperUstKule = 5 <gen>
-
Set ReaperAltKule = 15 <gen>
-
Set DevilTowerCount = 8
-
Set DevilTowerCountBot = 3
-
Set DevilTowerCountMid = 2
-
Set DevilTowerCountTop = 3
-
Set ReaperTowerCount = 8
-
Set ReaperTowerCountBot = 3
-
Set ReaperTowerCountMid = 2
-
Set ReaperTowerCountTop = 3
-
-
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 1 0043 <gen>
-
-
Then - Actions
-
Set DevilUstKule = 2 <gen>
-
Set DevilTowerCountTop = (DevilTowerCountTop - 1)
-
Set DevilTowerCount = (DevilTowerCount - 1)
-
Set zU_DevilUstKule = Fire Tower Level 2 0042 <gen>
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 2 0042 <gen>
-
-
Then - Actions
-
Set DevilUstKule = 1 <gen>
-
Set DevilTowerCountTop = (DevilTowerCountTop - 1)
-
Set DevilTowerCount = (DevilTowerCount - 1)
-
Set zU_DevilUstKule = Fire Tower Level 3 0026 <gen>
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 3 0026 <gen>
-
-
Then - Actions
-
Set zU_DevilUstKule = Slayer Devil 0124 <gen>
-
Set DevilUstKule = 1 <gen>
-
Set DevilTowerCountTop = (DevilTowerCountTop - 1)
-
Set DevilTowerCount = (DevilTowerCount - 1)
-
-
Else - Actions
-
-
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 1 0040 <gen>
-
-
Then - Actions
-
Set zU_DevilUstKule = Fire Tower Level 2 0039 <gen>
-
Set DevilAltKule = 12 <gen>
-
Set DevilTowerCountBot = (DevilTowerCountBot - 1)
-
Set DevilTowerCount = (DevilTowerCount - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 2 0039 <gen>
-
-
Then - Actions
-
Set zU_DevilUstKule = Fire Tower Level 3 0024 <gen>
-
Set DevilAltKule = 11 <gen>
-
Set DevilTowerCountBot = (DevilTowerCountBot - 1)
-
Set DevilTowerCount = (DevilTowerCount - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 3 0024 <gen>
-
-
Then - Actions
-
Set zU_DevilUstKule = Slayer Devil 0124 <gen>
-
Set DevilAltKule = 11 <gen>
-
Set DevilTowerCountBot = (DevilTowerCountBot - 1)
-
Set DevilTowerCount = (DevilTowerCount - 1)
-
-
Else - Actions
-
-
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 2 0041 <gen>
-
-
Then - Actions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 2 0039 <gen>
-
-
Then - Actions
-
Set zU_DevilUstKule = Fire Tower Level 3 0025 <gen>
-
Set DevilOrtaKule = 21 <gen>
-
Set DevilTowerCountMid = (DevilTowerCountMid - 1)
-
Set DevilTowerCount = (DevilTowerCount - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Fire Tower Level 3 0024 <gen>
-
-
Then - Actions
-
Set zU_DevilUstKule = Slayer Devil 0124 <gen>
-
Set DevilOrtaKule = DevilSpawn2 <gen>
-
Set DevilTowerCountMid = (DevilTowerCountMid - 1)
-
Set DevilTowerCount = (DevilTowerCount - 1)
-
-
Else - Actions
-
-
-
-
-
-
-------- reaper top --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Soul Tower Level 1 0037 <gen>
-
-
Then - Actions
-
Set zU_ReaperUstKule = Soul Tower Level 2 0036 <gen>
-
Set ReaperUstKule = 6 <gen>
-
Set ReaperTowerCountTop = (ReaperTowerCountTop - 1)
-
Set ReaperTowerCount = (ReaperTowerCount - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Soul Tower Level 2 0036 <gen>
-
-
Then - Actions
-
Set zU_ReaperUstKule = Soul Tower Level 3 0027 <gen>
-
Set ReaperUstKule = 7 <gen>
-
Set ReaperTowerCountTop = (ReaperTowerCountTop - 1)
-
Set ReaperTowerCount = (ReaperTowerCount - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Soul Tower Level 3 0027 <gen>
-
-
Then - Actions
-
Set zU_ReaperUstKule = Slayer Reaper 0054 <gen>
-
Set ReaperUstKule = ReaperSpawn3 <gen>
-
Set ReaperTowerCountTop = (ReaperTowerCountTop - 1)
-
Set ReaperTowerCount = (ReaperTowerCount - 1)
-
-
Else - Actions
-
-
-
-
-
-
-------- reaper bot --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Soul Tower Level 1 0038 <gen>
-
-
Then - Actions
-
Set zU_ReaperUstKule = Soul Tower Level 2 0034 <gen>
-
Set ReaperAltKule = 16 <gen>
-
Set ReaperTowerCountBot = (ReaperTowerCountBot - 1)
-
Set ReaperTowerCount = (ReaperTowerCount - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Soul Tower Level 2 0034 <gen>
-
-
Then - Actions
-
Set zU_ReaperUstKule = Soul Tower Level 3 0029 <gen>
-
Set ReaperAltKule = 17 <gen>
-
Set ReaperTowerCountBot = (ReaperTowerCountBot - 1)
-
Set ReaperTowerCount = (ReaperTowerCount - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Soul Tower Level 3 0029 <gen>
-
-
Then - Actions
-
Set zU_ReaperUstKule = Slayer Reaper 0054 <gen>
-
Set ReaperAltKule = 17 <gen>
-
Set ReaperTowerCountBot = (ReaperTowerCountBot - 1)
-
Set ReaperTowerCount = (ReaperTowerCount - 1)
-
-
Else - Actions
-
-
-
-
-
-
-------- reaper mid --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Soul Tower Level 2 0035 <gen>
-
-
Then - Actions
-
Set zU_ReaperOrtaKule = Soul Tower Level 3 0028 <gen>
-
Set ReaperOrtaKule = 25 <gen>
-
Set ReaperTowerCountMid = (ReaperTowerCountMid - 1)
-
Set ReaperTowerCount = (ReaperTowerCount - 1)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Dying unit) Equal to Soul Tower Level 3 0028 <gen>
-
-
Then - Actions
-
Set zU_ReaperOrtaKule = Slayer Reaper 0054 <gen>
-
Set ReaperOrtaKule = ReaperSpawn2 <gen>
-
Set ReaperTowerCountMid = (ReaperTowerCountMid - 1)
-
Set ReaperTowerCount = (ReaperTowerCount - 1)
-
-
Else - Actions
-
-
-
-
And here is my worst nightmare of my AI system. Still it is not stable because uhm.. I don't know how to explain this. They are acting like they are canceling orders.
-
SkillsAoEn
-
Events
-
Time - Every 1.10 seconds of game time
-
-
Conditions
-
Actions
-
-------- First of all, i am picking every hero controlled by AI with few conditions. --------
-
Unit Group - Pick every unit in HerolarBotALL and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_RegenALL) Equal to False
-
zBool_AIFallBackCREEP[(Player number of (Owner of (Picked unit)))] Equal to False
-
zBool_AIFallBackHERO[(Player number of (Owner of (Picked unit)))] Equal to False
-
zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] Equal to False
-
-
Then - Actions
-
-------- Then i am creating TempPoint, TempGroups and TempBotCasters --------
-
Set TempBotPointCaster = (Picked unit)
-
Set TempPointCaster = (Position of (Picked unit))
-
-------- There is a HUGE FLAW in here. I think they can try to cast spells from thousands range away enemies. And they stop casting because they cannot reach them. --------
-
-------- I am not sure about it but is that a correct picking? --------
-
Set TempGroupEnemy = (Units within 1000.00 of TempPointCaster matching ((((Matching unit) is in HerolarALL) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and (((Matching unit) is alive) Equal to True))))
-
Set TempPointTarget = (Position of (Random unit from TempGroupEnemy))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroupEnemy) Greater than or equal to 1
-
-
Then - Actions
-
Unit Group - Add (Picked unit) to TempCastGroup
-
Unit - Order (Picked unit) to Undead Dreadlord - Carrion Swarm TempPointTarget
-
Unit - Order (Picked unit) to Human Archmage - Blizzard TempPointTarget
-
Unit - Order (Picked unit) to Neutral Pit Lord - Rain Of Fire TempPointTarget
-
Unit - Order (Picked unit) to Undead Dreadlord - Inferno TempPointTarget
-
Unit - Order (Picked unit) to Orc Tauren Chieftain - Shockwave TempPointTarget
-
-------- This trigger picks CreepsDevil around the Hero. Because after it casts spells, it has go to next or previous target --------
-
-------- If player number lesser than or equal to 6 that means CreepsDevil are allies. (Player 1 red ally with 2-3-4-5-6) --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Player number of (Owner of (Picked unit))) Less than or equal to 6
-
-
Then - Actions
-
-------- I am creating TempGroup2 that includes CreepsDevil (allies of picked unit) --------
-
Set TempGroupNew2 = (Units within 500.00 of (Position of (Picked unit)) matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
-------- Don't worry, i am removing dying CreepsDevil from CreepsDevil unit group --------
-
Unit Group - Pick every unit in TempGroupNew2 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroupNew2) Greater than or equal to 1
-
-
Then - Actions
-
-------- There are still 1 or more creeps available around the picked unit. Go for the NextTarget --------
-
Unit - Order TempBotTargetCaster to Attack-Move To (Center of CurrentTarget[(Player number of (Owner of TempBotPointCaster))])
-
-
Else - Actions
-
-------- There are no creeps. Fall back to the previous target. --------
-
Unit - Order TempBotTargetCaster to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of TempBotPointCaster))])
-
-
-
-
-
Custom script: call DestroyGroup (udg_TempGroupNew2)
-
-
Else - Actions
-
Set TempGroupNew2 = (Units within 500.00 of (Position of (Picked unit)) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
-
-------- Else. That means player number of picked player NOT lesser or equal to 6. That means picked unit ally with CreepsReaper (player 7 allied with 8-9-10-11-12) --------
-
Unit Group - Pick every unit in TempGroupNew2 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroupNew2) Greater than or equal to 1
-
-
Then - Actions
-
Unit - Order TempBotTargetCaster to Attack-Move To (Center of CurrentTarget[(Player number of (Owner of TempBotTargetCaster))])
-
-
Else - Actions
-
Unit - Order TempBotTargetCaster to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of TempBotTargetCaster))])
-
-
-
-
-
Custom script: call DestroyGroup (udg_TempGroupNew2)
-
-
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_TempPointCaster)
-
Custom script: call RemoveLocation (udg_TempPointTarget)
-
Custom script: call DestroyGroup (udg_TempGroupEnemy)
-
Set TempBotPointCaster = No unit
-
-
-
Custom script: call RemoveLocation (udg_TempPointCaster)
-
Custom script: call RemoveLocation (udg_TempPointTarget)
-
Custom script: call DestroyGroup (udg_TempGroupEnemy)
-
Set TempBotPointCaster = No unit
-
Unit Group - Remove all units from TempCastGroup
-
-
Else - Actions
-
-
-
-
-
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in HerolarBotALL and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is in zUG_RegenALL) Equal to False
-
zBool_AIFallBackCREEP[(Player number of (Owner of (Picked unit)))] Equal to False
-
zBool_AIFallBackHERO[(Player number of (Owner of (Picked unit)))] Equal to False
-
zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] Equal to False
-
-
Then - Actions
-
Set TempGroupT = (Units within 1000.00 of (Position of (Picked unit)) matching ((((Matching unit) is in HerolarALL) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True) and (((Matching unit) is alive) Equal to True))))
-
Set TempUnit = (Random unit from TempGroupT)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroupT) Greater than or equal to 1
-
-
Then - Actions
-
Unit Group - Add (Picked unit) to TempCastGroup
-
Unit - Order (Picked unit) to Human Sorceress - Polymorph TempUnit
-
Unit - Order (Picked unit) to Orc Shadow Hunter - Hex TempUnit
-
Unit - Order (Picked unit) to Orc Far Seer - Chain Lightning TempUnit
-
Unit - Order (Picked unit) to Neutral - Firebolt TempUnit
-
Unit - Order (Picked unit) to Undead Lich - Frost Nova TempUnit
-
Unit - Order (Picked unit) to Undead Necromancer - Cripple TempUnit
-
Unit - Order (Picked unit) to Neutral Naga Sea Witch - Forked Lightning TempUnit
-
Unit - Order (Picked unit) to Special Archimonde - Finger Of Death TempUnit
-
Unit - Order (Picked unit) to Neutral Fire Lord - Soul Burn TempUnit
-
Unit - Order (Picked unit) to Neutral Naga Sea Witch - Forked Lightning TempUnit
-
Unit - Order (Picked unit) to Special Archimonde - Finger Of Death TempUnit
-
Unit - Order (Picked unit) to Neutral - Firebolt TempUnit
-
Unit - Order (Picked unit) to Human Sorceress - Polymorph TempUnit
-
Unit - Order (Picked unit) to Orc Raider - Ensnare TempUnit
-
Game - Display to DebugBotSkills for 1.00 seconds the text: ((Name of (Owner of (Picked unit))) + ( >>> + (Name of (Owner of TempUnit))))
-
-------- This trigger picks CreepsDevil around the Hero. Because after it casts spells, it has go to next or previous target --------
-
-------- If player number lesser than or equal to 6 that means CreepsDevil are allies. (Player 1 red ally with 2-3-4-5-6) --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Player number of (Owner of (Picked unit))) Less than or equal to 6
-
-
Then - Actions
-
-------- I am creating TempGroup2 that includes CreepsDevil (allies of picked unit) --------
-
Set TempGroup2 = (Units within 500.00 of (Position of (Picked unit)) matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
-
-------- Don't worry, i am removing dying CreepsDevil from CreepsDevil unit group --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup2) Greater than or equal to 1
-
-
Then - Actions
-
-------- There are still 1 or more creeps available around the picked unit. Go for the NextTarget --------
-
Unit - Order TempBotTargetCaster to Attack-Move To (Center of CurrentTarget[(Player number of (Owner of TempBotTargetCaster))])
-
-
Else - Actions
-
-------- There are no creeps. Fall back to the previous target. --------
-
Unit - Order TempBotTargetCaster to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of TempBotTargetCaster))])
-
-
-
Custom script: call DestroyGroup (udg_TempGroup2)
-
-
Else - Actions
-
Set TempGroup2 = (Units within 500.00 of (Position of (Picked unit)) matching (((Matching unit) is in zUG_CreepsReaper) Equal to True))
-
-------- Else. That means player number of picked player NOT lesser or equal to 6. That means picked unit ally with CreepsReaper (player 7 allied with 8-9-10-11-12) --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in TempGroup2) Greater than or equal to 1
-
-
Then - Actions
-
Unit - Order TempBotTargetCaster to Attack-Move To (Center of CurrentTarget[(Player number of (Owner of TempBotTargetCaster))])
-
-
Else - Actions
-
Unit - Order TempBotTargetCaster to Attack-Move To (Center of PreviousTarget[(Player number of (Owner of TempBotTargetCaster))])
-
-
-
Custom script: call DestroyGroup (udg_TempGroup2)
-
-
-
-
Else - Actions
-
Custom script: call RemoveLocation (udg_TempPointCasterTarget)
-
Custom script: call DestroyGroup (udg_TempGroupT)
-
Set TempBotTargetCaster = No unit
-
Set TempUnit = No unit
-
-
-
Set TempBotTargetCaster = No unit
-
Set TempUnit = No unit
-
Unit Group - Remove all units from TempCastGroup
-
-
Else - Actions
-
-
-
-
Unit Group - Remove all units from TempCastGroup
-
I have created this trigger because bots we're casting spells on creeps. And somehow they are losing their mana, this is why i am adding mana to them.
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
((Casting unit) is in HerolarBotALL) Equal to True
-
((Unit-type of (Target unit of ability being cast)) is A Hero) Equal to False
-
((Casting unit) belongs to an ally of (Owner of (Target unit of ability being cast))) Equal to False
-
-
Actions
-
Unit - Order (Casting unit) to Stop
-
Wait 0.10 seconds
-
Unit - Order (Casting unit) to Attack-Move To (Center of CurrentTarget[(Player number of (Owner of (Casting unit)))])
-
Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 100.00)
-
And i hope it will be useful for anything who need it.