Detect if unit has been hit by a non-targeted spell

Versae

New Member
Reaction score
0
Right now I have a dummy spell based on Carrion Swarm, and what I want to do is that units hit by this spell will take damage equal to x*(caster's missing mana percentage). I know how to calculate the damage and how to damage the units with it, but I'm stuck on how to detect whether a unit has been hit by the Carrion Swarm.

This is my trigger right now:
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mana Wave
    • Actions
      • Set ManaWaveDMG = ((Level of Mana Wave for (Casting unit)) x (Integer(((((Max mana of (Casting unit)) - (Mana of (Casting unit))) / (Max mana of (Casting unit))) x 100.00))))
      • Set Temp_Group = Here's where I'm stuck
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Cause (Casting Unit) to damage (Picked Unit), dealing ManaWaveDMG damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Set ManaWaveDMG = 0


And the ability Mana Wave is just Carrion Swarm which does not deal any damage.
 

death_knight

Dark is the heart of a corrupted man.
Reaction score
24
Well is the spell and AoE spell? Because if it is, then an easy way of doing it is to give all units within a radius of the centre of the AoE a buff and then damage all the units with the buff.
 

dracolich

TH.net Regular
Reaction score
15
stop using real ability, use clear triggers for moving projectile, grouping and other stuff.
believe me, scriptkidding (wc3's jass is also, but its offtopic) on gui wont work, better to find out some basics in jass.
well, as answer - check snippets and systems for moving custom projectiles
 

denmax

You can change this now in User CP.
Reaction score
155
Your going to be making a lot of work, because first you'll need to know how to push units (e.g. for Dota, Force Staff, Greater Bash, others) and use dummy projectiles. If you don't know either, I suggest you start learning them.

Staying in GUI would mean you're going to make some extra effort into making it MUI.

Basically what you're going to do is after you've cast a spell, you create a unit. This unit should have a small vision, locust, and invulnerability, no shadow, the works for dummy units - except this one actually has a model, which is the projectile you want to use.

After creating the unit, you're going to have to set it to a variable, and turn on an external trigger that will push the unit (this is the simpler GUI method, but this cries "DIRTY"). For every instance of push, it's going to pick units around it, with the condition it has not been picked before, and deal damage after so. When it reaches at a certain distance, kill the dummy projectile.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top