Danis[h]
New Member
- Reaction score
- 19
Okay so here is the deal..
In my map I try to spawn my units via. a loop, and then I add the unit that was spawned to a unit group array where its array index is the count of how many times the loop have run through.
Now..
Based on which unitgroup the unit is in, i want to modify its mana to a certain value. However it only works for one spawn (the bottom condition.) The rest of the units aren't assigned a new mana value.
In my map I try to spawn my units via. a loop, and then I add the unit that was spawned to a unit group array where its array index is the count of how many times the loop have run through.
Now..
Based on which unitgroup the unit is in, i want to modify its mana to a certain value. However it only works for one spawn (the bottom condition.) The rest of the units aren't assigned a new mana value.
JASS:
private function StartPathActions takes nothing returns nothing
local location u
if ( IsUnitInGroup(GetTriggerUnit(), udg_RunGroup[8]) == true ) then
call SetUnitManaBJ(GetTriggerUnit(),80)
elseif ( IsUnitInGroup(GetTriggerUnit(), udg_RunGroup[7]) == true ) then
call SetUnitManaBJ(GetTriggerUnit(),70)
elseif ( IsUnitInGroup(GetTriggerUnit(), udg_RunGroup[6]) == true ) then
call SetUnitManaBJ(GetTriggerUnit(),60)
elseif ( IsUnitInGroup(GetTriggerUnit(), udg_RunGroup[5]) == true ) then
call SetUnitManaBJ(GetTriggerUnit(),50)
elseif ( IsUnitInGroup(GetTriggerUnit(), udg_RunGroup[4]) == true ) then
call SetUnitManaBJ(GetTriggerUnit(),40)
elseif ( IsUnitInGroup(GetTriggerUnit(), udg_RunGroup[3]) == true ) then
call SetUnitManaBJ(GetTriggerUnit(),30)
elseif ( IsUnitInGroup(GetTriggerUnit(), udg_RunGroup[2]) == true ) then
call SetUnitManaBJ(GetTriggerUnit(),20)
elseif ( IsUnitInGroup(GetTriggerUnit(), udg_RunGroup[1]) == true ) then
call SetUnitManaBJ(GetTriggerUnit(),10)
endif
set u = GetRectCenter(udg_Regions[R2I(GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA))])
call IssuePointOrderLocBJ( GetTriggerUnit(), "move", u )
call RemoveLocation(u)
set u = null
endfunction