|
发表于 2008-2-18 14:16:30
|
显示全部楼层
- function Trig_Backtrack_Conditions takes nothing returns boolean
- return GetLearnedSkill()=='A0CZ'and IsUnitIllusion(GetTriggerUnit())==false
- endfunction
- function Backtrack_Main takes nothing returns nothing
- local unit lfo=GetTriggerUnit()
- local real lf7=GetEventDamage()
- if(lf7>0)then
- if(GetRandomInt(1,100)<=(5+(5*GetUnitAbilityLevel(lfo,'A0CZ'))))then
- call SetUnitState(lfo,UNIT_STATE_LIFE,GetUnitState(lfo,UNIT_STATE_LIFE)+lf7)
- call DestroyEffect(AddSpecialEffectTarget("Abilities\\\\Weapons\\\\WingedSerpentMissile\\\\WingedSerpentMissile.mdl",lfo,"hand,left"))
- endif
- endif
- endfunction
- function Trig_Backtrack_Actions takes nothing returns nothing
- local trigger ltt
- if GetUnitAbilityLevel(GetTriggerUnit(),'A0CZ')==1 then
- set ltt=CreateTrigger()
- call TriggerRegisterUnitEvent(ltt,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
- call TriggerAddAction(ltt,function Backtrack_Main)
- endif
- endfunction
- function StartTrigger_Backtrack takes nothing returns nothing
- set gg_trg_Backtrack=CreateTrigger()
- call TriggerRegisterAnyUnitEventBJ(gg_trg_Backtrack,EVENT_PLAYER_HERO_SKILL)
- call TriggerAddCondition(gg_trg_Backtrack,Condition(function Trig_Backtrack_Conditions))
- call TriggerAddAction(gg_trg_Backtrack,function Trig_Backtrack_Actions)
- endfunction
- function InitTrig_Backtrack takes nothing returns nothing
- endfunction
复制代码 这个是回到过去的触发……
是否会跟蚂蚁的时光倒流原理差不多呢?
以下是地穴编制者时光倒流的触发:
Part 1:Time_Lapse_Cast- function TimeLapseCastCheck takes nothing returns boolean
- return GetSpellAbilityId()=='A0CT'
- endfunction
- function TimeLapseCast takes nothing returns nothing
- local string lf5=H2Tx(GetTriggerUnit())
- local real lvt=ReturnMaxReal(GetReal(lf5,"TLLife1"),1)
- local real lvT=ReturnMaxReal(GetReal(lf5,"TLMana1"),1)
- local location lp5=GetLocation(lf5,"TLPoint1")
- local unit lfo=GetTriggerUnit()
- if GetReal(lf5,"TLLife1")>1 then
- call AddSpecialEffect("Abilities\\\\Spells\\\\NightElf\\\\Blink\\\\BlinkTarget.mdl",GetUnitX(lfo),GetUnitY(lfo))
- call SetUnitX(lfo,GetLocationX(lp5))
- call SetUnitY(lfo,GetLocationY(lp5))
- call SetUnitState(lfo,UNIT_STATE_LIFE,lvt)
- call SetUnitState(lfo,UNIT_STATE_MANA,lvT)
- call UnitRemoveBuffs(lfo,false,true)
- call RemoveLocation(lp5)
- call TriggerSleepAction(0)
- call SetUnitState(lfo,UNIT_STATE_MANA,lvT)
- endif
- endfunction
- function h2 takes nothing returns nothing
- local trigger ltt=CreateTrigger()
- call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_EFFECT)
- call TriggerAddCondition(ltt,Condition(function TimeLapseCastCheck))
- call TriggerAddAction(ltt,function TimeLapseCast)
- endfunction
- function InitTrig_Time_Lapse_Cast takes nothing returns nothing
- endfunction
复制代码 Part.2:Time_Lapse_Learn- function TimeLapseCastCheck takes nothing returns boolean
- return GetSpellAbilityId()=='A0CT'
- endfunction
- function TimeLapseCast takes nothing returns nothing
- local string lf5=H2Tx(GetTriggerUnit())
- local real lvt=ReturnMaxReal(GetReal(lf5,"TLLife1"),1)
- local real lvT=ReturnMaxReal(GetReal(lf5,"TLMana1"),1)
- local location lp5=GetLocation(lf5,"TLPoint1")
- local unit lfo=GetTriggerUnit()
- if GetReal(lf5,"TLLife1")>1 then
- call AddSpecialEffect("Abilities\\\\Spells\\\\NightElf\\\\Blink\\\\BlinkTarget.mdl",GetUnitX(lfo),GetUnitY(lfo))
- call SetUnitX(lfo,GetLocationX(lp5))
- call SetUnitY(lfo,GetLocationY(lp5))
- call SetUnitState(lfo,UNIT_STATE_LIFE,lvt)
- call SetUnitState(lfo,UNIT_STATE_MANA,lvT)
- call UnitRemoveBuffs(lfo,false,true)
- call RemoveLocation(lp5)
- call TriggerSleepAction(0)
- call SetUnitState(lfo,UNIT_STATE_MANA,lvT)
- endif
- endfunction
- function h2 takes nothing returns nothing
- local trigger ltt=CreateTrigger()
- call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_EFFECT)
- call TriggerAddCondition(ltt,Condition(function TimeLapseCastCheck))
- call TriggerAddAction(ltt,function TimeLapseCast)
- endfunction
- function InitTrig_Time_Lapse_Cast takes nothing returns nothing
- endfunction
复制代码 在下并不是很会使用Jass 2,希望懂Jass 2的高人来解读一下…… |
|