Hello everyone.
This is the blood elves AI for my campaign.
I test it but the AI only harvest ressource without building something
This is the blood elves AI for my campaign.
I test it but the AI only harvest ressource without building something
JASS:
globals
player MyVictim = Player(2) // This is the player 3 (teal)
endglobals
function ConfigureAI takes nothing returns nothing
call SetSlowChopping( false )
call SetPeonsRepair( true )
endfunction
function hero_levels takes nothing returns integer
local integer hero = GetHeroId()
local integer level = GetHeroLevelAI()
local integer a = 0
if hero == E600 then
if level == 1 or level == 3 or level == 5 then
set a = A604
endif
if level == 2 or level == 4 or level == 7 then
set a = A605
endif
if level >= 8 then
set a = A606
endif
if level == 6 then
set a = A607
endif
if hero == E600 then
if level == 1 or level == 3 or level == 5 then
set a = H60A
endif
if level == 2 or level == 4 or level == 7 then
set a = A608
endif
if level >= 8 then
set a = A609
endif
if level == 6 then
set a = A60A
endif
endif
return a
endif
endfunction
function main takes nothing returns nothing
call CampaignAI( h603, function hero_levels )
call ConfigureAI( )
// **********************************
// * Building Strategy *
// **********************************
call SetBuildUnitEx( 1, 1, 1, h604 )
call SetBuildUnit( 15, n603 )
call SetBuildUnitEx( 1, 2, 5, h603 )
call SetBuildUnitEx( 1, 1, 2, n609 )
call SetBuildUnit( 1, h606 )
call SetBuildUnit( 1, h60A )
call SetBuildUnitEx( 0, 1, 2, h609 )
call CampaignDefenderEx( 2, 2, 3, h600 ) // <==(2)
call CampaignDefenderEx( 1, 1, 2, n604 )
call CampaignDefenderEx( 1, 1, 2, h62 )
// **********************************
// * End Building Strategy *
// **********************************
loop
//*** WAVE 1 ***
call InitAssaultGroup() // <==(1)
call CampaignAttackerEx( 1, 3, 5, h600 ) // <==(2)
call CampaignAttackerEx( 0, 1, 2, n604 )
call CampaignAttackerEx( 0, 1, 1, h602 )
call SuicideOnPlayerEx( M2, M3, M3, MyVictim ) // <==(3)
endloop
endfunction