| 05-28-2008, 12:10 AM | #1 |
This applies to Agility and Int too. In JASS:native SetHeroStr takes unit whichHero, integer newStr, boolean permanent returns nothing I'm wondering because I'm trying to make an ability that gives the Hero 10% extra strength for a duration, and it seems to sometimes end the Hero with more Strength than regularly. He also has an ability he uses that instantly adds 1 STR to him, so I'm thinking something with that is the problem. |
| 05-28-2008, 01:35 AM | #2 |
It would be an issue with you I'd say. Likely you are doing the math to calculate 10% more than once. 10% of 10 is 1. Now during the spell he has 11 strength. You add one strength instantly through other skill. Now you have 12 strength. Skill 1 ends, you calculate 10% of 12 to be 1.2, which is different from 1 (by about 20%). So you need to store how much strength you are adding, and remove explicitly that much from him when the spell ends, rather than recalculating. |
| 05-28-2008, 03:40 AM | #3 |
I assume its the same with function SetUnitAbilityPermenant. I personally think its there to support morphing heroes. (like demon hunter) -Av3n |
| 05-28-2008, 05:14 PM | #4 | |
Quote:
|
| 05-28-2008, 06:30 PM | #5 |
Ah. Well I fixed the problem anyways, it didn't have anything to do with this. But that's cool to know. |
