Kelv
TH.net Regular
- Reaction score
- 7
When the trigger goes off for the first time, it freezes the game for a half a second or something. Also, I have some floating text, it is always showing the damage doing 10 less then what I wanted it to do.
The abilities are based off of Beserk for buff, and the item ability damage bonus.
Can someone help me with what is wrong, and also, how to fix the lag problem?
It should be adding (whatever the level of the spell is) damage to the hero everytime he attacks a unit, and once he looses the buff, which is after 30 seconds, the next unit he attacks, he will do bonus damage of 10 x however much damage he added.
So if his ability level is 2, and he attacks a unit 5 times, the next unit he hits should do his normal damage, plus 100. My spell makes him do 80 damage, I could try and counter the problem but I'd rather just eliminate it. What I mean by that is that I could just add 1 to SW_DB_Level, at the end, but id rather just figure out why its not working from the start.
The abilities are based off of Beserk for buff, and the item ability damage bonus.
Code:
Sharpen Blades
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacking unit)) Equal to Savage
(Level of Berserk for (Attacking unit)) Greater than 0
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Attacking unit) has buff Barbarian ) Equal to True
Then - Actions
Set SW_Lvl = (Level of Berserk for (Attacking unit))
Set SW_DB_Lvl = (Level of Barbarian Damage Bonus for (Attacking unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Barbarian Damage Bonus for (Attacking unit)) Greater than 0
Then - Actions
Wait 0.25 seconds
Unit - Set level of Barbarian Damage Bonus for (Attacking unit) to (SW_DB_Lvl + SW_Lvl)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Barbarian Damage Bonus for (Attacking unit)) Equal to 0
Then - Actions
Wait 0.25 seconds
Unit - Add Barbarian Damage Bonus to (Attacking unit)
Set SW_DB_Lvl = (Level of Barbarian Damage Bonus for (Attacking unit))
Unit - Set level of Barbarian Damage Bonus for (Attacking unit) to SW_Lvl
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Barbarian Damage Bonus for (Attacking unit)) Greater than 0
Then - Actions
Unit - Cause (Attacking unit) to damage (Attacked unit), dealing ((Real(SW_DB_Lvl)) x 10.00) damage of attack type Spells and damage type Normal
Floating Text - Create floating text that reads (+ + (String((SW_DB_Lvl x 10)))) above (Attacked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
Unit - Remove Barbarian Damage Bonus from (Attacking unit)
Else - Actions
Can someone help me with what is wrong, and also, how to fix the lag problem?
It should be adding (whatever the level of the spell is) damage to the hero everytime he attacks a unit, and once he looses the buff, which is after 30 seconds, the next unit he attacks, he will do bonus damage of 10 x however much damage he added.
So if his ability level is 2, and he attacks a unit 5 times, the next unit he hits should do his normal damage, plus 100. My spell makes him do 80 damage, I could try and counter the problem but I'd rather just eliminate it. What I mean by that is that I could just add 1 to SW_DB_Level, at the end, but id rather just figure out why its not working from the start.