|
- globals
-     hashtable HT=null
- endglobals
- function Init takes nothing returns nothing
-     call FlushParentHashtable(HT)
-     set HT=InitHashtable()
- endfunction
- function Voodoo_Restoration_Check takes nothing returns boolean
-     if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
-         return false
-     endif
-     if(not(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(udg_Temp_unit))==true))then
-         return false
-     endif
-     return true
- endfunction
- function Voodoo_Restoration_Conditions takes nothing returns boolean
-     if (not(OrderId2StringBJ(GetIssuedOrderIdBJ())=="immolation"))then
-         return false
-     endif
-     if (not(OrderId2StringBJ(GetIssuedOrderIdBJ())=="unimmolation"))then
-         return false
-     endif
-     if (not(GetUnitTypeId(GetOrderTargetUnit())=='E000'))then
-         return false
-     endif
-     return true
- endfunction
- function Voodoo_Restoration_Main takes nothing returns nothing
-     local trigger vrt=GetTriggeringTrigger()
-     local unit hero=LoadUnitHandle(HT,1,1)
-     local integer level=GetUnitAbilityLevelSwapped('A002',hero)
-     local group team=CreateGroup()
-     local unit target
-     if(GetUnitState(hero,UNIT_STATE_MANA)<(level*6+2))then
-         call DisableTrigger(vrt)
-         call DestroyTrigger(vrt)
-         set vrt=null
-     endif
-     set udg_Temp_unit=hero
-     call GroupEnumUnitsInRange(team,GetUnitX(hero),GetUnitY(hero),340,Condition(function Voodoo_Restoration_Check))
-     call GroupAddUnit(team,hero)
-     loop
-         set target=FirstOfGroup(team)
-         exitwhen(target==null)
-         call SetUnitState(target,UNIT_STATE_LIFE,(GetUnitState(target,UNIT_STATE_LIFE)+(8*(level +1))))
-         call GroupRemoveUnit(team,target)
-     endloop
-     call DestroyGroup(team)
-     set team=null
-     set target=null
-     set hero=null
- endfunction
- function Voodoo_Restoration_Actions takes nothing returns nothing
-     local unit hero=GetOrderTargetUnit()
-     local trigger actions=CreateTrigger()
-     call TriggerRegisterTimerEventPeriodic(actions,.25)
-     call TriggerAddAction(actions,function Voodoo_Restoration_Main)
-     call SaveUnitHandle(HT,1,1,hero)
-     if(GetIssuedOrderId()==OrderId("immolation"))then
-         call EnableTrigger(actions)
-     else
-         call DisableTrigger(actions)
-         call DestroyTrigger(actions)
-         set actions=null
-     endif
-     set hero=null
- endfunction
- function InitTrig_Voodoo_Restoration takes nothing returns nothing
-     local trigger Voodoo_Restoration=CreateTrigger()
-     call TriggerRegisterAnyUnitEventBJ(Voodoo_Restoration,EVENT_PLAYER_UNIT_ISSUED_ORDER)
-     call TriggerAddCondition(Voodoo_Restoration,Condition(function Voodoo_Restoration_Conditions))
-     call TriggerAddAction(Voodoo_Restoration,function Voodoo_Restoration_Actions)
-     set Voodoo_Restoration=null
- endfunction
复制代码 请问哪里错了,改怎么修改
是献祭类似的   |
|