|
楼主 |
发表于 2008-8-28 03:25:20
|
显示全部楼层
这句话出自JASS区的"群体技能函数模版",JASS电子书上说了,能将别人的代码复制到自己的图里,算是学会"复制",我复制进自己图里了,上面这句WE说:编译错误,错误名字.
[codes=jass]function Cluster_skill takes integer i,integer aid returns nothing
local unit t_u = GetSpellAbilityUnit()
local unit ta_u = GetSpellTargetUnit()
local player t_p = GetOwningPlayer(t_u)
call StoreInteger(GameCache(),"I2S(H2I(t_u))","aid",aid)
call StoreInteger(GameCache(),"I2S(H2I(t_u))","spell",GetSpellAbilityId())
if IsUnitAlly(GetSpellTargetUnit(),t_p) == true then
call StoreBoolean(GameCache(),"I2S(H2I(t_u))","tf",true)
elseif IsUnitEnemy(GetSpellTargetUnit(),t_p) == true then
call StoreBoolean(GameCache(),"I2S(H2I(t_u))","tf",false)
endif
call GroupEnumUnitsInRange(udg_Cluster,GetUnitX(ta_u),GetUnitY(ta_u),i+33,Condition(function act))
call FlushStoredMission(GameCache(),"I2S(H2I(t_u))")
set t_u = null
set ta_u = null
endfunction
function act takes nothing returns nothing
local unit t_u = GetSpellAbilityUnit()
local player t_p = GetOwningPlayer(t_u)
local integer aid = GetStoredInteger(GameCache(),"I2S(H2I(t_u))","aid")
local integer spell = GetStoredInteger(GameCache(),"I2S(H2I(t_u))","spell")
local boolean tf = GetStoredBoolean(GameCache(),"I2S(H2I(t_u))","tf")
local unit last_u
if IsUnitAlly(GetFilterUnit(),t_p) == tf then
set last_u = CreateUnit(t_p,'nOOE',GetUnitX(t_u),GetUnitY(t_u),0)
call UnitAddAbility(last_u,aid)
call SetUnitAbilityLevel(last_u,aid,GetUnitAbilityLevel(t_u,spell))
call ShowUnit(last_u,false)
call UnitApplyTimedLife(last_u,'BHwe',1)
call IssueTargetOrder(last_u,OrderId2StringBJ(GetUnitCurrentOrder(t_u)),GetFilterUnit())
endif
set last_u = null
set t_u = null
set t_p = null
endfunction[/codes]
"T"
事件:任意单位开始施放技能
条件:(某某某技能)= 真
动作:call Cluster_skill("500",AOO1) |
|