Dirac
22710180
- Reaction score
- 147
Curved Ice Chain - By Dirac
Based in DotA's Meat Hook i decided to create a version of a hook that bends, increasing probabilities to catch the enemy and style . If you're not good at maths stay away from the code, it uses some complex formulas at it (some of them are hard to explain for me)
The Code:
Thnx to Tinki3 for the Map
Report any bugs/leaks
Credit if used
-Dirac
Based in DotA's Meat Hook i decided to create a version of a hook that bends, increasing probabilities to catch the enemy and style . If you're not good at maths stay away from the code, it uses some complex formulas at it (some of them are hard to explain for me)
The Code:
Trigger:
- Curved Ice Chain
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Curved Ice Chain
- Actions
- Set CICpoint[1] = (Position of (Casting unit))
- Set CICpoint[2] = (Target point of ability being cast)
- Set Viking = (Casting unit)
- Set CICspotinit = (CICpoint[1] offset by ((Cos(CICangle)) x ((Distance between CICpoint[1] and CICpoint[2]) / 1.00)) towards ((Angle from CICpoint[1] to CICpoint[2]) - CICangle) degrees)
- Trigger - Turn on Curved Ice Chain Shot <gen>
- Events
Trigger:
- Curved Ice Chain Shot
- Events
- Time - Every 0.01 seconds of game time
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- CICslide Greater than or equal to (((Real((Level of Curved Ice Chain for Viking))) x (30.00 - ((Distance between CICpoint[1] and CICpoint[2]) / 100.00))) + 5.00)
- CICtarget Equal to No unit
- Then - Actions
- Trigger - Turn on Curved Ice Chain Back <gen>
- Trigger - Turn off (This trigger)
- Skip remaining actions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- CICtarget Not equal to No unit
- Then - Actions
- Set TempPoint = (Position of CICdummys[(Integer(CICslide))])
- Unit - Move CICtarget instantly to TempPoint
- Custom script: call RemoveLocation (udg_TempPoint)
- Unit - Remove CICdummys[(Integer(CICslide))] from the game
- Set CICslide = (CICslide - 1.00)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- CICslide Equal to 0.00
- Then - Actions
- Trigger - Turn off (This trigger)
- Set CICtarget = No unit
- Set CICslide = 0.00
- Set CICangle = 45.00
- Custom script: call RemoveLocation (udg_CICspotinit)
- Custom script: call RemoveLocation (udg_CICpoint[1])
- Custom script: call RemoveLocation (udg_CICpoint[2])
- Else - Actions
- If - Conditions
- Skip remaining actions
- Else - Actions
- If - Conditions
- Set CICslide = (CICslide + 1.00)
- Set CICangle = (CICangle + 0.20)
- Set CICspot = (CICspotinit offset by (CICslide x 4.00) towards ((Angle from CICpoint[1] to CICpoint[2]) - 0.00) degrees)
- Set TempPoint = (CICspot offset by ((Cos(CICangle)) x (Distance between CICpoint[1] and CICpoint[2])) towards ((Angle from CICspot to CICpoint[1]) - (CICslide x (2800.00 / (Distance between CICpoint[1] and CICpoint[2])))) degrees)
- Unit - Create 1 BH Progectile for (Owner of Viking) at TempPoint facing (((Angle from CICspot to (CICspot offset by ((Cos(CICangle)) x (Distance between CICpoint[1] and CICpoint[2])) towards ((Angle from CICspot to CICpoint[1]) - (CICslide x (2800.00 / (Distance between CICpoint[1] and CICpoint[2])))) degrees)) + 0.00) - 90.00) degrees
- Custom script: call RemoveLocation (udg_CICspot)
- Custom script: call RemoveLocation (udg_TempPoint)
- Set CICdummys[(Integer(CICslide))] = (Last created unit)
- Set TempGroup = (Random 1 units from (Units within 130.00 of (Position of (Last created unit)) matching ((((Matching unit) is A structure) Equal to False) and ((Matching unit) Not equal to Viking))))
- Unit Group - Pick every unit in (Random 1 units from TempGroup) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) is dead) Equal to False
- Then - Actions
- Set CICtarget = (Picked unit)
- Special Effect - Create a special effect attached to the origin of CICtarget using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Picked unit) belongs to an enemy of (Owner of Viking)) Equal to True
- Then - Actions
- Unit - Cause Viking to damage CICtarget, dealing ((Real((Level of Curved Ice Chain for Viking))) x 100.00) damage of attack type Spells and damage type Normal
- Else - Actions
- If - Conditions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Custom script: call DestroyGroup (udg_TempGroup)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Trigger:
- Curved Ice Chain Back
- Events
- Time - Every 0.01 seconds of game time
- Conditions
- Actions
- Unit - Remove CICdummys[(Integer(CICslide))] from the game
- Set CICslide = (CICslide - 1.00)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- CICslide Equal to 0.00
- Then - Actions
- Trigger - Turn off (This trigger)
- Set CICangle = 45.00
- Custom script: call RemoveLocation (udg_CICpoint[1])
- Custom script: call RemoveLocation (udg_CICpoint[2])
- Custom script: call RemoveLocation (udg_CICspotinit)
- Else - Actions
- If - Conditions
- Events
Report any bugs/leaks
Credit if used
-Dirac