- Joined
- May 24, 2016
- Messages
- 22
So I'm trying to create an area of effect polymorph that is MUI. So I put together this script. But I'm having issues.
Also, since I haven't been able to test it, will the rest of this trigger function?
-
MassSheepify Copy
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Mass Sheepify
-
-
Actions
-
Custom script: local unit MassSheepDummy = CreateUnit( GetOwningPlayer(GetTriggerUnit()), 'u000', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), bj_UNIT_FACING )
-
Custom script: local integer MassSheepLevel = GetUnitAbilityLevel(GetTriggerUnit(),'A01I')
-
Custom script: local location MSCaster = GetUnitLoc(GetTriggerUnit())
-
Custom script: call UnitApplyTimedLife(MassSheepDummy, 'BTLF', 7.00)
-
Custom script: call UnitAddAbility( MassSheepDummy, 'A01J' )
-
Custom script: call SetUnitAbilityLevel(MassSheepDummy,'A01J',MassSheepLevel)
-
Custom script: function MassSheepTargetConditions takes Nothing returns Boolean
-
Custom script: return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()) == true ) and IsUnitStructure(GetFilterUnit()) ==false and IsUnitMechanical(GetFilterUnit()) ==false
-
Custom script: endfunction
-
Custom script: function MassSheepAction takes nothing returns nothing
-
Custom script: local unit Target
-
Custom script: local group MassSheepTargets = CreateGroup()
-
Custom script: call GroupEnumUnitsInRangeLoc(MassSheepTargets, MScaster, 450, Condition(function MassSheepTargetConditions))
-
Custom script: loop
-
Custom script: set Target = FirstOfGroup(MassSheepTargets)
-
Custom script: exitwhen Target = null
-
Custom script: call IssueTargetOrderById(MassSheepDummy,852074,Target)
-
Custom script: call GroupRemoveUnit(MassSheepTargets,Target)
-
Custom script: endloop
-
Custom script: call RemoveLocation(MScaster)
-
Custom script: call DestroyGroup(MassSheepTargets)
-
Custom script: set MScaster=null
-
Custom script: set Target=null
-
Custom script: set MassSheepTargets=null
-
Custom script: endfunction
-
Custom script: set udg_MassSheepGroup = null
-
Custom script: set udg_MassSheepifyCaster = null
-
Custom script: set udg_MassSheepDummy = null
-
Custom script: set MassSheepDummy = null
-
-
-
Custom script: function MassSheepTargetConditions takes Nothing returns Boolean
-
Custom script: return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()) == true ) and IsUnitStructure(GetFilterUnit()) ==false and IsUnitMechanical(GetFilterUnit()) ==false
-
Custom script: endfunction
Also, since I haven't been able to test it, will the rest of this trigger function?