Code:
set damage[1]=70
set damage[2]=75
set damage[3]=80
set cilokrad[1]=130
set cilokrad[2]=140
set cilokrad[3]=150
klo kenaikan angkanya masih normal tiap level, dibikin function aja, jgn dimasukin variabel, klo levelnya ada 100 gmn? repot kan?
Code:
private constant function GetDamage takes integer level returns real
return 65.0 + level * 5.0
endfunction
private constant function GetCilokRad takes integer level returns real
return 120.0 + level * 10.0
endfunction
Code:
private static method filter takes unit u, unit owner returns boolean
if not(IsUnitEnemy(u,GetOwningPlayer(owner))) then
return false
endif
if IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) then
return false
endif
if IsUnitInvulnerable(u) then
return false
endif
if not(UnitAlive(u)) then
return false
endif
return true
endmethod
ini masi keliatan GUI-nya
, cukup disederhanakan jadi ini
Code:
private static method filter takes unit u, unit owner returns boolean
return IsUnitEnemy(u,GetOwningPlayer(owner)) and not IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE) and not IsUnitInvulnerable(u) and UnitAlive(u)
endmethod
Code:
local location loc =GetUnitLoc(caster)
local location loc2 =GetSpellTargetLoc()
di JASS kita uda bener2 ga butuh location lagi, karena itu leak...pake GetUnitX()/GetUnitY() buat unit/widget, pake GetSpellTargetX()/GetSpellTargetY() buat target point...
Code:
AngleBetweenPoints(loc,loc2)
DistanceBetweenPoints(loc,loc2)
PolarProjectionBJ(loc, rng, ang)
hindari pemakaian function2 BJ, karena itu masi keliatan GUI-nya, yang lagi2 jelas pake location, yg sudah pasti leak...
langsung aja pakai variablenya...
contoh:
Code:
local real rng = DistanceBetweenPoints(loc,loc2)
ubah jadi
Code:
local real dx = GetSpellTargetX() - GetUnitX(caster)
local real dy = GetSpellTargetY() - GetUnitY(caster)
local real rng = SquareRoot(dx * dx + dy * dy)
mungkin itu dulu dari saya, bila ada kata2 yg salah, ato kurang jelas mohon maap sebesar2nya
Share This Thread