- Joined
- Jun 30, 2006
- Messages
- 230
The idea is that a hero, in my case one trained to kill weak units, will have a higher chance to do a critical strike when a unit it is attacking has lower life.
I shouldn't think this to be too hard to do, but my JASS skills are lacking and rusty, and I tried to do this and simply got frustrated.
/* ::::: What I Want ::::: */
When a unit that has the critical-strike attacks another unit, the chance of the attacking unit to do a critical-strike increases in several sets based on the percentage of health on the unit being attacked. The first range would be from 65% up to 100% health, which would be the level of ability times by 15%. The second set would be 30%-65% hp, which does the level of ability times by 18%. The third set would be below 30% hp, and the percentage would be the level of the ability times by 21%.
Must be MUI and done in JASS.
So if your level of the ability was 2 your percentages would be as follows:
>65% hp = 30% chance
30%-65% hp = 36% chance
<30% hp = 42% chance
I've tried and fail. I know it should be simple but I'm too rusty and I didn't know a lot of JASS to start with. Can someone help? Please comment your code well so I can learn better! Thanks in advance.
Edit: I just realized I posted this in the wrong place, sorry!
I shouldn't think this to be too hard to do, but my JASS skills are lacking and rusty, and I tried to do this and simply got frustrated.
/* ::::: What I Want ::::: */
When a unit that has the critical-strike attacks another unit, the chance of the attacking unit to do a critical-strike increases in several sets based on the percentage of health on the unit being attacked. The first range would be from 65% up to 100% health, which would be the level of ability times by 15%. The second set would be 30%-65% hp, which does the level of ability times by 18%. The third set would be below 30% hp, and the percentage would be the level of the ability times by 21%.
Must be MUI and done in JASS.
So if your level of the ability was 2 your percentages would be as follows:
>65% hp = 30% chance
30%-65% hp = 36% chance
<30% hp = 42% chance
I've tried and fail. I know it should be simple but I'm too rusty and I didn't know a lot of JASS to start with. Can someone help? Please comment your code well so I can learn better! Thanks in advance.
Edit: I just realized I posted this in the wrong place, sorry!
Last edited: