- Joined
- Aug 4, 2012
- Messages
- 1,022
JASS:
scope Level initializer Pick
globals
private constant player PLAYER = Player(0)
endglobals
private function Okay takes nothing returns nothing
call SetHeroLevelBJ(GetEnumUnit(), (GetHeroLevel(GetEnumUnit()) +1), false)
endfunction
private function Pick takes nothing returns nothing
call ForGroupBJ(GetUnitsOfPlayerAll(PLAYER), function Okay)
endfunction
private function Level takes nothing returns nothing
local trigger THIS = CreateTrigger()
call TriggerRegisterPlayerChatEvent(THIS, PLAYER, "-lvl", true)
call TriggerAddAction(THIS, function Pick)
endfunction
endscope
I need a system that could level up selected hero by 1 level.
I did my code with little functions.