Hey Norris,
I think you can create a variable called : NumberOfAttack and increments it each time your hero is doing an attack.
Like this :
View attachment 349120
There is not event : A unit is attacking, so you have to use "a unit is attacked".
In order :
- Create an integer variable and set it initial value to 0
- Create the trigger where the event detected is : "A unit is attacked" in Unit
- Set your condition to the attacker equals your Hero
- Increment the NumberOfAttack in Action
- Create a If/then/else
- Add condition : Every X attack
- In unit, select the action you want. You can use a buff and remove it, deal specific damages with the amount you want
- Reset NumberOfAttack if it reaches 3
Hey Norris,
I think you can create a variable called : NumberOfAttack and increments it each time your hero is doing an attack.
Like this :
View attachment 349120
There is not event : A unit is attacking, so you have to use "a unit is attacked".
In order :
- Create an integer variable and set it initial value to 0
- Create the trigger where the event detected is : "A unit is attacked" in Unit
- Set your condition to the attacker equals your Hero
- Increment the NumberOfAttack in Action
- Create a If/then/else
- Add condition : Every X attack
- In unit, select the action you want. You can use a buff and remove it, deal specific damages with the amount you want
- Reset NumberOfAttack if it reaches 3
This have two mistakes, first of all use Damage Engine by Bribe, with "Unit is attacked" the trigger will still fire regardless if the unit attacked or the attack command has been canceled by the attacker.
Here's a multi unit version, this utilize UnitIndexer and DamageEngine both made by Bribe. Test map included.
Attack Init
Events
Map initialization
Conditions
Actions
For each (Integer A) from 1 to 8196, do (Actions)
Loop - Actions
Set AT_Counter[(Integer A)] = 1
This is tested and working properly.
Attack Counter
Events
Game - DamageEvent becomes Equal to 1.00
Conditions
Actions
Set AT_DamageSourceID = (Custom value of DamageEventSource)
Set AT_DamageUnitNew[AT_DamageSourceID] = DamageEventSource
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
AT_DamageUnitNew[AT_DamageSourceID] Equal to AT_DamageUnitPrev[AT_DamageSourceID]
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
AT_Counter[AT_DamageSourceID] Greater than or equal to 2
Then - Actions
Set DamageEventAmount = (DamageEventAmount x 25.00)
Set AT_Counter[AT_DamageSourceID] = 0
Else - Actions
Set AT_Counter[AT_DamageSourceID] = (AT_Counter[AT_DamageSourceID] + 1)
Else - Actions
Set AT_Counter[AT_DamageSourceID] = 1
Game - Display to (All players) the text: (String(AT_Counter[AT_DamageSourceID]))
Set AT_DamageUnitPrev[AT_DamageSourceID] = DamageEventSource
Notes:
- Change the 25.00 to 3.00 since you want it to deal three times the damage every third attack
If you want the counter to reset every time the source unit changes the target unit you can just switch
and
AT_DamageUnitNew[AT_DamageSourceID] = DamageEventSource
to
AT_DamageUnitPrev[AT_DamageSourceID] = DamageEventSource
and
AT_DamageUnitNew[AT_DamageSourceID] = DamageEventTarget
AT_DamageUnitPrev[AT_DamageSourceID] = DamageEventTarget
You can just spam interrupt to deal huge amounts of damage with the first solution. There might be other issues with small interrupt intervals (for example when "moving" a unit with triggers). I'd highly recommend you to use Strydhaizers solutionI don't think it will be that complicated XD. I will try this one. Thanks everyone
Yes. In sh4d's trigger, looks like the damage was caused before the projectile touched the target. I don't know why ^^You can just spam interrupt to deal huge amounts of damage with the first solution. There might be other issues with small interrupt intervals (for example when "moving" a unit with triggers). I'd highly recommend you to use Strydhaizers solution
Because you're using the event "A unit is attacked". @Strydhaizer literally explained it to you. Use a damage engine, it will make your life easier.I don't know why ^^