|
发表于 2012-11-28 10:28:39
|
显示全部楼层
本帖最后由 lfglvstory 于 2012-11-28 10:49 编辑
firefly_hw 发表于 2012-11-28 08:47
技能效果我知道,我没用疾风步做模版,我随便用的一个空壳技能,然后触发里面用了一个主动防御的技能!20 ...
藏剑.w3x
(22.56 KB, 下载次数: 0)
核心代码如下:
有效的下一次攻击时用了捕捉伤害,但是还有点没完善的地方,呵呵·· 毕竟是赶工的东西。
只有一个主触发,仅一个疾风步的模板技能,无其他马甲技能,支持多人同时使用。地图为1.24利用了hashmap,没有用return bug。你看一下吧。对于增加攻击距离没有做,这个要做的话只能是像变身技能一样替换一个攻击距离远为200码的额外该英雄单位,通过改变科技改变会稍微麻烦一些。呵呵·· 抽空做的,你加我Q,我和你详谈吧。- function Trig_Ability_Conditions takes nothing returns boolean
- return GetSpellAbilityId() == 'A000'
- endfunction
- function Ability_TimerActions takes nothing returns nothing
- local integer parentKey = GetHandleId(GetExpiredTimer())
- local unit u = LoadUnit(parentKey,StringHash("hero"))
- local trigger t1 = LoadTrig(parentKey,StringHash("trig1"))
- local trigger t2 = LoadTrig(parentKey,StringHash("trig2"))
- call SetUnitAcquireRange(u,GetUnitDefaultAcquireRange(u))
- call DisableTrigger(t1)
- call DestroyTrigger(t1)
- call DisableTrigger(t2)
- call DestroyTrigger(t2)
- endfunction
- function Trig_t1_Conditions takes nothing returns boolean
- local integer parentKey = GetHandleId(GetTriggeringTrigger())
- local unit u = LoadUnit(parentKey,StringHash("hero"))
- local group g = LoadGroup(parentKey,StringHash("group"))
- if GetAttacker() == u and not IsUnitInGroup(GetTriggerUnit(),g) then
- call Debug("=======>>" + I2S(parentKey) + GetUnitName(GetTriggerUnit()) + ":" + GetUnitName(u))
- call GroupAddUnit(g,GetTriggerUnit())
- set u = null
- set g = null
- return true
- endif
- set u = null
- set g = null
- return false
- endfunction
- function Trig_t2_Conditions takes nothing returns boolean
- local integer parentKey = GetHandleId(GetTriggeringTrigger())
- local unit u = LoadUnit(parentKey,StringHash("hero"))
- if GetEventDamageSource() == u and UnitHasBuffBJ(u,'BOwk') then
- call Debug(">>>>>" + I2S(parentKey) + GetUnitName(GetEventDamageSource()) + ":" + GetUnitName(u))
- set u = null
- return true
- endif
- set u = null
- return false
- endfunction
- function Trig_t1_Actions takes nothing returns nothing
- local integer parentKey = GetHandleId(GetTriggeringTrigger())
- local trigger t2 = LoadTrig(parentKey,StringHash("trig"))
- call TriggerRegisterUnitEvent( t2, GetTriggerUnit(), EVENT_UNIT_DAMAGED )
- call Debug("t2 registerEvent" + GetUnitName(GetTriggerUnit()))
- set t2 = null
- endfunction
- function Trig_t2_Actions takes nothing returns nothing
- local integer parentKey = GetHandleId(GetTriggeringTrigger())
- local trigger t1 = LoadTrig(parentKey,StringHash("trig"))
- local unit u = GetTriggerUnit()
- local unit hero = GetEventDamageSource()
- local real damage = GetEventDamage()
- local group g = LoadGroup(parentKey,StringHash("group"))
- if UnitHasBuffBJ(hero,'BOwk') then
- call DisableTrigger(GetTriggeringTrigger())
- call UnitDamageTargetBJ( hero,u, 90, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
- call ShowFloatText("90!",hero,255,0,0)
- call SetUnitAcquireRange(hero,GetUnitDefaultAcquireRange(hero))
- call UnitRemoveAbility(hero,'BOwk')
- call DestroyTrigger(t1)
- call DestroyTrigger(GetTriggeringTrigger())
- call GroupClear(g)
- call DestroyGroup(g)
- endif
- set u = null
- set hero = null
- set t1 = null
- set g = null
- endfunction
- function Trig_Ability_Actions takes nothing returns nothing
- local timer t = CreateTimer()
- local integer parentKey = GetHandleId(t)
- local unit u = GetTriggerUnit()
- local trigger t1 = CreateTrigger()
- local group g = CreateGroup()
- local trigger t2 = CreateTrigger()
- //call UnitAddAbility(u,'A001')
- //call SetUnitAbilityLevel(u,'A001',GetUnitAbilityLevel(u,'A000'))
- //call SetUnitTypeSlots(u,12)
- call SetUnitAcquireRange( u, 0.00 )
- call SaveUnit(parentKey,StringHash("hero"),u)
- call SaveTrig(parentKey,StringHash("trig1"),t1)
- call SaveTrig(parentKey,StringHash("trig2"),t2)
- call TimerStart(t,6.0,true,function Ability_TimerActions)
- set parentKey = GetHandleId(t1)
- call SaveUnit(parentKey,StringHash("hero"),u)
- call SaveTrig(parentKey,StringHash("trig"),t2)
- call SaveGroup(parentKey,StringHash("group"),g)
- call TriggerRegisterAnyUnitEventBJ( t1, EVENT_PLAYER_UNIT_ATTACKED )
- call TriggerAddCondition(t1,Condition(function Trig_t1_Conditions))
- call TriggerAddAction(t1,function Trig_t1_Actions)
- set parentKey = GetHandleId(t2)
- call SaveUnit(parentKey,StringHash("hero"),u)
- call SaveTrig(parentKey,StringHash("trig"),t1)
- call SaveGroup(parentKey,StringHash("group"),g)
- call TriggerAddCondition(t2,Condition(function Trig_t2_Conditions))
- call TriggerAddAction(t2,function Trig_t2_Actions)
- set t = null
- endfunction
- //===========================================================================
- function InitTrig_Ability takes nothing returns nothing
- set gg_trg_Ability = CreateTrigger( )
- call TriggerRegisterAnyUnitEventBJ( gg_trg_Ability, EVENT_PLAYER_UNIT_SPELL_EFFECT )
- call TriggerAddCondition( gg_trg_Ability, Condition( function Trig_Ability_Conditions ) )
- call TriggerAddAction( gg_trg_Ability, function Trig_Ability_Actions )
- endfunction
复制代码 |
|