Beetlebomb
New Member
- Reaction score
- 43
I'd normally try and teach myself this but being that i can't convert a gui version of this into jass I have to get help on this one, guys-- haha.
This is what i got so far:
So you can kinda see what I'm trying to do. If a player uses Thunder clap it kills all archers and then displays how many were killed. I remember reading in a tutorial that the local has to be declared before the function so I put the "Add" trigger below the Actions.
Mind pointing out to me how to add onto a local integer like that? ^^ thanks!
This is what i got so far:
JASS:
function Cond takes nothing returns boolean
if(not(GetSpellAbilityId() == 039;AHtc039; ) ) then
return false
endif
return true
endfunction
function kill2 takes nothing returns nothing
call KillUnit( GetEnumUnit())
endfunction
function Trig_Remove_Archers_Actions takes nothing returns nothing
local integer i = 0
call ForGroupBJ( GetUnitsOfTypeIdAll(039;earc039;), function kill2, function Add )
call DestroyGroup(GetLastCreatedGroup())
call DisplayTextToForce(GetPlayersAll(), I2S(i)+" Archers have been killed." )
endfunction
function Add takes nothing returns nothing
set integer i = (i+1)
endfunction
//===========================================================================
function InitTrig_Remove_Archers takes nothing returns nothing
set gg_trg_Remove_Archers = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Remove_Archers, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Remove_Archers, Condition(function Cond) )
call TriggerAddAction( gg_trg_Remove_Archers, function Trig_Remove_Archers_Actions )
endfunction
So you can kinda see what I'm trying to do. If a player uses Thunder clap it kills all archers and then displays how many were killed. I remember reading in a tutorial that the local has to be declared before the function so I put the "Add" trigger below the Actions.
Mind pointing out to me how to add onto a local integer like that? ^^ thanks!