签到天数: 6 天
[LV.2]偶尔看看I
74
9
355
中级会员
改SRC 打開constants\ServerConstants.java 在宣告變數處加上: public static String 點數掉落 = "1,3,15";
打開server\maps\MapleMap.java 在最開始import加上: import constants.ServerConstants
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 + " 故無法獲得點數。"); } }
使用道具 举报
签到天数: 55 天
[LV.5]常住居民I
12
73
1188
金牌会员
签到天数: 10 天
[LV.3]偶尔看看II
2
66
71
注册会员
0
55
168
本版积分规则 发表回复 回帖后跳转到最后一页