- Joined
- May 16, 2020
- Messages
- 660
Hi guys,
I want to recreate DotA's Meat Hook ability in MUI, and if possible NOT using a hashtable for it.
Ideally the spell should be build along this structure:
Visualize: Dynamic Indexing
However, this part of the code causes problems, as the game doesn't recognize "arrays pof the array" (when two abilities are cast, the chains of the first spell are not destroyed):
***
I want to recreate DotA's Meat Hook ability in MUI, and if possible NOT using a hashtable for it.
Ideally the spell should be build along this structure:
Visualize: Dynamic Indexing
However, this part of the code causes problems, as the game doesn't recognize "arrays pof the array" (when two abilities are cast, the chains of the first spell are not destroyed):
- Set VariableSet MH_Chain[MH_Counter[MH_Integer]] = (Last created special effect)
***
-
Meat Hook
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Meat Hook
-
Actions
- Set VariableSet MH_Index = (MH_Index + 1)
- Set VariableSet MH_Caster[MH_Index] = (Triggering unit)
- Set VariableSet MH_Damage[MH_Index] = (80.00 + (70.00 x (Real((Level of Meat Hook for MH_Caster[MH_Index])))))
- Set VariableSet MH_Counter[MH_Index] = 0
- Set VariableSet MH_Distance[MH_Index] = 0.00
- Set VariableSet MH_Boolean[MH_Index] = False
- Set VariableSet MH_UnitHooked[MH_Index] = No unit
- -------- --------
- Set VariableSet MH_PointTemp[1] = (Position of MH_Caster[MH_Index])
- Set VariableSet MH_PointTemp[2] = (Target point of ability being cast)
- Set VariableSet MH_Angle[MH_Index] = (Angle from MH_PointTemp[1] to MH_PointTemp[2])
- Set VariableSet MH_Point[MH_Index] = (MH_PointTemp[1] offset by 50.00 towards MH_Angle[MH_Index] degrees.)
- -------- --------
- Special Effect - Create a special effect at MH_Point[MH_Index] using war3mapImported\HookHead.mdl
- Set VariableSet MH_Missile[MH_Index] = (Last created special effect)
- Special Effect - Set Scale of MH_Missile[MH_Index] to 1.10
- Special Effect - Set Yaw of MH_Missile[MH_Index] to: (Radians(MH_Angle[MH_Index]))
- Special Effect - Set Height of MH_Missile[MH_Index] to: 30.00
- -------- --------
- Custom script: call RemoveLocation(udg_MH_PointTemp[1])
- Custom script: call RemoveLocation(udg_MH_PointTemp[2])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Index Equal to 1
-
Then - Actions
- Countdown Timer - Start MH_Timer as a Repeating timer that will expire in 0.03 seconds
- Trigger - Turn on Meat Hook Loop <gen>
- Else - Actions
-
If - Conditions
-
Events
-
Meat Hook Loop
-
Events
- Time - MH_Timer expires
- Conditions
-
Actions
-
For each (Integer MH_Integer) from 1 to MH_Index, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Boolean[MH_Integer] Equal to False
-
Then - Actions
- Set VariableSet MH_Counter[MH_Integer] = (MH_Counter[MH_Integer] + 1)
- -------- --------
- Set VariableSet MH_PointTemp[1] = (MH_Point[MH_Integer] offset by MH_Distance[MH_Integer] towards MH_Angle[MH_Integer] degrees.)
- Special Effect - Create a special effect at MH_PointTemp[1] using war3mapImported\HookChain.mdl
- Set VariableSet MH_Chain[MH_Counter[MH_Integer]] = (Last created special effect)
- Special Effect - Set Scale of MH_Chain[MH_Counter[MH_Integer]] to 1.30
- Special Effect - Set Yaw of MH_Chain[MH_Counter[MH_Integer]] to: (Radians(MH_Angle[MH_Integer]))
- Special Effect - Set Height of MH_Chain[MH_Counter[MH_Integer]] to: 35.00
- -------- --------
- Set VariableSet MH_Distance[MH_Integer] = (MH_Distance[MH_Integer] + 43.50)
- Set VariableSet MH_PointTemp[2] = (MH_Point[MH_Integer] offset by MH_Distance[MH_Integer] towards MH_Angle[MH_Integer] degrees.)
- Special Effect - Set Position of MH_Missile[MH_Integer] to x: (X of MH_PointTemp[2]), y: (Y of MH_PointTemp[2]), z: 15.00
- -------- --------
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 100.00 of MH_PointTemp[2].) and do (Actions)
-
Loop - Actions
- Set VariableSet MH_UnitTemp = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (MH_UnitTemp is alive) Equal to True
- (MH_UnitTemp is A structure) Equal to False
- (MH_UnitTemp is An Ancient) Equal to False
- MH_UnitTemp Not equal to MH_Caster[MH_Integer]
- MH_Boolean[MH_Integer] Equal to False
-
Then - Actions
- Set VariableSet MH_Boolean[MH_Integer] = True
- Set VariableSet MH_UnitHooked[MH_Integer] = MH_UnitTemp
- Unit - Turn collision for MH_UnitTemp Off.
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (MH_UnitTemp belongs to an enemy of (Owner of MH_Caster[MH_Integer]).) Equal to True
-
Then - Actions
- Special Effect - Create a special effect attached to the origin of MH_UnitTemp using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Cause MH_Caster[MH_Integer] to damage MH_UnitTemp, dealing MH_Damage[MH_Integer] damage of attack type Chaos and damage type Universal
- Unit - Pause MH_UnitTemp
- Unit - Create 1 Vision Dummy (500/500 Flying Vision) for (Owner of MH_Caster[MH_Integer]) at MH_PointTemp[2] facing Default building facing degrees
- Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
Loop - Actions
- Custom script: call RemoveLocation (udg_MH_PointTemp[1])
- Custom script: call RemoveLocation (udg_MH_PointTemp[2])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Counter[MH_Integer] Greater than or equal to 29
-
Then - Actions
- Set VariableSet MH_Boolean[MH_Integer] = True
- Else - Actions
-
If - Conditions
-
Else - Actions
- -------- --------
- -------- PULL BACK CHAIN --------
- -------- --------
- Special Effect - Destroy MH_Chain[MH_Counter[MH_Integer]]
- Set VariableSet MH_Distance[MH_Integer] = (MH_Distance[MH_Integer] - 43.50)
- Set VariableSet MH_PointTemp[1] = (MH_Point[MH_Integer] offset by MH_Distance[MH_Integer] towards MH_Angle[MH_Integer] degrees.)
- Special Effect - Set Position of MH_Missile[MH_Integer] to x: (X of MH_PointTemp[1]), y: (Y of MH_PointTemp[1]), z: 15.00
- Unit - Move MH_UnitHooked[MH_Integer] instantly to MH_PointTemp[1]
- -------- --------
- Set VariableSet MH_Counter[MH_Integer] = (MH_Counter[MH_Integer] - 1)
- -------- --------
- Custom script: call RemoveLocation (udg_MH_PointTemp[1])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Counter[MH_Integer] Equal to 0
-
Then - Actions
- Unit - Turn collision for MH_UnitHooked[MH_Integer] On.
- Unit - Unpause MH_UnitHooked[MH_Integer]
- Special Effect - Destroy MH_Missile[MH_Integer]
- -------- --------
- Set VariableSet MH_Caster[MH_Integer] = MH_Caster[MH_Index]
- Set VariableSet MH_Damage[MH_Integer] = MH_Damage[MH_Index]
- Set VariableSet MH_Counter[MH_Integer] = MH_Counter[MH_Index]
- Set VariableSet MH_Distance[MH_Integer] = MH_Distance[MH_Index]
- Set VariableSet MH_Boolean[MH_Integer] = MH_Boolean[MH_Index]
- Set VariableSet MH_UnitHooked[MH_Integer] = MH_UnitHooked[MH_Index]
- Set VariableSet MH_Point[MH_Integer] = MH_Point[MH_Index]
- Set VariableSet MH_Angle[MH_Integer] = MH_Angle[MH_Index]
- Set VariableSet MH_Missile[MH_Integer] = MH_Missile[MH_Index]
- -------- --------
- Set VariableSet MH_Index = (MH_Index - 1)
- Set VariableSet MH_Integer = (MH_Integer - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- MH_Index Equal to 0
-
Then - Actions
- Countdown Timer - Pause MH_Timer
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer MH_Integer) from 1 to MH_Index, do (Actions)
-
Events