Bin4ry Posted September 23, 2012 Posted September 23, 2012 This only happens rarely, but still annoying to see error in console :[ Here is the script: - script ROTD -,{ end; OnClock0000: OnInit: setarray .ROTD$[0], "Formless", "Undead", "Brute", "Plant", "Insect", "Fish", "Demon", "Demi-Human", "Angel", "Dragon"; set .Race, rand(9); set .BonusEXP, rand(15,30); set .ExpLvlRange, 10; announce "Players will get " + .BonusEXP + "% bonus EXP from hunting " + .ROTD$[.Race] + " monsters today!",0; end; OnNPCKillEvent: if (getmonsterinfo(killedrid,19) != .Race) end; if (getcharid(1)) { set .@Location$, strcharinfo(3); set .BaseLvl, BaseLevel; getpartymember getcharid(1),1; getpartymember getcharid(1),2; for (set .@a, 0; .@a < .partymembercount; set .@a, .@a + 1) if (isloggedin(.partymemberaid[.@a])) attachrid (.partymemberaid[.@a]); if (strcharinfo(3) == .Location$ && ( .BaseLevel - BaseLevel) <= .ExpLvlRange) getexp (getmonsterinfo(killedrid,3) * .BonusEXP / 100), (getmonsterinfo(killedrid,4) * .BonusEXP/100); } else { getexp (getmonsterinfo(killedrid,3) * .BonusEXP / 100), (getmonsterinfo(killedrid,4) * .BonusEXP/100); } end; OnPCLoginEvent: dispbottom "Players will get " + .BonusEXP + "% bonus EXP from hunting " + $mobrace$ + " monsters today!"; end; } Error output: [Warning]: script:op_2num: overflow detected op=C_MUL i1=625000000 i2=26 [Debug]: Source (NPC): ROTD (invisible/not on a map) Quote
Euphy Posted September 23, 2012 Posted September 23, 2012 The only line that can overflow is this one: getexp (getmonsterinfo(killedrid,3) * .BonusEXP / 100), (getmonsterinfo(killedrid,4) * .BonusEXP/100); getexp multiplies parameters by the quest_exp_rate setting, so that's probably where you're getting the huge numbers. Try rand(2,3) instead of rand(15,30); it'll save a power of ten, and is close enough. Quote
QQfoolsorellina Posted September 24, 2012 Posted September 24, 2012 (edited) not sure but try () to change calculate order maybe another solution getexp (getmonsterinfo(killedrid,3) * .(BonusEXP / 100)), (getmonsterinfo(killedrid,4) * (.BonusEXP/100)); *Athena not supoorting Calculating Float. Edited September 24, 2012 by QQfoolsorellina Quote
Bin4ry Posted September 24, 2012 Author Posted September 24, 2012 Wait. Little confused here. If I use rand(2,3) when it divided by 100. Poring 20 Job EXP * 2 or 3 / 100 = -40 So I should make it divide by 10 instead? Quote
Euphy Posted September 24, 2012 Posted September 24, 2012 Yeah, 2~3 / 10 is close enough to 15~30 / 100. :> Quote
Question
Bin4ry
This only happens rarely, but still annoying to see error in console :[
Here is the script:
Error output:
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.