|
function Trig_JS_Actions takes nothing returns nothing
local unit hero = GetTriggerUnit()
local real D = GetEventDamage()
local real Life = GetUnitState(hero,UNIT_STATE_LIFE)
local real ReviseLife = Life+0.25*D*GetUnitAbilityLevel(hero,'A000')
call SetUnitLifeBJ(hero,ReviseLife)
endfunction
function Trig_JS_Conditions takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'A000')> 0 then
return true
else
return false
endif
endfunction
function InitTrig_JS takes nothing returns nothing
local unit hero =FirstOfGroup(udg_bird)
set gg_trg_JS = CreateTrigger()
call TriggerRegisterUnitEvent(gg_trg_JS,hero,EVENT_UNIT_DAMAGED)
call TriggerAddCondition(gg_trg_JS,Condition(function Trig_JS_Conditions))
call TriggerAddAction( gg_trg_JS, function Trig_JS_Actions )
endfunction
刚学jass,很多东西都不懂,别笑话我,我本来打算做个类似无光之盾的技能,只不过是按照%减少伤害,也就是按照%加血,函数在上面,这个trigger无论怎么都不启动,在监测地图的时候还能进入地图,就是不启动。gg_trg_bird 是共享的一个单位组,我把英雄加到这个组里面,传递到这个trigger里面,不知道怎么的很是不成功 |
评分
-
查看全部评分
|