SpasMaster
Hosted Project: SC
- Joined
- Jan 29, 2010
- Messages
- 1,994
Hello, Hive.
Recently, I wanted to create a passive spell with the following effect:
Here are the steps I took to make it work:
1) In my Damage Engine (Damage Engine 3.7.0.1), I permanently reduce the damage taken by the Monk Hero (the one with the ability) by 40%.
2) Then I have 2 triggers: In the first, I set the amount of Staggered damage. In the second, a dummy unit [Dummy (Stagger)] deals the damage over 5 seconds.
Here is the problem; Any form of damage reduction (including default Armor) would replace the <StaggeredDamage_Taken> variable:
Let's assume <StaggeredDamage_Taken> is registered at 100 at the 1st trigger.
<StaggeredDamage> then becomes 0 + 67 = 67.
After 5 seconds
<StaggeredDamage> then becomes 67 - 67 = 0.
That's all fine. But things look different if I have some damage reduction.
Let's assume <StaggeredDamage_Taken> is registered at 100 at the 1st trigger.
<StaggeredDamage> then becomes 0 + 67 = 67.
Let's assume I then activate an ability that reduces damage by 20%. And then I get damaged again.
<StaggeredDamage_Taken> is 80.
<StaggeredDamage> then becomes 67 + 53,6 = 120,6.
After 5 seconds
<StaggeredDamage> then becomes 120,6 - 53,6 = 67 [*]
<StaggeredDamage> then becomes 67 - 53,6 = 13,4
The result, as you can see, is I have 13,4 damage left, while it should be 0.
Basically, <StaggeredDamage_Taken> gets overwritten by the reduced amount (53,6) instead of remembering the initial value which was (67) as can be seen next to the red star above.
I am looking for advises regarding how to approach this system. How do I trigger this effect in a way where it would not overwrite the <StaggeredDamage_Taken> value?
Thanks in advance.
Recently, I wanted to create a passive spell with the following effect:
Stagger (Passive): You shrug off 40% of incoming damage, instead delaying it over 5 seconds. |
Here are the steps I took to make it work:
1) In my Damage Engine (Damage Engine 3.7.0.1), I permanently reduce the damage taken by the Monk Hero (the one with the ability) by 40%.
2) Then I have 2 triggers: In the first, I set the amount of Staggered damage. In the second, a dummy unit [Dummy (Stagger)] deals the damage over 5 seconds.
[trigger=""]
Stagger
Events
Game - DamageEvent becomes Equal to 1.00
Conditions
DamageEventAmount Not equal to 0.00
(Unit-type of DamageEventSource) Not equal to Dummy (Stagger)
DamageEventTarget Equal to Hero_Monk
Or - Any (Conditions) are true
Conditions
(Owner of DamageEventSource) Equal to Player 10 (Light Blue)
(Owner of DamageEventSource) Equal to Player 12 (Brown)
(Owner of DamageEventSource) Equal to Neutral Hostile
Actions
Set StaggeredDamage_Taken = DamageEventAmount
Set StaggeredDamage = (StaggeredDamage + (0.67 x StaggeredDamage_Taken))
Wait 5.00 game-time seconds
Set StaggeredDamage = (StaggeredDamage - (0.67 x StaggeredDamage_Taken))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StaggeredDamage Less than 0.00
Then - Actions
Set StaggeredDamage = 0.00
Else - Actions
[/trigger]
Stagger
Events
Game - DamageEvent becomes Equal to 1.00
Conditions
DamageEventAmount Not equal to 0.00
(Unit-type of DamageEventSource) Not equal to Dummy (Stagger)
DamageEventTarget Equal to Hero_Monk
Or - Any (Conditions) are true
Conditions
(Owner of DamageEventSource) Equal to Player 10 (Light Blue)
(Owner of DamageEventSource) Equal to Player 12 (Brown)
(Owner of DamageEventSource) Equal to Neutral Hostile
Actions
Set StaggeredDamage_Taken = DamageEventAmount
Set StaggeredDamage = (StaggeredDamage + (0.67 x StaggeredDamage_Taken))
Wait 5.00 game-time seconds
Set StaggeredDamage = (StaggeredDamage - (0.67 x StaggeredDamage_Taken))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StaggeredDamage Less than 0.00
Then - Actions
Set StaggeredDamage = 0.00
Else - Actions
[/trigger]
[trigger=""]
Stagger Periodic
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StaggeredDamage Greater than 0.00
Then - Actions
Unit - Cause Stagger_Dummy to damage Hero_Monk, dealing (0.20 x StaggeredDamage) damage of attack type Spells and damage type Magic
Else - Actions
[/trigger]
Stagger Periodic
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
StaggeredDamage Greater than 0.00
Then - Actions
Unit - Cause Stagger_Dummy to damage Hero_Monk, dealing (0.20 x StaggeredDamage) damage of attack type Spells and damage type Magic
Else - Actions
[/trigger]
Here is the problem; Any form of damage reduction (including default Armor) would replace the <StaggeredDamage_Taken> variable:
Let's assume <StaggeredDamage_Taken> is registered at 100 at the 1st trigger.
<StaggeredDamage> then becomes 0 + 67 = 67.
After 5 seconds
<StaggeredDamage> then becomes 67 - 67 = 0.
That's all fine. But things look different if I have some damage reduction.
Let's assume <StaggeredDamage_Taken> is registered at 100 at the 1st trigger.
<StaggeredDamage> then becomes 0 + 67 = 67.
Let's assume I then activate an ability that reduces damage by 20%. And then I get damaged again.
<StaggeredDamage_Taken> is 80.
<StaggeredDamage> then becomes 67 + 53,6 = 120,6.
After 5 seconds
<StaggeredDamage> then becomes 120,6 - 53,6 = 67 [*]
<StaggeredDamage> then becomes 67 - 53,6 = 13,4
The result, as you can see, is I have 13,4 damage left, while it should be 0.
Basically, <StaggeredDamage_Taken> gets overwritten by the reduced amount (53,6) instead of remembering the initial value which was (67) as can be seen next to the red star above.
I am looking for advises regarding how to approach this system. How do I trigger this effect in a way where it would not overwrite the <StaggeredDamage_Taken> value?
Thanks in advance.