• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] UnitGroup Damage

Status
Not open for further replies.
Level 17
Joined
Jun 28, 2008
Messages
776
I am still new to JASS so I don't know all the tricks.

How can I use a unit(lets call him u) in a Unit Group Function example :

JASS:
function Damage_Units takes nothing returns nothing

    local unit u // ??? how do I get u from function main to function Damage_Unit

    call UnitDamageTargetBJ(u,GetEnumUnit(), 500, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL)

endfunction

function Main takes nothing returns nothing

    local unit u          = GetTriggerUnit()
    local group g         = null
    local location point1 = GetUnitLoc(u)
    
    set g = GetUnitsInRangeOfLocAll(900, point1)
    call ForGroupBJ(g, function Damage_Units)

endfunction

I tried the Local Handel Vars system, but I can't seem to get it to work with a group.

Please help me for I am clueless...

Thanks in advance
 
Status
Not open for further replies.
Top