Bin4ry Posted September 23, 2012 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 782 Reputation: 82 Joined: 01/01/12 Last Seen: September 21, 2015 Share 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 Link to comment Share on other sites More sharing options...
Euphy Posted September 23, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share 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 Link to comment Share on other sites More sharing options...
QQfoolsorellina Posted September 24, 2012 Group: Members Topic Count: 40 Topics Per Day: 0.01 Content Count: 587 Reputation: 105 Joined: 11/19/11 Last Seen: July 7, 2019 Share 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 Link to comment Share on other sites More sharing options...
Bin4ry Posted September 24, 2012 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 782 Reputation: 82 Joined: 01/01/12 Last Seen: September 21, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
Euphy Posted September 24, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted September 24, 2012 Yeah, 2~3 / 10 is close enough to 15~30 / 100. :> Quote Link to comment Share on other sites More sharing options...
Question
Bin4ry
This only happens rarely, but still annoying to see error in console :[
Here is the script:
Error output:
Link to comment
Share on other sites
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.