|
- function EMLRQGroup takes nothing returns nothing
- local unit addbuff
- if IsUnitEnemy(GetFilterUnit(),udg_tempplayer) then
- call BJDebugMsg( GetUnitName(GetFilterUnit()) )
- set addbuff = CreateUnit( Player(PLAYER_NEUTRAL_PASSIVE), 'h008', GetUnitX(udg_tempunit), GetUnitY(udg_tempunit), 0 )
- call UnitAddAbility( addbuff, 'A013' )
- call IssueTargetOrder( addbuff, "attackonce", GetFilterUnit() )
- call UnitDamageTarget( udg_tempunit, GetFilterUnit(), 90.00, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
- endif
- endfunction
- function EMLRQtimer takes nothing returns nothing
- local unit caster = LoadUnitHandle( udg_HT, GetHandleId(GetExpiredTimer()), StringHash("caster") )
- local unit u = LoadUnitHandle( udg_HT, GetHandleId(GetExpiredTimer()), StringHash("u") )
- local real angle = LoadReal( udg_HT, GetHandleId(GetExpiredTimer()), StringHash("angle") )
- local real n = LoadReal( udg_HT, GetHandleId(GetExpiredTimer()), StringHash("n") )
- local location p1 =GetUnitLoc(u)
- set udg_tempunit = caster
- set udg_tempplayer = GetOwningPlayer(u)
- if ( n > 1 ) then
- set n = n - 1
- call SaveReal( udg_HT, GetHandleId(GetExpiredTimer()), StringHash("n"), n )
- call SetUnitX( u,( GetUnitX(u)+( 30 * CosBJ(angle) ) ) )
- call SetUnitY( u,( GetUnitY(u)+( 30 * SinBJ(angle) ) ) )
- else
- call GroupEnumUnitsInRange(udg_group,GetUnitX(u),GetUnitX(u),200,Condition(function EMLRQGroup))
- call KillUnit(u)
- call FlushChildHashtable( udg_HT, GetHandleId(GetExpiredTimer()) )
- call DestroyTimer(GetExpiredTimer())
- endif
- set udg_tempplayer = null
- set udg_tempunit = null
- //call GroupClear( udg_group )
- call RemoveLocation(p1)
- endfunction
- function Trig_EMLR_QConditions takes nothing returns boolean
- return ((GetSpellAbilityId() == 'A011'))
- endfunction
- function Trig_EMLR_QActions takes nothing returns nothing
- local unit caster = GetTriggerUnit()
- local location p1 = GetUnitLoc(caster)
- local real angle = AngleBetweenPoints(p1,GetSpellTargetLoc())
- local real n = DistanceBetweenPoints(p1,GetSpellTargetLoc())/30
- local unit u = CreateUnit( GetOwningPlayer(caster), 'e005', GetLocationX(p1), GetLocationY(p1), GetUnitFacing(caster) )
- set bj_lastStartedTimer = CreateTimer()
- call SaveUnitHandle( udg_HT, GetHandleId(bj_lastStartedTimer), StringHash("caster"), caster )
- call SaveUnitHandle( udg_HT, GetHandleId(bj_lastStartedTimer), StringHash("u"), u )
- call SaveReal( udg_HT, GetHandleId(bj_lastStartedTimer), StringHash("angle"), angle )
- call SaveReal( udg_HT, GetHandleId(bj_lastStartedTimer), StringHash("n"), n )
- call TimerStart(bj_lastStartedTimer,0.02,true,function EMLRQtimer)
- call RemoveLocation(p1)
- endfunction
- //===========================================================================
- function InitTrig_EMLR_Q takes nothing returns nothing
- set gg_trg_EMLR_Q = CreateTrigger()
- #ifdef DEBUG
- call YDWESaveTriggerName(gg_trg_EMLR_Q, "EMLR_Q")
- #endif
- call TriggerRegisterAnyUnitEventBJ( gg_trg_EMLR_Q, EVENT_PLAYER_UNIT_SPELL_EFFECT )
- call TriggerAddCondition(gg_trg_EMLR_Q, Condition(function Trig_EMLR_QConditions))
- call TriggerAddAction(gg_trg_EMLR_Q, function Trig_EMLR_QActions)
- endfunction
复制代码 代码如上
但是貌似没法选取单位并伤害
求帮忙 万分感谢
|
|