• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Hook hold and Somersault v1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Two spells that using Troll berseker (because of animations).

[HOOK HOLD]
-Troll can cast the spell to picked enemy in 600 range of type: Ally, friend, enemy, organic, earth, air.

{Effect}
-Troll create a hook, that will holding the target enemy or ally (if enemy, he will be damaged), the target is holding and he cant move, but he can attack and cast spells.
The unit is damaged (if it is enemy of the caster) every 0.03 secs.When Troll pulling the hook more, then more damage target unit will get every second.Troll can moving, the hook will follow him (so target will follow hook).

{Hook}
-Hook responds: Physic (gravity and adhesion.)
-if troll change his flying height, the hook will change his height too (that same for target).
Hook last 6 seconds, after he is removed and cleaned up.Target is freed too (if he survive).


[SOMERSAULT]
- Troll jump back somersault (he can jumping over units, trees and blocks, water etc...)
In air he is very fast (So if you use hook and somersault, the target will get more damage)
After impact, he is faster for a few seconds (25%).

{Spells}
Both spells are 100% MUI, no leaks, use able, no lagging if you using it.

Please rate and comment!




Keywords:
special, hook, hooks, hold, holding, somersault, sault, back, troll, berseker, troll berseker, bloody, blood, hooked, physic, air, damage
Contents

Hook hold and Somersault (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 22:44, 11th Aug 2010 hvo-busterkomo: The coding was decent overall, I like the spells' effects very much, and they're fairly original. However, I have some script complaints. Don't...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long time as NeedsFix. Rejected.

22:44, 11th Aug 2010
hvo-busterkomo: The coding was decent overall, I like the spells' effects very much, and they're fairly original. However, I have some script complaints.
  • Don't base somersault on Wind Walk. It prevents the spell from being cast while the movement speed bonus is still in effect.
  • Use a separate group for the HookEffect trigger. Looping through all the units on the map is unneeded.
  • Destroy the group after the group is looped through.
  • Unit custom values are unneeded since you use a hashtable already.
  • You look a special effect every 0.03 seconds in HookEffect.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
quite good (especially the height support) but there still are a few bugs
1. if you cast hook with the same unit it won't destroy the old dummys (best use the id of a dummy instead of the one of the caster)
2. if you jump shortly before the hook is over the target will just stay in the air (just reset the height after the spell is over)
3. it fucks up with unpathable terrain so you can make units stuck (either check the pathing using an item or the worse blizzard alternative)
4. the jump will make units get outside of the map, make them stuck and might cause critical errors (add bound checking)

other things:
- your loop trigger is rather unefficient (picking ALL units in the map every 0.03 seconds WILL lag if there are enough of them, better only pick the units which are necessary)
- destroying the group should be done after every unit in the group was picked
- you don't have to set booleans/integers to 0/false after u used them
- you are leaking stuff in the hashtable (use "clear all childs of handle id of unit)
- add documentation to the code so everyone knows what's going on in it
- SetUnitX/Y does ignore pathing so you don't have to disable it manually
- since you are using coordinates for SetUnitX/Y you should avoid locations since they are a little bit slower
- there are more realistic ways of making a jump spell (search for "parabola", "jump parabola", "GetParabolaZ" etc)
- you don't have to add and remove the fly ability everytime you change the height, once is enough
- you are leaking a special effect in the hook loop trigger
- avoid using custom values since you can easily store everything in a hashtable
- avoid using IntegerA/B since they might be used for other things and fuck up everything (better create your own counter variable)

all in all one can say that on the one hand there are still many things to improve and the idea is old but on the other hand a hook spell is rather complex so it's not suprising that one makes mistakes

Hooks
Jumps
Leaps
 

Attachments

  • bugs.jpg
    bugs.jpg
    584.6 KB · Views: 168
Level 3
Joined
Aug 20, 2010
Messages
71
try fixing 3 things 1st you should set the hight of the hooked unit and when hook ends up set the hight for the hooked unit to x variable
(the same for movement type)
2nd there is a bug with Gyphon Rider: if you hook this unit it becomes demon hunter !!
 
Top