|
在学习了一段时间J后,昨天第一次尝试用J来写,
大致目的是,山丘放战争践踏,就会在他周围召唤5层,每层6-9个小精灵,
在经过一番报错修改,报错修改之后,终于不报错了,可以运行的时候缺没有效果。
请朋友帮忙看一下,因为这是自己写的第一个J,很想知道原因和解决方法。
地图在此
3Q
魔兽是1.20的
123.w3x
(21 KB, 下载次数: 9)
[jass]
globals
unit u1=null
location loc1=null
group g1=null
endglobals
function loc takes integer a,integer b,integer c returns location
local location l
set l = PolarProjectionBJ(GetUnitLoc(u1),200+50*I2R(a),I2R(b)*360/I2R(c))
return l
endfunction
function leo1_ff takes nothing returns nothing
local integer k = 1
local integer n = 0
local integer r
set r = GetRandomInt(6,9)
if(k<=5)then
loop
exitwhen(n>r)
call CreateUnitAtLoc(GetOwningPlayer(u1),'e000',loc(k,n,r),AngleBetweenPoints(loc1,loc(k,n,r)))
call GroupAddUnit(g1,GetLastCreatedUnit())
set n = n+1
endloop
set k = k+1
else
call DisableTrigger(GetTriggeringTrigger())
endif
endfunction
function leo1_c takes nothing returns boolean
if(GetSpellAbilityId()=='A000')then
return true
endif
return false
endfunction
function leo1_f takes nothing returns nothing
local timer t = CreateTimer()
set u1 = GetTriggerUnit()
set loc1 = GetUnitLoc(u1)
call TimerStart(t,0.5,true,function leo1_ff)
endfunction
function leo1 takes nothing returns nothing
call TriggerRegisterAnyUnitEventBJ(GetTriggeringTrigger(),EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(GetTriggeringTrigger(),Condition(function leo1_c))
call TriggerAddAction(GetTriggeringTrigger(),function leo1_f)
endfunction[/jass] |
|