- Joined
- Nov 13, 2006
- Messages
- 1,814
JASS:
call GroupEnumUnitsInRange(gr,ux,uy,600.00,Condition(function Unit_Group6))
JASS:
function Unit_Group6 takes nothing returns boolean
local unit u = GetFilterUnit()
local unit ut = GetTriggerUnit()
local real x1 = GetUnitX(ut)
local real y1 = GetUnitY(ut)
local real x2 = GetUnitX(u)
local real y2 = GetUnitY(u)
local real ang = Atan2( y2 - y1, x2 - x1)
local real x3 = x1 + 500 * Cos(ang)
local real y3 = y1 + 500 * Sin(ang)
local real dmg = 10 + (GetUnitAbilityLevel(ut, 'AOws')) * 50
if ((IsUnitEnemy(u, GetTriggerPlayer())==true)) then
call UnitDamageTarget(ut, u, dmg, true, false, ConvertAttackType(6), ConvertDamageType(4), ConvertWeaponType(0))
call IssuePointOrder (u, "move" , x3, y3)
call SetUnitFacing(u, ang*180/3.14159-180)
call SetUnitPosition (u, x3, y3)
endif
set u = null
set ut = null
return false
endfunction
1.How can i pass variable to Unit_Group6 function without useing global variables?
like in bottom example when i pass boolean, integer and unit to function?
coz in every trigger if i use unit group function then allways name must different and idk if i cant rreplace it to a global unit group function what i can call when i need it ...
2.
since in Unit_Group6 function dont exist loop, how can i index the picked units?
example: u=getenumedunit();set i=i+1
JASS:
call AddHPMP(true, i, u)
if i changed takes nothing to takes integer i in 1st trigger then i got something expected error '