|
不知道为啥这段代码没效果- -。。。貌似我的GetSpellTargetUnit()获取不到- -。。。。求各位大大帮忙找找 小弟刚接触jass
- function H2I takes handle h returns integer
- return h
- return 0
- endfunction
- function I2U takes integer i returns unit
- return i
- return null
- endfunction
- function jtaction takes nothing returns nothing
- local unit targetUnit = I2U(GetStoredInteger(udg_GC,"jt","tgUnit"))
- call DisplayTextToPlayer(Player(0),0,0,I2S(H2I(targetUnit)))
- call SetUnitPositionLoc(targetUnit,PolarProjectionBJ(GetUnitLoc(targetUnit),10,(GetUnitFacing(targetUnit)+180)))
- endfunction
- function Trig_oneJT_Conditions takes nothing returns boolean
- if(not(GetSpellAbilityId() == 'Ahtb') )then
- return FALSE
- endif
- return TRUE
- endfunction
- function Trig_oneJT_Actions takes nothing returns nothing
- call StoreInteger(udg_GC,"jt","tgUnit",H2I(GetSpellTargetUnit()))
- call TimerStart(CreateTimer(),0.50,TRUE,function jtaction)
- endfunction
- //==== Init Trigger oneJT ====
- function InitTrig_oneJT takes nothing returns nothing
- set gg_trg_oneJT = CreateTrigger()
- call TriggerRegisterAnyUnitEventBJ(gg_trg_oneJT,EVENT_PLAYER_UNIT_SPELL_CHANNEL )
- call TriggerAddCondition(gg_trg_oneJT, Condition(function Trig_oneJT_Conditions))
- call TriggerAddAction(gg_trg_oneJT, function Trig_oneJT_Actions)
- endfunction
复制代码 |
|