- This system is related to my
http://www.hiveworkshop.com/forums/submissions-414/snippet-muidummycasters-211663/ in jass resource, I've made a GUI version so that GUIers can have it's benefit
- Creates only 1 dummy for instant spells like firebolt, carrion swarm, banish, etc
- Supports channel spells by creating another dummy to channel the spell like flamestrike, starfall, blizzard, etc
- You may control the point where the dummy is created and cast to a target or location where you can see the projectile is traveling
- JNGP is not required
- Very easy to implement, MDC_Cast, MDC_CastPoint, MDC_CastTarget
- Check the Automatically create unknown variables when pasting trigger data, via File/preferences/general tab
- Copy the dummy caster unit to your map
- Copy the MUI_DummyCaster folder which has the MDC Setup, MDC OnCast, MDC OffCast trigger in it
- Change the MDC_DummyID from MDC Setup to the imported dummy
- DONE!
-
MDC Setup
-
Events
-
Conditions
-
Actions
-
-------- Import the dummy from the object editor --------
-
Set MDC_DummyID = DummyCaster
-
-------- WARNING: Do not touch anything below this line! --------
-
-------- Initializing Hashtable --------
-
Custom script: set udg_MDC_Hashtable = InitHashtable()
-
-------- Default level is 1 --------
-
Set MDC_Level = 1
-
-------- Default 3 values you may use, pick one as desired --------
-
Set MDC_Cast = 1
-
Set MDC_CastPoint = 2
-
Set MDC_CastTarget = 3
-
MDC OnCast
-
Events
-
Conditions
-
Actions
-
Custom script: call ExecuteFunc("MDC_Evaluate")
-
Custom script: endfunction
-
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
-
-------- Removing the location and resetting everything --------
-
Custom script: function MDC_Reset takes nothing returns nothing
-
Custom script: call RemoveLocation(udg_MDC_Location)
-
Custom script: set udg_MDC_Location = null
-
Set MDC_Level = 1
-
Set MDC_Height = 0.00
-
Set MDC_OrderID = 0
-
Set MDC_PointToPointCast = False
-
Custom script: endfunction
-
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
-
Custom script: function MDC_RefreshDummy takes unit u returns nothing
-
Custom script: call UnitRemoveAbility(u, LoadInteger(udg_MDC_Hashtable, GetHandleId(u), 0))
-
Custom script: call GroupAddUnit(udg_MDC_Group, u)
-
Custom script: call SetUnitOwner(u, Player(15), false)
-
Custom script: call PauseUnit(u, true)
-
Custom script: endfunction
-
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
-
Custom script: function MDC_GetDummyUnit takes nothing returns unit
-
Custom script: if FirstOfGroup(udg_MDC_Group)==null then
-
Custom script: set udg_MDC_DummyCaster = CreateUnit(Player(15), udg_MDC_DummyID, 0, 0, 0)
-
Custom script: call UnitRemoveAbility(udg_MDC_DummyCaster, 'Amov')
-
Custom script: else
-
Custom script: set udg_MDC_DummyCaster = FirstOfGroup(udg_MDC_Group)
-
Unit Group - Remove MDC_DummyCaster from MDC_Group
-
Custom script: endif
-
Custom script: return udg_MDC_DummyCaster
-
Custom script: endfunction
-
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
-
Custom script: function MDC_Evaluate takes nothing returns nothing
-
Custom script: set udg_MDC_DummyCaster = MDC_GetDummyUnit()
-
Unit - Unpause MDC_DummyCaster
-
Unit - Add MDC_AbilityID to MDC_DummyCaster
-
Unit - Set level of MDC_AbilityID for MDC_DummyCaster to MDC_Level
-
Animation - Change MDC_DummyCaster flying height to MDC_Height at 0.00
-
Custom script: call SaveInteger(udg_MDC_Hashtable, GetHandleId(udg_MDC_DummyCaster), 0, udg_MDC_AbilityID)
-
Custom script: if udg_MDC_Location==null then
-
Custom script: call MDC_RefreshDummy(udg_MDC_DummyCaster)
-
Custom script: call MDC_Reset()
-
Custom script: call DisplayTextToPlayer(udg_MDC_Player, 0, 0, "[MDC_Location] ERROR: Location is null")
-
Custom script: return
-
Custom script: else
-
Custom script: call SetUnitPositionLoc(udg_MDC_DummyCaster, udg_MDC_Location)
-
Custom script: endif
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MDC_CastType Equal to MDC_Cast
-
Then - Actions
-
Custom script: call IssueImmediateOrderById(udg_MDC_DummyCaster, udg_MDC_OrderID)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MDC_CastType Equal to MDC_CastPoint
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MDC_PointToPointCast Equal to True
-
Then - Actions
-
Custom script: call IssuePointOrderByIdLoc(udg_MDC_DummyCaster, udg_MDC_OrderID, udg_MDC_ProjectileAnglePoint)
-
Custom script: call RemoveLocation(udg_MDC_ProjectileAnglePoint)
-
Else - Actions
-
Custom script: call IssuePointOrderByIdLoc(udg_MDC_DummyCaster, udg_MDC_OrderID, udg_MDC_Location)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MDC_CastType Equal to MDC_CastTarget
-
Then - Actions
-
-------- Target Unit has a fail-safe in case there is a null unit --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
MDC_Target Equal to No unit
-
Then - Actions
-
Custom script: call MDC_RefreshDummy(udg_MDC_DummyCaster)
-
Custom script: call MDC_Reset()
-
Custom script: call DisplayTextToPlayer(udg_MDC_Player, 0, 0, "[MDC_Target] ERROR: Attempt to cast to a null unit")
-
Else - Actions
-
Custom script: call IssueTargetOrderById(udg_MDC_DummyCaster, udg_MDC_OrderID, udg_MDC_Target)
-
Else - Actions
-
Custom script: call MDC_Reset()
-
MDC OffCast
-
Events
-
Unit - A unit Finishes casting an ability
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to MDC_DummyID
-
Actions
-
Custom script: local unit u = GetTriggerUnit()
-
Custom script: call UnitRemoveAbility(u, LoadInteger(udg_MDC_Hashtable, GetHandleId(u), 0))
-
Custom script: call GroupAddUnit(udg_MDC_Group, u)
-
Custom script: call SetUnitOwner(u, Player(15), false)
-
Custom script: set u = null
- The dummy spell must have 0 mana
- The cast range of the spell must be greater than the cast point (Location)
- The target unit must be targetable, else this will bug
- For unknown reasons the MDC_Cast or no target cast cannot run under a loop like the rest,
if you spot the solution you will be credited