[Java] 纯文本查看 复制代码
int moblevel = mob.getStats().getLevel();
int difference = chr.getLevel() > 120 ? chr.getLevel() > 150 ? 75 : 75 : 75;//相差等級
boolean YesNo = (chr.getLevel() - moblevel) <= difference;
int Percentage = Randomizer.rand(1, 100); //轉換百分比
int GetPoints = (int) Randomizer.rand(Integer.parseInt(ServerConstants.點數掉落.split(",")[0]), Integer.parseInt(ServerConstants.點數掉落.split(",")[1]));
if (Percentage < Integer.parseInt(ServerConstants.點數掉落.split(",")[2]) && chr.getLevel() > 10) { //隨機產生數由1~100 如果<15 才會掉點
if (YesNo) {
chr.modifyCSPoints(2, GetPoints); //掉點類型 1為CASH 2為楓葉點數
chr.dropMessage(-1, "從怪物身上獲得了 " + GetPoints + " 楓葉點數");
} else {
chr.dropMessage(-1, "與怪物等級相差大於 " + difference + " 故無法獲得點數。");
}
}