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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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