• 🏆 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!

[Spell] Locust Swarm

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
339
Hello guys, i am using locust swarm as a summon for an hawk, i've made it last 3600 seconds, and be only 1 at a time, when i recast it after some time, my hero dies, why does that happen?
And also, how can i make the hawk heal the caster for 10% of damage dealt? Tried something with DDS 3.8 but it heals the hawk instead of the caster.. thanks !
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,457
Do you track your Hero with a variable? If your map is like DotA where you only control 1 Hero then you should be tracking Heroes with a Unit array:
  • Set Variable PlayerHero[1] = Player 1's hero
  • Set Variable PlayerHero[2] = Player 2's hero
  • etc...

Then when the Hawk deals damage you can reference the Hero:
  • Unit - Set life of PlayerHero[Player number of (Owner of (DamageEventSource))] to...

Or you can use a Unit Indexer to link the Hawk/Hero together. It's basically the same concept but you use Custom Value instead of Player Number.

Not sure about the death bug but it could have something to do with the Hawk returning negative amounts of life to the caster?

Also, if you want the ability to last forever then set it's Duration to 0 seconds. This usually works.
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
339
For locust swarm, duration to 0 doesn't spawn it, it's the only summon type abbility that doesn't make it permanent i guess..

Edit: I have Unit Indexer because DDS uses it, but i am not sure how to make it work to link hero/unit, i think i'd better trigger the summon hawk and mimic locust swarm attack/move?
Like create 1 hawk for owner of. at location of.

and have a periodic trigger every 1 second
if hawk is summoned
then order hawk to move to position of hawk offset by 250 facing 0-360 degrees
else attack random unit within position of hawk
 
Last edited:
Status
Not open for further replies.
Top