does. It is part of a formula to determine the cumulative stat cap of a level and when I tried to look it up the best explanation I found was 0.01*x^2+1.5*x+50 where x=level. however I still don't know that I2R means, and the final result does not match the actual stat caps. actual caps: 66 at lvl 10, 135 at lvl 50, 500 at lvl 150.
in case the interpretation of that line is correct but I missed something else I also posted a larger excerpt of the code:
Spoiler:
Code:
function el takes nothing returns nothing local unit u=GetTriggerUnit() local player p=GetOwningPlayer(u) local integer s=GetHeroStr(u,false)+GetHeroAgi(u,false)+GetHeroInt(u,false) local integer l=GetHeroLevel(u) local integer m=R2I((.01*Pow(I2R(l),2))+(1.5*l)+50) local integer i='t'*60+GetPlayerId(GetOwningPlayer(u)) call UnitRemoveAbility(u,'Ansp') if(s<m)then call SetHeroStr(u,GetHeroStr(u,false)+1,true) set ZE[i]=ZE[i]+1 else call DisplayTextToForce(uF(p),("|cffff0000Sorry, your hero may only have "+I2S(m)+" total stats at level "+I2S(l)+".")) endif set u=null set p=null endfunction
m=R2I((.01*Pow(I2R(l),2))+(1.5*l)+50) where l is equal to the hero lvl of u which is the triggering unit so u take l and make it a real (which means it is a decimal) and raise that number to the 2nd power multiply the result by .01 add 1.5 times l add 50 and makes m equal to that
so if the lvl of the hero was 10 it would be 10^2 * .01 + 1.5 * 10 + 50 = 100 *.01 + 15 +50 = 1 + 15 + 50 = 66 if the hero lvl is 50 it would be 50^2 * .01 + 1.5 * 50 + 50 = 2500 * .01 + 75 + 50 = 25 + 75 + 50 = 150 if hero lvl is 150 it would be 150^2 * .01 + 1.5 * 150 + 50 = 225 + 225 +50 = 500
but hmmmmmm u say its 135 at lvl 50? o.o weird mebe u saw it wrong?
Users browsing this forum: No registered users and 16 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum