|
这个光环有点类似DOTA中的辉耀。
该光环 600码范围内的敌人每秒 损失 5X技能等级 点 HP和MP。。光环内每有一个敌人,自己每秒长3X技能等级 点 HP和MP
- function Trig_Wizard_Judge takes nothing returns boolean
- return ( IsUnitEnemy(GetFilterUnit(), Player(0)) == true )
- endfunction
- function Trig_Wizard_Group takes nothing returns nothing
- //A02D技能等级
- local integer damage = GetUnitAbilityLevelSwapped('A02D', udg_Hero_sign[udg_tmp])
- call UnitDamageTargetBJ( udg_Hero_sign[udg_tmp], GetEnumUnit(), I2R(damage * 5), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE )
- call SetUnitManaBJ( GetEnumUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetEnumUnit()) - I2R(damage * 5) ) )
- call SetUnitLifeBJ( udg_Hero_sign[udg_tmp], ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_Hero_sign[udg_tmp]) + I2R(damage * 3) ) )
- call SetUnitManaBJ( udg_Hero_sign[udg_tmp], ( GetUnitStateSwap(UNIT_STATE_MANA, udg_Hero_sign[udg_tmp]) + I2R(damage * 3) ) )
- endfunction
- function Trig_Wizard_Actions takes nothing returns nothing
- local group tmp_group
- set udg_tmp = 0
- loop
- //英雄是H001
- if ( GetUnitTypeId(udg_Hero_sign[udg_tmp]) == 'H001' ) then
- if ( IsUnitAliveBJ(udg_Hero_sign[udg_tmp]) == true ) then
- set tmp_group = GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(udg_Hero_sign[udg_tmp]), Condition(function Trig_Wizard_Judge))
- call ForGroupBJ( tmp_group, function Trig_Wizard_Group )
- endif
- endif
- set udg_tmp=udg_tmp+1
- exitwhen(udg_tmp==5)
- endloop
- endfunction
- //===========================================================================
- function InitTrig_Wizard takes nothing returns nothing
- set gg_trg_Wizard = CreateTrigger( )
- call TriggerRegisterTimerEventPeriodic( gg_trg_Wizard, 1.00 )
- call TriggerAddAction( gg_trg_Wizard, function Trig_Wizard_Actions )
- endfunction
复制代码
udg_Hero_sign[udg_tmp] 记录英雄的。。我用了个数组记录多个英雄
udg_tmp是一个整型的全局变量。
- function Trig_Wizard_Judge takes nothing returns boolean
- return ( IsUnitEnemy(GetFilterUnit(), Player(0)) == true )
- endfunction
复制代码 Player(0)因为红的玩家是同盟的。所以用了这个。。。还请根据情况来做改动
That`s all.
头一次发个东西。。也不知道有没有人搞过。。做的不好,大家就凑合凑合看吧。。。
还请多指教 |
|