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.