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

Explode unit if died of a projectile

Status
Not open for further replies.
Level 19
Joined
Apr 21, 2013
Messages
1,194
Hey guys, i created a cutom spell which an archer unit fires a projectile(like windrunner's powershot) and it cuts through enemies, with damaging everyone in its path.

The point is, i want to explode the units if they die from this projectile. I am trying to change the projectile with a dummy unit like;

if a unit dies and it's within 100 range of the projectile(dummy) explode the unit.

but i couldnt manage to succeed. Another question i want to ask is, is it possible to make this without using dummy unit. I mean, this spell is created only from object manager no imported stuff or any triggers.

All help is appreciated :)
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Are you dealing damage to the unit in range? If so then you can check the remaining hitpoints of the unit and if it is less than the damage then use SetUnitExplodeBJ (I don't know the trigger label for it sorry) before you apply the damage.

EDIT: You don't need to apply the damage anymore, the BJ (the one available on gui triggers) function kills the unit immediately.
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
yeap the projectile(a spear in this spell) goes a range of 800 distance in first level and i decided to hit damage to every organic units within 100 range of the moving spear.

Well, for the if the unit's life is under 100(for example(the spell damage)) and if the unit's within 100 range of spear then explode the unit i couldnt find the neccessary event :((
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
You don't need an event for that, just a condition.
  • Sample
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (YourTargetUnit)) Less than or equal to Spell_Damage
        • Then - Actions
          • Unit - Explode YourTargetUnit
        • Else - Actions
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Oh, I see... I'll try to think of something.
@off-topic: Please don't double post, just use the edit mode when you want to add more stuff to your previous post. Thanks :D

EDIT: I'm sorry dude, I can't think of anything that can be used to detect that, if it was triggers then it would be possible (in my case). Don't lose hope though, just wait, maybe someone might be able to help you.
 
Status
Not open for further replies.
Top