Calculate damage over time

Archideas

Active Member
Reaction score
32
I'm trying to create a Maim like abiltity, where an enemy unit is targeted. The targeted unit then becomes slowed and suffers damage over time. This is the damage I'm as efficiently as possible am trying to deal to the unit over time.

Level 1 - 100 damage over 10 seconds
Level 2 - 140 damage over 11 seconds
Level 3 - 180 damage over 12 seconds

How do I achieve this by the most efficient triggering possible? I've gotten this far, but by no means it's nowhere accurate in damage.

Trigger:
  • Maim
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Maim
        • Then - Actions
          • Set Caster = (Casting unit)
          • Set TempTarget = (Target unit of ability being cast)
          • For each (Integer A) from 1 to (9 + ((Level of (Ability being cast) for Caster) + 1)), do (Actions)
            • Loop - Actions
              • Wait 1.00 seconds
              • Unit - Cause Caster to damage TempTarget, dealing ((Real((Level of (Ability being cast) for Caster))) x 50.00) damage of attack type Spells and damage type Normal
        • Else - Actions


I might have overlooked something really basic and simple, but I simply blame it on a temporary brainfart. :p
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Using a "Wait" inside an Integer A loop isn't a good idea...
You'd be much better off by using another trigger with the event "Every 1.00 seconds of game-time".

Does it need to be MUI ? (MUI = Multi-Unit-Instanceable)
 

Summoned

New Member
Reaction score
51
Use Shadow Strike (if active) or one of the many Poison Attack abilities like Envenomed Weapons (if passive). ;)
 

Archideas

Active Member
Reaction score
32
It is active, yeah. But I don't want the annoying text showing damage over and over.

*EDIT*

Oh, and it doesn't need to be MUI.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Ok, well, your damage calculation there were way off... It dealt way too much damage.
Here's the correct one, I'd believe:

Trigger:
  • Unit - Cause Caster to damage Target, dealing ((60.00 + ((Real((Level of Maim for Caster))) x 40.00)) / ((Real((Level of Maim for Caster))) + 9.00)) damage of attack type Spells and damage type Normal


And here are the triggers:

Trigger:
  • Maim
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Maim
    • Actions
      • Set Caster = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Trigger - Turn on Main DPS <gen>


This one, below, is "Initially Off":

Trigger:
  • Main DPS
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause Caster to damage Target, dealing ((60.00 + ((Real((Level of Maim for Caster))) x 40.00)) / ((Real((Level of Maim for Caster))) + 9.00)) damage of attack type Spells and damage type Normal
      • Set DPS_Tick = (DPS_Tick + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DPS_Tick Equal to ((Level of Maim for Caster) + 9)
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 

X.Terror.X

New Member
Reaction score
10
not sure if u can turn off the silence but if can u can use soul burn it also slows and has dps
 

NeosDany

Member
Reaction score
1
Maim is Learn
Event Unit Learns Skill
Condition Skill Learned = Maim
Action Set Variable : Maim_Integer(1)= Maim_Integer(1)+2
Set Variable : Maim_Integer(2)= Maim_Integer(2)+40
Set Variable : Maim_Integer(3)= Maim_Integer(3)+1
Maim is Used
Event Unit Starts The Effect of an ability
Condition
Action If (All Conditions are True) then do (Then Actions) else do (Else Actions)
IF: Condition Ability being cast : Maim
Then : Actions: Set Maim_Units(1) = ( casting unit )
Set Maim_Units(2) = ( Target unit of ability being cast )
Set Maim_Integer(4) = 100+ Maim_Integer(2)
Set Maim_Integer(5) = 8 + Maim_Integer(1)
Set Maim_Integer(6) = Maim_Integer(4) / Maim_Integer(5)
Action If (All Conditions are True) then do (Then Actions) else do (Else Actions)
IF: Condition Maim_Integer(3) = 1
wait 1
cause damage with Maim_Integer(6)
wait 2,3,4,5,6,7,8,9,10
IF: Condition Maim_Integer(3) = 2
wait 1
cause damage with Maim_Integer(6)
wait 2,3,4,5,6,7,8,9,10,11,12
IF: Condition Maim_Integer(3) = 3
wait 1
cause damage with Maim_Integer(6)
wait 2,3,4,5,6,7,8,9,10,11,12,13,14
IF: Condition Maim_Integer(3) = 4
wait 1
cause damage with Maim_Integer(6)
wait 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
Else: Actions:
 

Archideas

Active Member
Reaction score
32
@ Koma; that didn't work so well. It kept damaging the targeted unit over and over and over even after the desired amount had been dealt. I guess it has something to do with that the Integer DPS_Tick isn't set. What should it be? ;O
 

Komaqtion

You can change this now in User CP.
Reaction score
469
It's supposed to be set to 0...
Though it worked for me :S

Maybe add this to the first trigger ("Maim" I mean :D):
Trigger:
  • Set DPS_Tick = 0
 

MurderMode

Giving new meaning to co-op... slowly
Reaction score
154
check out this tutorial on the new hash tables in war3... it has an example of a heal over time spell using the hash tables... rather simple and in mui. You would then just need someone to show you how to jass out all of the leaks to complete it.
 

Archideas

Active Member
Reaction score
32
@ Koma, still keeps damaging the unit over time until it's dead. =/

@ Murder, I'll check it out, thanks.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Post your trigger maby you did something wrong
 

Archideas

Active Member
Reaction score
32
Trigger:
  • Maim
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Maim
    • Actions
      • Set DPS_Tick = 0
      • Set Caster = (Casting unit)
      • Set TempTarget = (Target unit of ability being cast)
      • Trigger - Turn on Maim DPS <gen>


Trigger:
  • Maim DPS
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause Caster to damage TempTarget, dealing (60.00 + ((Real((Level of Maim for Caster))) x (40.00 / ((Real((Level of Maim for Caster))) + 9.00)))) damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DPS_Tick Equal to ((Level of Maim for Caster) + 9)
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
You dont set DPS_Tick = DPS_Tick + 1 in your second trigger
 

Summoned

New Member
Reaction score
51
Edit: Beaten by the crazy frog.
Trigger:
  • Maim DPS
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • *************Set DPS_Tick = DPS_Tick + 1*************
      • Unit - Cause Caster to damage TempTarget, dealing (60.00 + ((Real((Level of Maim for Caster))) x (40.00 / ((Real((Level of Maim for Caster))) + 9.00)))) damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DPS_Tick Equal to ((Level of Maim for Caster) + 9)
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Your damage action there still doesn't look right...

Mine:
Trigger:
  • Unit - Cause Caster to damage Target, dealing ((60.00 + ((Real((Level of Maim for Caster))) x 40.00)) / ((Real((Level of Maim for Caster))) + 9.00)) damage of attack type Spells and damage type Normal


Yours:
Trigger:
  • Unit - Cause Caster to damage TempTarget, dealing (60.00 + ((Real((Level of Maim for Caster))) x (40.00 / ((Real((Level of Maim for Caster))) + 9.00)))) damage of attack type Spells and damage type Normal


It needs to be int the right order, or else it won't turn out right..
Notice that I have 2 parantheses in the beginning:
Code:
[COLOR="Red"](([/COLOR]60.00 + ((Real((Level of Maim for Caster))) x 40.00)) / ((Real((Level of Maim for Caster))) + 9.00))

And you only have one...
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Edit: Beaten by the crazy frog.
Trigger:
  • Maim DPS
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • *************Set DPS_Tick = DPS_Tick + 1*************
      • Unit - Cause Caster to damage TempTarget, dealing (60.00 + ((Real((Level of Maim for Caster))) x (40.00 / ((Real((Level of Maim for Caster))) + 9.00)))) damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DPS_Tick Equal to ((Level of Maim for Caster) + 9)
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

Yes thats what i said so no need to repeat me.
 

Archideas

Active Member
Reaction score
32
Trigger:
  • Maim DPS
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause Caster to damage TempTarget, dealing ((60.00 + (Real((Level of Maim for Caster)))) + (40.00 / ((Real((Level of Maim for Caster))) + 9.00))) damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DPS_Tick Equal to ((Level of Maim for Caster) + 9)
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions


This is what I got so far after editing. What am I missing since I don't get two ( after ((Real?
 
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