• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Damage over Time

Status
Not open for further replies.
Level 4
Joined
Nov 17, 2007
Messages
57
Hi :) I tried to make a trigger causing like, intellect x 2 over 10 seconds - but how is this possible? I need it for a spell which cause intellect x 2 initial damage, and then intellect x 1 over 5 seconds. I based the spell on Rejuvenation, but there i can only give a flat number (i think) and i cant find it in triggers, help please :)
 
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (ability being cast) equal to *ability*
  • Actions
    • Custom script: local unit u
    • For each Integer A from 1 to 10 do:
      • Unit - Cause (Triggering unit) to damage u, dealing ((Real((Intelligence of (Triggering unit) (Include bonuses)))) * 2) damage of attack type Chaos and damage type General
      • Wait 1.00 seconds
    • For each Integer A from 1 to 5 do:
      • Unit - Cause (Triggering unit) to damage u, dealing (Real((Intelligence of (Triggering unit) (Include bonuses)))) damage of attack type Chaos and damage type General
      • Wait 1.00 seconds
though I'm not really concerned with making spells mui, so correct me if I'm wrong
 
intellect=intelligence?

if yes, deal intelligence*2 damage to the target

GUI: set variable to casting unit and one to target unit. then set a real variable to intelligence of castingunit/5 and make a loop with a 1 sec wait and deal the damage of the real variable to target unit. Careful with MUI!

JASS: Nearly the same as above but use locals so it becomes MUI. you could also add the factor when the damage is dealt. e.g. every 0.1 seconds => set the real variable to intelligence/50 and the polledwait to 0.1 (yes, this could also be done in gui, i know, but its easier in jass i think:P )

greetz

edit: squiggy you dont set u to a unit. And he means he wants the seconds spell not both spells in one spell^^
oh and why did u post right before me? :( damn^^
 
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (ability being cast) equal to *ability*
  • Actions
    • Custom script: local unit u
    • For each Integer A from 1 to 10 do:
      • Unit - Cause (Triggering unit) to damage u, dealing ((Real((Intelligence of (Triggering unit) (Include bonuses)))) * 2) damage of attack type Chaos and damage type General
      • Wait 1.00 seconds
    • For each Integer A from 1 to 5 do:
      • Unit - Cause (Triggering unit) to damage u, dealing (Real((Intelligence of (Triggering unit) (Include bonuses)))) damage of attack type Chaos and damage type General
      • Wait 1.00 seconds

You didn't initialize the variable nor nulled it :/

In the first line edit it to be
  • Custom script: local unit u = GetSpellTargetUnit()
And at the end add
  • Custom script: set u = null
Also, for this to work in GUI, you'll probably want to make a global variable called "u" or whatever you want, then in the first line instead of that "local unit u" write "local unit udg_YourVariableName".
In this example it would be "local unit udg_u".
 
uhm, thx lots everyone but GhostWolf could you please make the trigger as it should be then? and "For Each Integer A From 1 to 10 Do:" <- i cant do that, i think.. i gotta type something at the end like "Do Nothing"

And what is the Custom Script for?
 
here you go, should work

  • ability
    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • (Ability being cast) equal to *ability*
    • Actions
      • Custom script: local unit u=GetSpellTargetUnit()
      • Custom script: local unit t=GetTriggerUnit()
      • Custom script: local real g=I2R(GetHeroInt(t,true))
      • Custom script: call UnitDamageTarget(t,u,g*2,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC,null)
      • Custom script: set g=g/5
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Wait 1.00 seconds
          • Custom script: call UnitDamageTarget(t,u,g,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC,null)
      • Custom script: set u=null
      • Custom script: set t=null
edit: as is just see, its completely JASS...xD
But that's an effiecnt method:P
 
Uhm, i just did as you said bReathl3sS, but when i wanna use my ability on an enemy unit theres just that crosshair over them, its not blinking and it gives me no warning when i want to cast it, even tho i cant cast it. When i try cast it on a unit i got, then it says i cant target my own units, what is this? :o
 
hmmm, base the ability on another spell, for example storm bolt. give storm bolt a stun of 0.01 and a damage of 0 and let the hammer fly with no model at a speed of maximum.
Then try it again.
And tell me which unit is casting the spell (building, unit, has the building an attack?) and which unit should be the target (enemy, friend, neutral&enemies, buildings, mechanical, ...)
 
It's probably because of the spell you based it on. In reality, you can really use any spell you can find that targets an opponent but has the ability not to do anything. Frost nova with all values nulled and zeroed will work for this purpose. Just rename it to what you need. Stormbolt still stuns when set to 0.01, and infinitely at 0.00.
 
now you can improve the code with 1 thing:
if you want the damage to be dealt every .1 second (so it looks better) and not every 1 seconds change the following lines:


  • Custom script: set g=g/50
damage is now 1/50 per interval, not 1/5!
  • For each (Integer A) from 1 to 50, do (Actions)
1 to 50, not 5
  • Loop - Actions
    • Wait 0.10 seconds
0.10 not 1.00

have fun
 
Status
Not open for further replies.
Back
Top