HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A nub jass question

08-23-2007, 03:18 PM#1
DurotarLord
All right, I'm working on a healing spell in Jass and need some help. Specifically, the problem I'm having is that I need to be able to do this 4 times in a trigger with waits in between:

Trigger:
Unit Group - Pick every unit in (Units in (Region centered at (Position of a) with size (200.00, 200.00)) matching (((Owner of (Matching unit)) is an ally of (Owner of a)) Equal to True)) and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 25.0

without calling a new function. thx for the help guys. sry, but im still just a nub at jass and dont know how to do much more than destroy memory leaks and use local variables.
08-23-2007, 03:35 PM#2
CommanderZ
Collapse JASS:
local l=GetUnitLoc(a)
local p=GetOwningPlayer(a)
local unit u
local g
local integer i=0

loop
    exitwhen i==4
    set g=GetUnitsInRangeOfLocAll(200., l)

    loop
        set u=FirstOfGroup(g)
        exitwhen u==null
        if p==GetOwningPlayer(u) then
            {heal the unit}
        endif
        call GroupRemoveUnit(g,u)
    endloop

    call PolledWait(2.0)
    set i=i+1
endloop
{clear and nullify as needed}


sorry for the indentation, tab doesnt work here :(

Then use 4 spaces instead.