# Anyone here knows how to do berserker's blood like dota?

#### Steel0RaZoR

Level 8
Does anyone knows how to do the spell "Berserker's Blood" like in DotA

Description:

The Troll Berserker feels each of his wounds and channels the pain, increasing attack speed and damage for each 7% missing health. First bonus starts at full health.
Level 1 - 3% IAS and 2 Damage.
Level 2 - 6% IAS and 4 Damage.
Level 3 - 9% IAS and 6 Damage.
Level 4 - 12% IAS and 8 Damage.

I need it for my project "The Fallen Heroes", one of the skills of the Troll Berserker. Any help would be much appreciated.

#### Brambleclaw

Level 17
I could make you a Gui system but it wouldnt be a MUI is that okay?
@Rysnt You okay with no MUI as well?
Edit: Right here it is. Sorry if there any leaks i tried to reduce them. The only one i think may leak is the check of entering region. And the Changing the integer variable without removing it. Im not sure if integer variables leak though or changing em as i never destroy em D=. maybe they get saved over i dunno

THE ABILLITY IS ON THIS MAP HERE =D

Max dmg is 8x14= 114 MAx speed increase is 12%x14 = 168% That is when they are dead though or 0% life xP.

Oh and the reqs for this is abillity is 1 abillity based of Item + dmg 1 abillity based of Item + speed. And 1 dummy hero abillity. Diffrent effects can be added with these if wanted

Note soz it took so long. After i got back home did it all then realised i had forgot to divide the formula by 2 so they were getting Full levels at 50% hp >.<

Oh and if you ever want to edit the formula is this
Y*Z*(14-(X/7))/2) Where x is the percentage life of the unit.
Example of this would be Y= level of abillity
Y*Z*(14-(70/7)/2) = 14-10) /2 = 4/2 = 2
So if Y = 4 it would be 2x4 =8 so thats Level 8 of the abil +dmg. And level 8 of abil +Speed.

Z is the constant in each formula For speed Z = 3 For Dmg z = 2.

EAch increment of level of Speed = 3% and dmg = +2. So thats 48% more speed and +32 dmg.
Which is the same as a loss of 28 percent which is 4x12 and 4x8 as you can see =D

#### Attachments

• Dota abillity TROLL!BLOODRAGE test map.w3x
18.7 KB · Views: 106
Last edited:

#### rysnt11

Level 17
Send me a pm...
I want the system too, thanks b4

Edit: thanks, i'll test it later...
If great i'll give you +rep

Last edited:

#### Steel0RaZoR

Level 8
thanks Brambleclaw!

#### rysnt11

Level 17
Your system leaks, i had it fixed, anyway, why use the item ability as the normal ability?
I mean, why you include it to the hero?
And when the hero dead, the counter is not removed
After the hero revived, he has +110 damage and high attack speed..
but i'll fix that..
Any way, thanks!

#### Brambleclaw

Level 17
Your system leaks, i had it fixed, anyway, why use the item ability as the normal ability?
I mean, why you include it to the hero?
And when the hero dead, the counter is not removed
After the hero revived, he has +110 damage and high attack speed..
but i'll fix that..
Any way, thanks!

I know it leaks i dont ever sort out leaks. But it doesnt add damage when revive as the counter should reset to 0 again just change the event time and it stops that. Probs cause i put slow event time because of the leak. 0.02 should mean that it resets almost instantly (Dont know the code to remove the integer variable

#### rysnt11

Level 17
Just add the event 'unit-a unit dies'
Then cond-triggering unit equal to blah blah' and add the act-set-counter = 0'

#### Brambleclaw

Level 17
Still dont think there is a need if it sets it to 0 due to full hp.
>.<

#### rysnt11

Level 17
Try it and you know why to set it to 0 when the unit dies
I already try it and when the unit dies, the counter won't go down

#### Steel0RaZoR

Level 8
can u post the fix?

#### Brambleclaw

Level 17
Try it and you know why to set it to 0 when the unit dies
I already try it and when the unit dies, the counter won't go down

Yeh I think your getting confused. But just as proof im gonna check it.

Right at first i think its logically impossible considering as you have seen instead of using a variable count. I simply make the game calculate the count via percentage of health and translate that into levels or an abillity with regular increasing intervals. Thus producing the effects. So it should reset automatically.

So i tested it again (I had already tested it a first time to check all possible problems apart from leaks. I know it leaks i admit that. I don't know how to get rid of leaks, i check the guide but it had nothing on integer variables. If you would be so kind could you teach me the codes for destroying the leaks Tyx)

So here is the replay and conclusive evidence from this replay. A replay of a test on the same map i uploaded.

It turned out negative and that it did reset.
What i'm thinking now is that we have misunderstood each other.
There are several factors which you may of though had gone wrong in your test but actually my failing at Gui.

Basically here they are:

You can only have 1 troll hero per a person, Or it will not work. As the variable sets when The hero enters the map. If you built another troll to kill your first troll. The first troll would of not been counted in the variable. This was due to a quick hero variable selector as i cba to add a proper one should already be in the hero map for other custom abillities. Especially if there was a repick system.

THe 2nd Possibillity is that by not resetting you meant it didnt go to 0 again. This is because once you revive the troll it revives at half health. So therefore would get bonus = to its life. As its done from its life at that point not from life lost. So if it had 50 percent life on revive it would get 50% of max bonus.

I cannot think of any others. The evidence is below. Thank you for reading

Sorry for the inconveniance for not setting it to 100% hp on revive. And again if you could list me all the codes that would be great for removing leaks. As in the tutorial i read it didnt say much about integer variables just on Spawning units etc TYX

#### Attachments

• Proof.w3g
8 KB · Views: 80

#### rysnt11

Level 17
Ah...
O'm forgot...
Sorry bramb..
I was created another troll when i testes it,..

#### Brambleclaw

Level 17
Dw my fault for not pointing out the contraints of the system. At least you pointed out the leaks =D. So whats the code to remove Variable Integers?

#### rysnt11

Level 17
hmm...
Not intreger, but point leaks
I fixing the not MUI, since your trigs only leaks at the first
Did you notice, each time the nerzul enter the playable map area, the system is leaking at one point?
The point where the nerzul created, but..
Since it only used once, then it's okay
About the intrger leaks, its simple, just set the counter to 0

#### Brambleclaw

Level 17
hmm...
Not intreger, but point leaks
I fixing the not MUI, since your trigs only leaks at the first
Did you notice, each time the nerzul enter the playable map area, the system is leaking at one point?
The point where the nerzul created, but..
Since it only used once, then it's okay
About the intrger leaks, its simple, just set the counter to 0

Counter to 0 -.- That wouldn't work. Never mind i thought you were talking about the actuall trigger was leaking. The hero set thing isnt required to be copied into your map. Its only a System to set a hero, which you normally get in all maps , but usually they use Buy hero from shop or train instead of entered.

I thought integer variables leaked because when you change them you never destroy the last variable >.<

#### rysnt11

Level 17
No..no...
The last var will replaced with another var if the spell is constanly used in the map
Like the 'set blacast = triggering unit', the blacast will replaced with the new unit that cast the ability, and so on the intrg var..

#### Brambleclaw

Level 17
Its not castable though its a Passive abil ...

#### rysnt11

Level 17
You no need to destroy intrger, they usualy replaced with another var when used for the second time

#### Brambleclaw

Level 17
Replaced that means saved over. So does it auto delete the first or is the first leaking data?

#### rysnt11

Level 17
Auto delete
It always been like that

Replies
1
Views
719
Replies
6
Views
827
Replies
5
Views
690
Replies
3
Views
500
Replies
3
Views
384