|
- globals
- hashtable Ae=null
- trigger gg_trg_Whirl_Wind=null
- endglobals
- function Trig_Whirl_Wind_Conditions takes nothing returns boolean
- return GetSpellAbilityId()=='A005'
- endfunction
- function WhirlWind takes nothing returns nothing
- local timer t=GetExpiredTimer()
- local unit caster=LoadUnitHandle(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("caster"))
- local real angle=LoadReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("Angle"))
- local real cx=LoadReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("cx"))
- local real cy=LoadReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("cy"))
- local group OldTargets=LoadGroupHandle(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("OldTargets"))
- local group NewTargets=LoadGroupHandle(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("NewTargets"))
- local unit group_unit=null
- local player p=null
- local integer damage=0
- if( GetUnitCurrentOrder(caster)==String2OrderIdBJ("Cyclone"))then
- set p=GetOwningPlayer(caster)
- call GroupEnumUnitsInRange(NewTargets,cx,cy,600.00,null)
- set damage=100*GetUnitAbilityLevel(caster,'A005')
- call GroupRemoveGroup(OldTargets,NewTargets)
- call GroupAddGroup(NewTargets,OldTargets)
- loop
- set group_unit=FirstOfGroup(NewTargets)
- exitwhen group_unit==null
- if( GetWidgetLife(group_unit)>0.405 and IsUnitEnemy(group_unit,p) and IsUnitType(group_unit, UNIT_TYPE_STRUCTURE)==false) then
- call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",GetUnitX(group_unit),GetUnitY(group_unit)))
- call UnitDamageTarget(caster,group_unit,(I2R(GetHeroAgi(caster,true))*(30.00*I2R(GetUnitAbilityLevel(caster,'A005')))),true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_ENHANCED,WEAPON_TYPE_WHOKNOWS)
- endif
- call GroupRemoveUnit(NewTargets,group_unit)
- endloop
- set angle =LoadReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("angle"))
- set cx = cx + 25 * Cos( angle )
- set cy = cy + 25 * Sin( angle )
- if(IsTerrainPathable(cx,cy,PATHING_TYPE_WALKABILITY)==false) and (IsTerrainPathable(cx,cy,PATHING_TYPE_FLYABILITY)==false) then
- call SetUnitX(caster,cx)
- call SetUnitY(caster,cy)
- call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",cx,cy))
- endif
- else
- call DestroyGroup(OldTargets)
- call DestroyGroup(NewTargets)
- set OldTargets=null
- set NewTargets=null
- call SetUnitTimeScale(caster,1.00)
- call PauseTimer(t)
- call DestroyTimer(t)
- call FlushChildHashtable(Ae,GetHandleId(t))
- endif
- set t=null
- set caster=null
- set OldTargets=null
- set NewTargets=null
- endfunction
- function Trig_Whirl_Wind_Actions takes nothing returns nothing
- local unit caster = GetTriggerUnit()
- local location tp = GetSpellTargetLoc()
- local real cx = GetUnitX(caster)
- local real cy = GetUnitY(caster)
- local real tx = GetLocationX(tp)
- local real ty = GetLocationY(tp)
- local real angle =Atan2(ty-cy,tx-cx)
- local group NewTarget = CreateGroup()
- local group OldTarget = CreateGroup()
- local timer t
- call SetUnitTimeScale(caster,2.00)
- set t=CreateTimer()
- call SaveUnitHandle(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("caster"),caster)
- call SaveReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("angle"),angle)
- call SaveReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("cx"),cx)
- call SaveReal(Ae,(StringHash(I2S(GetHandleId((t))))),StringHash("cy"),cy)
- call SaveGroupHandle(Ae,(StringHash(I2S(GetHandleId((caster))))),StringHash("NewTargets"),NewTarget)
- call SaveGroupHandle(Ae,(StringHash(I2S(GetHandleId((caster))))),StringHash("OldTargets"),OldTarget)
- call TimerStart(t,0.03,true,function WhirlWind)
- call RemoveLocation(tp)
- set t=null
- set tp=null
- endfunction
- function InitTrig_Whirl_Wind takes nothing returns nothing
- set gg_trg_Whirl_Wind=CreateTrigger()
- call TriggerRegisterAnyUnitEventBJ(gg_trg_Whirl_Wind,EVENT_PLAYER_UNIT_SPELL_EFFECT)
- call TriggerAddCondition(gg_trg_Whirl_Wind,Condition(function Trig_Whirl_Wind_Conditions))
- call TriggerAddAction(gg_trg_Whirl_Wind, function Trig_Whirl_Wind_Actions)
- endfunction
复制代码 @希瓦 @chyj4747
英雄正确移动到技能释放点的位置 但是没有对途经的单位造成任何伤害 无论伤害公式设置为多少都没有任何效果 感觉应该是单位被移除出OldTargets 但是没有加入到NewTargets 我选取的单位组是NewTargets...不会Debug 这个单位组选取到的单位数量是否为0呢?请各位大佬帮忙看看下 谢谢! |
|