• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Pugde hook spell

Status
Not open for further replies.
Why do you need to write it yourself? The spell section is full of them.

But here you go.

Event - Unit Casts Ability
Condition - Ability = Meat Hook
Set Variables
Set i = i + 1 (Learn how) this is for indexing, I will let you learn that from the tutorial. I won't show it in this demo here.
Caster = c
Postion of Caster = cp
Target point of ability cast = tp
D = 600
Abiliy being cast Level = L
Create 1 meat hook for neutral passive at cp
Set last created unit = dummy
Pause Caster
Play caster's attack animation
Turn on Next Trigger​

Next trigger

Event - every .03 seconds
Actions -
Set distance from cp to tp = x
Conditions
If x is less than (D * (L * 100))
Set UnitHoked = true
then
set a = angle from cp to tp
Set dp = (position of Dummy)
set dp = cp offset by 10 toward a degrees
Create ChainUnit at dp
Set ChainDummy[x] = (last created unit)
Move dummy instantly to dp facing a degrees
Set ug = (All units within 75 of dp)
Pick all units in ug and loop
If Conditions are true
picked unit is an enemy of owner of caster
UnitHooked = false
then
Pause picked unit
Cause Caster to do damage to picked unit 50
Set (picked unit) = HookedUnit​

Else -
Set tp = cp
Set cp = dp
set a = angle from tp to cp
Set dp = (position of Dummy)
set dp = dp offset by 10 toward a degrees
Move dummy instantly to dp facing a degrees
Remove ChainDummy[x]
If UnitHoked = true
Then
Move HokedUnit instantly to dp
Else
If x less than 50 then do
Unpause Caster
UnPause HookedUnit
Damage HokedUnit again
Remove Dummy
Turn off this trigger
Deindex
Destroy Leaks
 
Level 15
Joined
Aug 14, 2007
Messages
936
Since the codes are out I will just do a layman explaination. After pudge cast the hook, the program pause pudge activates the render function. During the render pudge hook will check for distance and for hook target else it travels forth, if there is someone hooked or when the distance is reach it travels in reverse and the other checks for when the hook returns. Once it's done the caster is return to normal it's very simple.

Edit; Thus, pudge wars was made to complicate things and add more entertainment to the already overpower (if it lands) ability on itself.
 
Status
Not open for further replies.
Top