-
Notifications
You must be signed in to change notification settings - Fork 0
/
Alliance.ai
222 lines (194 loc) · 7.95 KB
/
Alliance.ai
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
function BuildingStrategy takes nothing returns nothing
// Tier 1 Buildings
call SetReplacements(1, 2, 3)
call SetBuildUnit(1, ALLIANCE_TIER_1)
call SetBuildUnit(WORKERS_COUNT_START, ALLIANCE_WORKER_BASE)
call SetBuildUnit(2, ALLIANCE_CITIZEN_MALE)
call BuildingStrategyStandardTier1()
call SetBuildUnit(2, ALLIANCE_HOUSING)
call SetBuildUnit(1, ALLIANCE_MILL)
call SetBuildUnit(1, ALLIANCE_BLACKSMITH)
call SetBuildUnit(3, ALLIANCE_FARM)
call SetBuildUnit(1, ALLIANCE_BARRACKS)
call SetBuildUnit(1, ALLIANCE_CHURCH)
call SetBuildUnit(1, ALLIANCE_SHOP)
// Tier 2 buildings
call SetBuildUnit(1, ALLIANCE_TIER_2)
call SetBuildUnit(1, ALLIANCE_MAGE_TOWER)
call SetBuildUnit(1, ALLIANCE_GNOMISH_INVENTOR)
call SetBuildUnit(1, ALLIANCE_STABLES)
call SetBuildUnit(4, ALLIANCE_FARM)
call SetBuildUnit(2, ALLIANCE_CITIZEN_FEMALE)
call SetBuildUnit(2, ALLIANCE_PET)
call SetBuildUnit(2, ALLIANCE_CHILD)
call SetBuildUpgr(1, UPG_ALLIANCE_UPGRADE_ARROWS)
call SetBuildUpgr(1, UPG_ALLIANCE_UPGRADE_BALLISTAS)
call SetBuildUpgr(1, UPG_ALLIANCE_UPGRADE_SHIELDS)
call SetBuildUpgr(1, UPG_ALLIANCE_UPGRADE_SWORDS)
// Tier 3 buildings
call SetBuildUnit(1, ALLIANCE_TIER_3)
call SetBuildUnit(1, ALLIANCE_AVIARY)
call SetBuildUnit(5, ALLIANCE_FARM)
call SetBuildUnit(1, ALLIANCE_SCOUT_TOWER)
call SetBuildUnit(1, ALLIANCE_GUARD_TOWER)
call SetBuildUnit(1, ALLIANCE_CANNON_TOWER)
call SetBuildUnit(2, ALLIANCE_CITIZEN_MALE)
call SetBuildUpgr(2, UPG_ALLIANCE_UPGRADE_ARROWS)
call SetBuildUpgr(2, UPG_ALLIANCE_UPGRADE_BALLISTAS)
call SetBuildUpgr(2, UPG_ALLIANCE_UPGRADE_SHIELDS)
call SetBuildUpgr(2, UPG_ALLIANCE_UPGRADE_SWORDS)
call SetBuildUpgr(1, UPG_ALLIANCE_ELVEN_RANGER_TRAINING)
call SetBuildUpgr(1, UPG_ALLIANCE_PALADINS)
call SetBuildUpgr(1, UPG_ALLIANCE_HEALING)
call SetBuildUpgr(1, UPG_ALLIANCE_INVISIBILITY)
call SetBuildUpgr(1, UPG_ALLIANCE_SLOW)
call SetBuildUpgr(1, UPG_ALLIANCE_POLYMORPH)
call SetBuildUpgr(1, UPG_ALLIANCE_BLIZZARD)
call SetBuildUpgr(1, UPG_ALLIANCE_BACKPACK)
call BuildingStrategyStandardTier3()
loop
call LoopActionWoWReforged()
if (expansions > 0) then
call SetBuildExpa(expansions, ALLIANCE_TIER_3)
call SetBuildExpa(expansions, ALLIANCE_MILL)
call SetBuildExpa(expansions, ALLIANCE_GUARD_TOWER)
endif
if (buildShips) then
call SetBuildUnit(1, ALLIANCE_SHIPYARD)
call SetBuildUnit(1, HUMAN_TRANSPORT_SHIP)
call SetBuildUnit(2, HUMAN_FRIGATE)
call SetBuildUnit(2, HUMAN_BATTLESHIP)
call SetBuildUnit(2, ALLIANCE_OIL_TANKER)
else
call SetBuildUnit(0, ALLIANCE_SHIPYARD)
call SetBuildUnit(0, HUMAN_TRANSPORT_SHIP)
call SetBuildUnit(0, HUMAN_FRIGATE)
call SetBuildUnit(0, HUMAN_BATTLESHIP)
call SetBuildUnit(0, ALLIANCE_OIL_TANKER)
endif
call Sleep(M1)
endloop
endfunction
function AttackWaves takes nothing returns nothing
//*** WAVE 1 ***
call InitAssaultGroup()
call CampaignAttackerEx(2, 3, 3, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(0, 1, 2, ALLIANCE_ELVEN_ARCHER)
call AddStandardUnitsToAttackWave()
call Sleep(M3) // Waits 3 minutes before attacking
call LaunchAttack()
//*** WAVE 1 ***
call InitAssaultGroup()
call CampaignAttackerEx(2, 3, 3, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(0, 1, 2, ALLIANCE_ELVEN_ARCHER)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
//*** WAVE 2 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call AddStandardUnitsToAttackWave()
call Sleep(M1) // Waits 1 minute before attacking
call LaunchAttack()
//*** WAVE 3 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_KNIGHT)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
//*** WAVE 4 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_KNIGHT)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_BALLISTA)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
//*** WAVE 5 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_KNIGHT)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_BALLISTA)
call CampaignAttackerEx(2, 2, 3, ALLIANCE_MAGE)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
//*** WAVE 6 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_KNIGHT)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_BALLISTA)
call CampaignAttackerEx(2, 2, 3, ALLIANCE_MAGE)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
//*** WAVE 7 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_KNIGHT)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_BALLISTA)
call CampaignAttackerEx(2, 2, 3, ALLIANCE_MAGE)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
//*** WAVE 8 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_KNIGHT)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_BALLISTA)
call CampaignAttackerEx(2, 2, 3, ALLIANCE_MAGE)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
//*** WAVE 9 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_KNIGHT)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_BALLISTA)
call CampaignAttackerEx(2, 2, 3, ALLIANCE_MAGE)
call CampaignAttackerEx(2, 2, 3, ALLIANCE_GRYPHON_RIDER)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
//*** WAVE 10 ***
call InitAssaultGroup()
call CampaignAttackerEx(3, 4, 4, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_KNIGHT)
call CampaignAttackerEx(1, 2, 3, ALLIANCE_BALLISTA)
call CampaignAttackerEx(2, 2, 3, ALLIANCE_MAGE)
call CampaignAttackerEx(2, 2, 3, ALLIANCE_GRYPHON_RIDER)
call AddStandardUnitsToAttackWave()
call Sleep(M2)
call LaunchAttack()
loop //Init the infinite attack loop
//*** WAVE 11 ***
call InitAssaultGroup()
// small ground army
call CampaignAttackerEx(2, 2, 2, ALLIANCE_FOOTMAN)
call CampaignAttackerEx(2, 2, 2, ALLIANCE_ELVEN_ARCHER)
call CampaignAttackerEx(2, 2, 2, ALLIANCE_KNIGHT)
call CampaignAttackerEx(2, 2, 2, ALLIANCE_BALLISTA)
call CampaignAttackerEx(2, 2, 2, ALLIANCE_MAGE)
// big air army
call CampaignAttackerEx(8, 10, 12, ALLIANCE_GRYPHON_RIDER)
call CampaignAttackerEx(8, 10, 12, ALLIANCE_FLYING_MACHINE)
call AddStandardUnitsToAttackWave()
call AddDragonsToAttackWave()
call Sleep(M2)
call LaunchAttack()
endloop
endfunction
function main takes nothing returns nothing
call MainWoWReforged(ALLIANCE_FARM, function BuildingStrategy)
call AttackWaves()
endfunction