• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] (HELP) how to add additional damage to a spell using trigger

Status
Not open for further replies.
Level 2
Joined
Mar 1, 2016
Messages
10
Hi guys!

I've recently tried a hero ability called 'Fire Ball', it deals 50 damage + 3.2 * (caster's) intelligence points of damage to a target. I think I can't just use 'set life' option in trigger, because the intelligence bonus damages has to be dealt at the time the bolt physically hit the unit. Feel free to ask me if I didn't make something clear.

Any suggestions for me plz?

thank you
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
I don't really understand your problem.
If you want to deal damage just use
  • Unit - Cause YourCaster to damage YourTarget, dealing (50.00 + (3.20 x (Real((Intelligence of YourCaster (Include bonuses)))))) damage of attack type Spells and damage type Normal

So if you could describe more about what your problem is and what is it that you need, please do.
 
Level 2
Joined
Mar 1, 2016
Messages
10
I don't really understand your problem.
If you want to deal damage just use
  • Unit - Cause YourCaster to damage YourTarget, dealing (50.00 + (3.20 x (Real((Intelligence of YourCaster (Include bonuses)))))) damage of attack type Spells and damage type Normnal

So if you could describe more about what your problem is and what is it that you need, please do.


Right...
So I create a spell in object manager which deals 50 damage only, and I tried to add 3.2*intelligence damage to it on trigger editor.
If I use the event: When someone start casting a spell, then the intelligence damage will be dealt before the missile actually hit the unit, which looks weird. It's the timing of when the intelligence damage that troubles me.
 
Level 15
Joined
Sep 6, 2015
Messages
576
You could also use this to measure the distance and deliver the damage at the right time if you want:

  • Untitled Trigger 001
    • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Firebolt (Neutral Hostile)
    • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than or equal to 600.00
    • Then - Actions
    • Wait 0.40 seconds
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (50.00 + (3.20 x (Real((Intelligence of Blood Mage 0000 <gen> (Include bonuses)))))) damage of attack type Spells and damage type Normal
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than or equal to 400.00
    • Then - Actions
    • Wait 0.30 seconds
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (50.00 + (3.20 x (Real((Intelligence of Blood Mage 0000 <gen> (Include bonuses)))))) damage of attack type Spells and damage type Normal
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than or equal to 200.00
    • Then - Actions
    • Wait 0.20 seconds
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (50.00 + (3.20 x (Real((Intelligence of Blood Mage 0000 <gen> (Include bonuses)))))) damage of attack type Spells and damage type Normal
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than or equal to 0.00
    • Then - Actions
    • Wait 0.10 seconds
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (50.00 + (3.20 x (Real((Intelligence of Blood Mage 0000 <gen> (Include bonuses)))))) damage of attack type Spells and damage type Normal
    • Else - Actions
You would just have to calculate the wait times and change them so that the damage happens just as the fireball lands in each of these positions. You can also add more of these segments ("Else"s), for the distance scale to be more varied, if you want it to be more accurate.

Here's the test map in the attachment if you want to copy or test this:
 

Attachments

  • AddDmg.w3x
    17.7 KB · Views: 35
Level 3
Joined
Jun 18, 2016
Messages
68
You could also use this to measure the distance and deliver the damage at the right time if you want:

  • Untitled Trigger 001
    • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
    • (Ability being cast) Equal to Firebolt (Neutral Hostile)
    • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than or equal to 600.00
    • Then - Actions
    • Wait 0.40 seconds
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (50.00 + (3.20 x (Real((Intelligence of Blood Mage 0000 <gen> (Include bonuses)))))) damage of attack type Spells and damage type Normal
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than or equal to 400.00
    • Then - Actions
    • Wait 0.30 seconds
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (50.00 + (3.20 x (Real((Intelligence of Blood Mage 0000 <gen> (Include bonuses)))))) damage of attack type Spells and damage type Normal
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than or equal to 200.00
    • Then - Actions
    • Wait 0.20 seconds
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (50.00 + (3.20 x (Real((Intelligence of Blood Mage 0000 <gen> (Include bonuses)))))) damage of attack type Spells and damage type Normal
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) Greater than or equal to 0.00
    • Then - Actions
    • Wait 0.10 seconds
    • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (50.00 + (3.20 x (Real((Intelligence of Blood Mage 0000 <gen> (Include bonuses)))))) damage of attack type Spells and damage type Normal
    • Else - Actions
You would just have to calculate the wait times and change them so that the damage happens just as the fireball lands in each of these positions. You can also add more of these segments ("Else"s), for the distance scale to be more varied, if you want it to be more accurate.

Here's the test map in the attachment if you want to copy or test this:
if you use wait, does it leak or what??
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
For the best result, use a DDS (damage detection system)
A missile system is still preferred.
A DDS would require spell damage detection and detection of which spell hit the target, which means that the bolt had to be fired by a dummy unit which means that the damage doesnt come from the actual caster... which means... horrible.

You could also use this to measure the distance and deliver the damage at the right time if you want:
That is quite a horrible way to calculate the estimated time.
A better way is (distance between units / missile speed).
Even then, you dont have an accurate moment of impact if the target is moving and waits are inaccurate as well up to a few seconds in multiplayer.

My missile system might not be the best there is, but you dont have to understand JASS, there are some good examples in the test map and you can do almost anything with it if you get used to how it works.
 
Level 15
Joined
Sep 6, 2015
Messages
576
That is quite a horrible way to calculate the estimated time.
A better way is (distance between units / missile speed).
Even then, you dont have an accurate moment of impact if the target is moving and waits are inaccurate as well up to a few seconds in multiplayer.
Ye, I know, for that one we would need an accurate physics or mathematics formula distance/missile speed +- a value depending on the unit direction of moving and unit moving speed as the accurate wait time. Maybe he could use a unit that has the missile model instead of the missile, create and set it to patrol to target unit of ability being cast when the spell is cast and explode it when it reaches the target and then deal spell damage + added damage based on intelligence to the target of the spell.
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
Ye, I know, for that one we would need an accurate physics or mathematics formula distance/missile speed +- a value depending on the unit direction of moving and unit moving speed as the accurate wait time.
If you do get the correct formula, you still won't get the correct timing by using wait.

Maybe he could use a unit that has the missile model instead of the missile, create and set it to patrol to target unit of ability being cast when the spell is cast and explode it when it reaches the target and then deal spell damage + added damage based on intelligence to the target of the spell.
Wietlol's missile system is still a much better solution than that.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Maybe he could use a unit that has the missile model instead of the missile, create and set it to patrol to target unit of ability being cast when the spell is cast and explode it when it reaches the target and then deal spell damage + added damage based on intelligence to the target of the spell.
Yea... except that is exactly what a missile system does.
With the exception of using patrol, instead you move it by triggers to control the movement and you use range checks on nearby units to see if they collide.
 
Status
Not open for further replies.
Top