• 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.

How to make a damage over time spell?

Status
Not open for further replies.
Level 8
Joined
Aug 8, 2008
Messages
340
Hello I am having a problem here, so plz help me if you can.
I am trying to make a spell that deals 30 damage every second for 5 seconds. But I can only make it deal damage once by using (Target unit of ability begin casted) The spell i am using for it is Entangling Roots (The damage has to be of the type chaos)
 
Level 6
Joined
May 19, 2004
Messages
267
As (Target Unit of Ability being cast) is lost between waits, you'll need a local global for this.
Do a search on "local global" or "local GUI" and you should find some answers.
 
Level 6
Joined
May 19, 2004
Messages
267
That won't work for multi-casts of the ability, that's why he needs the local.

It's something like "local unit udg_TempUnit"
Where udg_TempUnit is a GUI variable named "TempUnit"
 
Level 11
Joined
Feb 16, 2009
Messages
760
  • Custum Roots
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Entangling Roots
    • Actions
      • Unit - Create 1 Dummy for Player 1 (Red) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
      • Unit - Add a (10.00 x (Real((Level of (Ability being cast) for (Casting unit))))) second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Attack (Target unit of ability being cast)
I tested it and it works. you can adjust the duration by changing (10.00 x (Real((Level of (Ability being cast) for (Casting unit)))))
EDIT: The dummy unit must have 30 chaos attack with 5 second cooldown. If it wasn't obvious.
It can contain memory leaks, but I don't know how to remove that. Modify entangling roots and make a dummy unit for this to work. Good luck.
 
Last edited:
Level 8
Joined
Mar 12, 2008
Messages
437
^ Interesting trigger, I never thought of solving DoT spells that way.
Leaks can be cleaned out by storing the point as a variable and then using the custom script "call RemoveLocation(udg_Point)" if the variable name is "Point".
 
Level 8
Joined
Aug 8, 2008
Messages
340
Well thanks for the help so far all of you, but now I got another problem... I can't fiend the "Unit - Add a (10.00 x (Real((Level of (Ability being cast) for (Casting unit))))) second Generic expiration timer to (Last created unit)" What do I do???
 
Level 3
Joined
Mar 2, 2008
Messages
62
Well thanks for the help so far all of you, but now I got another problem... I can't fiend the "Unit - Add a (10.00 x (Real((Level of (Ability being cast) for (Casting unit))))) second Generic expiration timer to (Last created unit)" What do I do???



Unit - Add Expiration Timer
 
Level 12
Joined
Aug 22, 2008
Messages
911
Arithmetic:
10.00 x Real((Level of Ability being cast)for (Casting Unit))
10.00 is entered by you as a value, and Real means converting an integer number to a real number. Level of Ability being cast is found in the Unit section.
 
Status
Not open for further replies.
Top