wc3edit.net

United Warcraft 3 map hacking!
It is currently April 20th, 2024, 4:08 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: July 2nd, 2011, 2:34 pm 
Offline
Junior Member

Joined: June 22nd, 2009, 3:47 pm
Posts: 30
can anyone tell me what
Code:
m=R2I((.01*Pow(I2R(l),2))+(1.5*l)+50)

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


Top
 Profile  
 
PostPosted: July 2nd, 2011, 3:01 pm 
Offline
Grammar King
User avatar

Joined: June 22nd, 2008, 10:11 pm
Posts: 2410
Location: Mostly USEast
Title: Worst human for 4eva
I2R = Integer to Real. Turns a number that's an integer to a real number.

_________________
Quote:
(20:53:52) Bartimaeus: Thank you, Jen.
(20:53:56) Bartimaeus: Truly, you are wise.


Quote:
(23:44:12) Bartimaeus: I was in pubic school until middle school...


Learn how to extract and read RAW Codes here!

Need help? Click here and ask your question!


Top
 Profile  
 
PostPosted: July 6th, 2011, 2:55 am 
Offline
Forum Spammer

Joined: March 30th, 2009, 9:02 pm
Posts: 682
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)