Riizade/config file (#520)

* added POJO + yaml file

* made config members public

* switched to yaml

* modified files to use YamlConfig over ServerConstants

* removed constants from ServerConstants

* removed unused imports

* removed unused import

* removed world ini

* removed now unused .ini files

* fixed docker-launch.sh

* added jackson dependency JARs

* fixed errors

* removed unused server config values, added world defaults

* don't use env variables for docker

* fixed package imports/specifiers for js files
This commit is contained in:
Adam James-Liebau Johnson
2019-09-20 20:49:24 -03:00
committed by Ronan Lana
parent e169971384
commit 181573dc74
163 changed files with 1531 additions and 1113 deletions
+3 -2
View File
@@ -33,6 +33,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.locks.Lock;
import config.YamlConfig;
import net.server.Server;
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
@@ -278,7 +279,7 @@ public class CashShop {
this.accountId = accountId;
this.characterId = characterId;
if (!ServerConstants.USE_JOINT_CASHSHOP_INVENTORY) {
if (!YamlConfig.config.server.USE_JOINT_CASHSHOP_INVENTORY) {
if (jobType == 0) {
factory = ItemFactory.CASH_EXPLORER;
} else if (jobType == 1) {
@@ -358,7 +359,7 @@ public class CashShop {
public void gainCash(int type, CashItem buyItem, int world) {
gainCash(type, -buyItem.getPrice());
if(!ServerConstants.USE_ENFORCE_ITEM_SUGGESTION) Server.getInstance().getWorld(world).addCashItemBought(buyItem.getSN());
if(!YamlConfig.config.server.USE_ENFORCE_ITEM_SUGGESTION) Server.getInstance().getWorld(world).addCashItemBought(buyItem.getSN());
}
public boolean isOpened() {
+3 -2
View File
@@ -21,6 +21,7 @@
*/
package server;
import config.YamlConfig;
import constants.EquipType;
import constants.ServerConstants;
import java.util.ArrayList;
@@ -74,7 +75,7 @@ public class MakerItemFactory {
}
private static double getMakerStimulantFee(int itemid) {
if(ServerConstants.USE_MAKER_FEE_HEURISTICS) {
if(YamlConfig.config.server.USE_MAKER_FEE_HEURISTICS) {
EquipType et = EquipType.getEquipTypeById(itemid);
int eqpLevel = ii.getEquipLevelReq(itemid);
@@ -109,7 +110,7 @@ public class MakerItemFactory {
}
private static double getMakerReagentFee(int itemid, int reagentLevel) {
if(ServerConstants.USE_MAKER_FEE_HEURISTICS) {
if(YamlConfig.config.server.USE_MAKER_FEE_HEURISTICS) {
EquipType et = EquipType.getEquipTypeById(itemid);
int eqpLevel = ii.getEquipLevelReq(itemid);
+53 -52
View File
@@ -36,6 +36,7 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.HashSet;
import config.YamlConfig;
import net.server.Server;
import provider.MapleData;
import provider.MapleDataDirectoryEntry;
@@ -619,7 +620,7 @@ public class MapleItemInformationProvider {
}
public static boolean rollSuccessChance(double propPercent) {
return Math.random() >= testYourLuck(propPercent / 100.0, ServerConstants.SCROLL_CHANCE_RATE);
return Math.random() >= testYourLuck(propPercent / 100.0, YamlConfig.config.server.SCROLL_CHANCE_RATE);
}
private static short getMaximumShortMaxIfOverflow(int value1, int value2) {
@@ -640,72 +641,72 @@ public class MapleItemInformationProvider {
if(!option) {
if (nEquip.getStr() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setStr(getMaximumShortMaxIfOverflow(nEquip.getStr(), (nEquip.getStr() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setStr(getMaximumShortMaxIfOverflow(nEquip.getStr(), (nEquip.getStr() + chscrollRandomizedStat(range))));
else nEquip.setStr(getMaximumShortMaxIfOverflow(0, (nEquip.getStr() + chscrollRandomizedStat(range))));
}
if (nEquip.getDex() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setDex(getMaximumShortMaxIfOverflow(nEquip.getDex(), (nEquip.getDex() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setDex(getMaximumShortMaxIfOverflow(nEquip.getDex(), (nEquip.getDex() + chscrollRandomizedStat(range))));
else nEquip.setDex(getMaximumShortMaxIfOverflow(0, (nEquip.getDex() + chscrollRandomizedStat(range))));
}
if (nEquip.getInt() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setInt(getMaximumShortMaxIfOverflow(nEquip.getInt(), (nEquip.getInt() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setInt(getMaximumShortMaxIfOverflow(nEquip.getInt(), (nEquip.getInt() + chscrollRandomizedStat(range))));
else nEquip.setInt(getMaximumShortMaxIfOverflow(0, (nEquip.getInt() + chscrollRandomizedStat(range))));
}
if (nEquip.getLuk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setLuk(getMaximumShortMaxIfOverflow(nEquip.getLuk(), (nEquip.getLuk() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setLuk(getMaximumShortMaxIfOverflow(nEquip.getLuk(), (nEquip.getLuk() + chscrollRandomizedStat(range))));
else nEquip.setLuk(getMaximumShortMaxIfOverflow(0, (nEquip.getLuk() + chscrollRandomizedStat(range))));
}
if (nEquip.getAcc() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setAcc(getMaximumShortMaxIfOverflow(nEquip.getAcc(), (nEquip.getAcc() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setAcc(getMaximumShortMaxIfOverflow(nEquip.getAcc(), (nEquip.getAcc() + chscrollRandomizedStat(range))));
else nEquip.setAcc(getMaximumShortMaxIfOverflow(0, (nEquip.getAcc() + chscrollRandomizedStat(range))));
}
if (nEquip.getAvoid() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setAvoid(getMaximumShortMaxIfOverflow(nEquip.getAvoid(), (nEquip.getAvoid() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setAvoid(getMaximumShortMaxIfOverflow(nEquip.getAvoid(), (nEquip.getAvoid() + chscrollRandomizedStat(range))));
else nEquip.setAvoid(getMaximumShortMaxIfOverflow(0, (nEquip.getAvoid() + chscrollRandomizedStat(range))));
}
} else {
if (nEquip.getWatk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setWatk(getMaximumShortMaxIfOverflow(nEquip.getWatk(), (nEquip.getWatk() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setWatk(getMaximumShortMaxIfOverflow(nEquip.getWatk(), (nEquip.getWatk() + chscrollRandomizedStat(range))));
else nEquip.setWatk(getMaximumShortMaxIfOverflow(0, (nEquip.getWatk() + chscrollRandomizedStat(range))));
}
if (nEquip.getWdef() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setWdef(getMaximumShortMaxIfOverflow(nEquip.getWdef(), (nEquip.getWdef() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setWdef(getMaximumShortMaxIfOverflow(nEquip.getWdef(), (nEquip.getWdef() + chscrollRandomizedStat(range))));
else nEquip.setWdef(getMaximumShortMaxIfOverflow(0, (nEquip.getWdef() + chscrollRandomizedStat(range))));
}
if (nEquip.getMatk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setMatk(getMaximumShortMaxIfOverflow(nEquip.getMatk(), (nEquip.getMatk() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setMatk(getMaximumShortMaxIfOverflow(nEquip.getMatk(), (nEquip.getMatk() + chscrollRandomizedStat(range))));
else nEquip.setMatk(getMaximumShortMaxIfOverflow(0, (nEquip.getMatk() + chscrollRandomizedStat(range))));
}
if (nEquip.getMdef() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setMdef(getMaximumShortMaxIfOverflow(nEquip.getMdef(), (nEquip.getMdef() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setMdef(getMaximumShortMaxIfOverflow(nEquip.getMdef(), (nEquip.getMdef() + chscrollRandomizedStat(range))));
else nEquip.setMdef(getMaximumShortMaxIfOverflow(0, (nEquip.getMdef() + chscrollRandomizedStat(range))));
}
if (nEquip.getSpeed() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setSpeed(getMaximumShortMaxIfOverflow(nEquip.getSpeed(), (nEquip.getSpeed() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setSpeed(getMaximumShortMaxIfOverflow(nEquip.getSpeed(), (nEquip.getSpeed() + chscrollRandomizedStat(range))));
else nEquip.setSpeed(getMaximumShortMaxIfOverflow(0, (nEquip.getSpeed() + chscrollRandomizedStat(range))));
}
if (nEquip.getJump() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setJump(getMaximumShortMaxIfOverflow(nEquip.getJump(), (nEquip.getJump() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setJump(getMaximumShortMaxIfOverflow(nEquip.getJump(), (nEquip.getJump() + chscrollRandomizedStat(range))));
else nEquip.setJump(getMaximumShortMaxIfOverflow(0, (nEquip.getJump() + chscrollRandomizedStat(range))));
}
if (nEquip.getHp() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setHp(getMaximumShortMaxIfOverflow(nEquip.getHp(), (nEquip.getHp() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setHp(getMaximumShortMaxIfOverflow(nEquip.getHp(), (nEquip.getHp() + chscrollRandomizedStat(range))));
else nEquip.setHp(getMaximumShortMaxIfOverflow(0, (nEquip.getHp() + chscrollRandomizedStat(range))));
}
if (nEquip.getMp() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setMp(getMaximumShortMaxIfOverflow(nEquip.getMp(), (nEquip.getMp() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setMp(getMaximumShortMaxIfOverflow(nEquip.getMp(), (nEquip.getMp() + chscrollRandomizedStat(range))));
else nEquip.setMp(getMaximumShortMaxIfOverflow(0, (nEquip.getMp() + chscrollRandomizedStat(range))));
}
}
}
private void scrollEquipWithChaos(Equip nEquip, int range) {
if(ServerConstants.CHSCROLL_STAT_RATE > 0) {
if(YamlConfig.config.server.CHSCROLL_STAT_RATE > 0) {
int temp;
short curStr, curDex, curInt, curLuk, curWatk, curWdef, curMatk, curMdef, curAcc, curAvoid, curSpeed, curJump, curHp, curMp;
if(ServerConstants.USE_ENHANCED_CHSCROLL) {
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) {
curStr = nEquip.getStr();
curDex = nEquip.getDex();
curInt = nEquip.getInt();
@@ -737,100 +738,100 @@ public class MapleItemInformationProvider {
curMp = Short.MIN_VALUE;
}
for(int i = 0; i < ServerConstants.CHSCROLL_STAT_RATE; i++) {
for(int i = 0; i < YamlConfig.config.server.CHSCROLL_STAT_RATE; i++) {
if (nEquip.getStr() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curStr + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curStr + chscrollRandomizedStat(range);
else temp = nEquip.getStr() + chscrollRandomizedStat(range);
curStr = getMaximumShortMaxIfOverflow(temp, curStr);
}
if (nEquip.getDex() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curDex + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curDex + chscrollRandomizedStat(range);
else temp = nEquip.getDex() + chscrollRandomizedStat(range);
curDex = getMaximumShortMaxIfOverflow(temp, curDex);
}
if (nEquip.getInt() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curInt + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curInt + chscrollRandomizedStat(range);
else temp = nEquip.getInt() + chscrollRandomizedStat(range);
curInt = getMaximumShortMaxIfOverflow(temp, curInt);
}
if (nEquip.getLuk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curLuk + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curLuk + chscrollRandomizedStat(range);
else temp = nEquip.getLuk() + chscrollRandomizedStat(range);
curLuk = getMaximumShortMaxIfOverflow(temp, curLuk);
}
if (nEquip.getWatk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curWatk + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curWatk + chscrollRandomizedStat(range);
else temp = nEquip.getWatk() + chscrollRandomizedStat(range);
curWatk = getMaximumShortMaxIfOverflow(temp, curWatk);
}
if (nEquip.getWdef() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curWdef + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curWdef + chscrollRandomizedStat(range);
else temp = nEquip.getWdef() + chscrollRandomizedStat(range);
curWdef = getMaximumShortMaxIfOverflow(temp, curWdef);
}
if (nEquip.getMatk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curMatk + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curMatk + chscrollRandomizedStat(range);
else temp = nEquip.getMatk() + chscrollRandomizedStat(range);
curMatk = getMaximumShortMaxIfOverflow(temp, curMatk);
}
if (nEquip.getMdef() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curMdef + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curMdef + chscrollRandomizedStat(range);
else temp = nEquip.getMdef() + chscrollRandomizedStat(range);
curMdef = getMaximumShortMaxIfOverflow(temp, curMdef);
}
if (nEquip.getAcc() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curAcc + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curAcc + chscrollRandomizedStat(range);
else temp = nEquip.getAcc() + chscrollRandomizedStat(range);
curAcc = getMaximumShortMaxIfOverflow(temp, curAcc);
}
if (nEquip.getAvoid() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curAvoid + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curAvoid + chscrollRandomizedStat(range);
else temp = nEquip.getAvoid() + chscrollRandomizedStat(range);
curAvoid = getMaximumShortMaxIfOverflow(temp, curAvoid);
}
if (nEquip.getSpeed() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curSpeed + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curSpeed + chscrollRandomizedStat(range);
else temp = nEquip.getSpeed() + chscrollRandomizedStat(range);
curSpeed = getMaximumShortMaxIfOverflow(temp, curSpeed);
}
if (nEquip.getJump() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curJump + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curJump + chscrollRandomizedStat(range);
else temp = nEquip.getJump() + chscrollRandomizedStat(range);
curJump = getMaximumShortMaxIfOverflow(temp, curJump);
}
if (nEquip.getHp() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curHp + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curHp + chscrollRandomizedStat(range);
else temp = nEquip.getHp() + chscrollRandomizedStat(range);
curHp = getMaximumShortMaxIfOverflow(temp, curHp);
}
if (nEquip.getMp() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curMp + chscrollRandomizedStat(range);
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) temp = curMp + chscrollRandomizedStat(range);
else temp = nEquip.getMp() + chscrollRandomizedStat(range);
curMp = getMaximumShortMaxIfOverflow(temp, curMp);
@@ -855,59 +856,59 @@ public class MapleItemInformationProvider {
else {
if (nEquip.getStr() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setStr(getMaximumShortMaxIfOverflow(nEquip.getStr(), (nEquip.getStr() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setStr(getMaximumShortMaxIfOverflow(nEquip.getStr(), (nEquip.getStr() + chscrollRandomizedStat(range))));
else nEquip.setStr(getMaximumShortMaxIfOverflow(0, (nEquip.getStr() + chscrollRandomizedStat(range))));
}
if (nEquip.getDex() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setDex(getMaximumShortMaxIfOverflow(nEquip.getDex(), (nEquip.getDex() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setDex(getMaximumShortMaxIfOverflow(nEquip.getDex(), (nEquip.getDex() + chscrollRandomizedStat(range))));
else nEquip.setDex(getMaximumShortMaxIfOverflow(0, (nEquip.getDex() + chscrollRandomizedStat(range))));
}
if (nEquip.getInt() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setInt(getMaximumShortMaxIfOverflow(nEquip.getInt(), (nEquip.getInt() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setInt(getMaximumShortMaxIfOverflow(nEquip.getInt(), (nEquip.getInt() + chscrollRandomizedStat(range))));
else nEquip.setInt(getMaximumShortMaxIfOverflow(0, (nEquip.getInt() + chscrollRandomizedStat(range))));
}
if (nEquip.getLuk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setLuk(getMaximumShortMaxIfOverflow(nEquip.getLuk(), (nEquip.getLuk() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setLuk(getMaximumShortMaxIfOverflow(nEquip.getLuk(), (nEquip.getLuk() + chscrollRandomizedStat(range))));
else nEquip.setLuk(getMaximumShortMaxIfOverflow(0, (nEquip.getLuk() + chscrollRandomizedStat(range))));
}
if (nEquip.getWatk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setWatk(getMaximumShortMaxIfOverflow(nEquip.getWatk(), (nEquip.getWatk() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setWatk(getMaximumShortMaxIfOverflow(nEquip.getWatk(), (nEquip.getWatk() + chscrollRandomizedStat(range))));
else nEquip.setWatk(getMaximumShortMaxIfOverflow(0, (nEquip.getWatk() + chscrollRandomizedStat(range))));
}
if (nEquip.getWdef() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setWdef(getMaximumShortMaxIfOverflow(nEquip.getWdef(), (nEquip.getWdef() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setWdef(getMaximumShortMaxIfOverflow(nEquip.getWdef(), (nEquip.getWdef() + chscrollRandomizedStat(range))));
else nEquip.setWdef(getMaximumShortMaxIfOverflow(0, (nEquip.getWdef() + chscrollRandomizedStat(range))));
}
if (nEquip.getMatk() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setMatk(getMaximumShortMaxIfOverflow(nEquip.getMatk(), (nEquip.getMatk() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setMatk(getMaximumShortMaxIfOverflow(nEquip.getMatk(), (nEquip.getMatk() + chscrollRandomizedStat(range))));
else nEquip.setMatk(getMaximumShortMaxIfOverflow(0, (nEquip.getMatk() + chscrollRandomizedStat(range))));
}
if (nEquip.getMdef() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setMdef(getMaximumShortMaxIfOverflow(nEquip.getMdef(), (nEquip.getMdef() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setMdef(getMaximumShortMaxIfOverflow(nEquip.getMdef(), (nEquip.getMdef() + chscrollRandomizedStat(range))));
else nEquip.setMdef(getMaximumShortMaxIfOverflow(0, (nEquip.getMdef() + chscrollRandomizedStat(range))));
}
if (nEquip.getAcc() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setAcc(getMaximumShortMaxIfOverflow(nEquip.getAcc(), (nEquip.getAcc() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setAcc(getMaximumShortMaxIfOverflow(nEquip.getAcc(), (nEquip.getAcc() + chscrollRandomizedStat(range))));
else nEquip.setAcc(getMaximumShortMaxIfOverflow(0, (nEquip.getAcc() + chscrollRandomizedStat(range))));
}
if (nEquip.getAvoid() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setAvoid(getMaximumShortMaxIfOverflow(nEquip.getAvoid(), (nEquip.getAvoid() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setAvoid(getMaximumShortMaxIfOverflow(nEquip.getAvoid(), (nEquip.getAvoid() + chscrollRandomizedStat(range))));
else nEquip.setAvoid(getMaximumShortMaxIfOverflow(0, (nEquip.getAvoid() + chscrollRandomizedStat(range))));
}
if (nEquip.getSpeed() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setSpeed(getMaximumShortMaxIfOverflow(nEquip.getSpeed(), (nEquip.getSpeed() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setSpeed(getMaximumShortMaxIfOverflow(nEquip.getSpeed(), (nEquip.getSpeed() + chscrollRandomizedStat(range))));
else nEquip.setSpeed(getMaximumShortMaxIfOverflow(0, (nEquip.getSpeed() + chscrollRandomizedStat(range))));
}
if (nEquip.getJump() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setJump(getMaximumShortMaxIfOverflow(nEquip.getJump(), (nEquip.getJump() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setJump(getMaximumShortMaxIfOverflow(nEquip.getJump(), (nEquip.getJump() + chscrollRandomizedStat(range))));
else nEquip.setJump(getMaximumShortMaxIfOverflow(0, (nEquip.getJump() + chscrollRandomizedStat(range))));
}
if (nEquip.getHp() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setHp(getMaximumShortMaxIfOverflow(nEquip.getHp(), (nEquip.getHp() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setHp(getMaximumShortMaxIfOverflow(nEquip.getHp(), (nEquip.getHp() + chscrollRandomizedStat(range))));
else nEquip.setHp(getMaximumShortMaxIfOverflow(0, (nEquip.getHp() + chscrollRandomizedStat(range))));
}
if (nEquip.getMp() > 0) {
if(ServerConstants.USE_ENHANCED_CHSCROLL) nEquip.setMp(getMaximumShortMaxIfOverflow(nEquip.getMp(), (nEquip.getMp() + chscrollRandomizedStat(range))));
if(YamlConfig.config.server.USE_ENHANCED_CHSCROLL) nEquip.setMp(getMaximumShortMaxIfOverflow(nEquip.getMp(), (nEquip.getMp() + chscrollRandomizedStat(range))));
else nEquip.setMp(getMaximumShortMaxIfOverflow(0, (nEquip.getMp() + chscrollRandomizedStat(range))));
}
}
@@ -915,11 +916,11 @@ public class MapleItemInformationProvider {
public boolean canUseCleanSlate(Equip nEquip) {
Map<String, Integer> eqstats = this.getEquipStats(nEquip.getItemId());
return ServerConstants.USE_ENHANCED_CLNSLATE || nEquip.getUpgradeSlots() < (byte) (eqstats.get("tuc") + nEquip.getVicious()); // issue with clean slate found thanks to Masterrulax, vicious added in the check thanks to Crypter (CrypterDEV)
return YamlConfig.config.server.USE_ENHANCED_CLNSLATE || nEquip.getUpgradeSlots() < (byte) (eqstats.get("tuc") + nEquip.getVicious()); // issue with clean slate found thanks to Masterrulax, vicious added in the check thanks to Crypter (CrypterDEV)
}
public Item scrollEquipWithId(Item equip, int scrollId, boolean usingWhiteScroll, int vegaItemId, boolean isGM) {
boolean assertGM = (isGM && ServerConstants.USE_PERFECT_GM_SCROLL);
boolean assertGM = (isGM && YamlConfig.config.server.USE_PERFECT_GM_SCROLL);
if (equip instanceof Equip) {
Equip nEquip = (Equip) equip;
@@ -966,7 +967,7 @@ public class MapleItemInformationProvider {
case 2049100:
case 2049101:
case 2049102:
scrollEquipWithChaos(nEquip, ServerConstants.CHSCROLL_STAT_RANGE);
scrollEquipWithChaos(nEquip, YamlConfig.config.server.CHSCROLL_STAT_RANGE);
break;
default:
@@ -980,7 +981,7 @@ public class MapleItemInformationProvider {
nEquip.setLevel((byte) (nEquip.getLevel() + 1));
}
} else {
if (!ServerConstants.USE_PERFECT_SCROLLING && !usingWhiteScroll && !ItemConstants.isCleanSlate(scrollId) && !assertGM && !ItemConstants.isModifierScroll(scrollId)) {
if (!YamlConfig.config.server.USE_PERFECT_SCROLLING && !usingWhiteScroll && !ItemConstants.isCleanSlate(scrollId) && !assertGM && !ItemConstants.isModifierScroll(scrollId)) {
nEquip.setUpgradeSlots((byte) (nEquip.getUpgradeSlots() - 1));
}
if (Randomizer.nextInt(100) < stats.get("cursed")) {
@@ -1606,11 +1607,11 @@ public class MapleItemInformationProvider {
}
public boolean isUnmerchable(int itemId) {
if(ServerConstants.USE_ENFORCE_UNMERCHABLE_CASH && isCash(itemId)) {
if(YamlConfig.config.server.USE_ENFORCE_UNMERCHABLE_CASH && isCash(itemId)) {
return true;
}
if (ServerConstants.USE_ENFORCE_UNMERCHABLE_PET && ItemConstants.isPet(itemId)) {
if (YamlConfig.config.server.USE_ENFORCE_UNMERCHABLE_PET && ItemConstants.isPet(itemId)) {
return true;
}
+5 -4
View File
@@ -29,6 +29,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import config.YamlConfig;
import net.server.Server;
import provider.MapleData;
import provider.MapleDataTool;
@@ -444,7 +445,7 @@ public class MapleStatEffect {
} else {
if (isMapChair(sourceid)) {
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MAP_CHAIR, 1);
} else if ((sourceid == Beginner.NIMBLE_FEET || sourceid == Noblesse.NIMBLE_FEET || sourceid == Evan.NIMBLE_FEET || sourceid == Legend.AGILE_BODY) && ServerConstants.USE_ULTRA_NIMBLE_FEET == true) {
} else if ((sourceid == Beginner.NIMBLE_FEET || sourceid == Noblesse.NIMBLE_FEET || sourceid == Evan.NIMBLE_FEET || sourceid == Legend.AGILE_BODY) && YamlConfig.config.server.USE_ULTRA_NIMBLE_FEET == true) {
ret.jump = (short) (ret.speed * 4);
ret.speed *= 15;
}
@@ -465,7 +466,7 @@ public class MapleStatEffect {
ret.lt = (Point) ltd.getData();
ret.rb = (Point) source.getChildByPath("rb").getData();
if (ServerConstants.USE_MAXRANGE_ECHO_OF_HERO && (sourceid == Beginner.ECHO_OF_HERO || sourceid == Noblesse.ECHO_OF_HERO || sourceid == Legend.ECHO_OF_HERO || sourceid == Evan.ECHO_OF_HERO)) {
if (YamlConfig.config.server.USE_MAXRANGE_ECHO_OF_HERO && (sourceid == Beginner.ECHO_OF_HERO || sourceid == Noblesse.ECHO_OF_HERO || sourceid == Legend.ECHO_OF_HERO || sourceid == Evan.ECHO_OF_HERO)) {
ret.lt = new Point(Integer.MIN_VALUE, Integer.MIN_VALUE);
ret.rb = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
@@ -473,7 +474,7 @@ public class MapleStatEffect {
int x = MapleDataTool.getInt("x", source, 0);
if ((sourceid == Beginner.RECOVERY || sourceid == Noblesse.RECOVERY || sourceid == Evan.RECOVERY || sourceid == Legend.RECOVERY) && ServerConstants.USE_ULTRA_RECOVERY == true) {
if ((sourceid == Beginner.RECOVERY || sourceid == Noblesse.RECOVERY || sourceid == Evan.RECOVERY || sourceid == Legend.RECOVERY) && YamlConfig.config.server.USE_ULTRA_RECOVERY == true) {
x *= 10;
}
ret.x = x;
@@ -1233,7 +1234,7 @@ public class MapleStatEffect {
}
public int getBuffLocalDuration() {
return !ServerConstants.USE_BUFF_EVERLASTING ? duration : Integer.MAX_VALUE;
return !YamlConfig.config.server.USE_BUFF_EVERLASTING ? duration : Integer.MAX_VALUE;
}
public void silentApplyBuff(MapleCharacter chr, long localStartTime) {
+2 -1
View File
@@ -25,6 +25,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import config.YamlConfig;
import constants.ItemConstants;
import constants.ServerConstants;
@@ -359,7 +360,7 @@ public class MapleStorageInventory {
}
int invTypeCriteria = 1;
int sortCriteria = (ServerConstants.USE_ITEM_SORT_BY_NAME == true) ? 2 : 0;
int sortCriteria = (YamlConfig.config.server.USE_ITEM_SORT_BY_NAME == true) ? 2 : 0;
PairedQuicksort pq = new PairedQuicksort(itemarray, sortCriteria, invTypeCriteria);
inventory.clear();
+3 -2
View File
@@ -26,6 +26,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import config.YamlConfig;
import tools.LogHelper;
import tools.MaplePacketCreator;
import client.MapleCharacter;
@@ -114,7 +115,7 @@ public class MapleTrade {
private void completeTrade() {
byte result;
boolean show = ServerConstants.USE_DEBUG;
boolean show = YamlConfig.config.server.USE_DEBUG;
items.clear();
meso = 0;
@@ -147,7 +148,7 @@ public class MapleTrade {
}
private void cancel(byte result) {
boolean show = ServerConstants.USE_DEBUG;
boolean show = YamlConfig.config.server.USE_DEBUG;
for (Item item : items) {
MapleInventoryManipulator.addFromDrop(chr.getClient(), item, show);
@@ -27,6 +27,8 @@ import java.sql.Timestamp;
import java.util.Calendar;
import java.util.LinkedList;
import java.util.List;
import config.YamlConfig;
import constants.ServerConstants;
import tools.DatabaseConnection;
import tools.Pair;
@@ -182,7 +184,7 @@ public class MapleExpeditionBossLog {
}
public static boolean attemptBoss(int cid, int channel, MapleExpedition exped, boolean log) {
if (!ServerConstants.USE_ENABLE_DAILY_EXPEDITIONS) {
if (!YamlConfig.config.server.USE_ENABLE_DAILY_EXPEDITIONS) {
return true;
}
@@ -22,6 +22,7 @@
package server.expeditions;
import config.YamlConfig;
import constants.ServerConstants;
/**
@@ -60,7 +61,7 @@ public enum MapleExpeditionType {
}
public int getMinSize() {
return !ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? minSize : 1;
return !YamlConfig.config.server.USE_ENABLE_SOLO_EXPEDITIONS ? minSize : 1;
}
public int getMaxSize() {
+12 -11
View File
@@ -30,6 +30,7 @@ import client.Skill;
import client.SkillFactory;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
import config.YamlConfig;
import constants.ServerConstants;
import constants.skills.Crusader;
import constants.skills.FPMage;
@@ -451,7 +452,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
return;
}
if (ServerConstants.USE_DEBUG) {
if (YamlConfig.config.server.USE_DEBUG) {
from.dropMessage(5, "Hitted MOB " + this.getId() + ", OID " + this.getObjectId());
}
@@ -525,8 +526,8 @@ public class MapleMonster extends AbstractLoadedMapleLife {
}
private void distributePlayerExperience(MapleCharacter chr, float exp, float partyBonusMod, int totalPartyLevel, boolean highestPartyDamager, boolean whiteExpGain, boolean hasPartySharers) {
float playerExp = (ServerConstants.EXP_SPLIT_COMMON_MOD * chr.getLevel()) / totalPartyLevel;
if (highestPartyDamager) playerExp += ServerConstants.EXP_SPLIT_MVP_MOD;
float playerExp = (YamlConfig.config.server.EXP_SPLIT_COMMON_MOD * chr.getLevel()) / totalPartyLevel;
if (highestPartyDamager) playerExp += YamlConfig.config.server.EXP_SPLIT_MVP_MOD;
playerExp *= exp;
float bonusExp = partyBonusMod * playerExp;
@@ -537,7 +538,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
private void distributePartyExperience(Map<MapleCharacter, Long> partyParticipation, float expPerDmg, Set<MapleCharacter> underleveled, Map<Integer, Float> personalRatio, double sdevRatio) {
IntervalBuilder leechInterval = new IntervalBuilder();
leechInterval.addInterval(this.getLevel() - ServerConstants.EXP_SPLIT_LEVEL_INTERVAL, this.getLevel() + ServerConstants.EXP_SPLIT_LEVEL_INTERVAL);
leechInterval.addInterval(this.getLevel() - YamlConfig.config.server.EXP_SPLIT_LEVEL_INTERVAL, this.getLevel() + YamlConfig.config.server.EXP_SPLIT_LEVEL_INTERVAL);
long maxDamage = 0, partyDamage = 0;
MapleCharacter participationMvp = null;
@@ -552,14 +553,14 @@ public class MapleMonster extends AbstractLoadedMapleLife {
// thanks Thora for pointing out leech level limitation
int chrLevel = e.getKey().getLevel();
leechInterval.addInterval(chrLevel - ServerConstants.EXP_SPLIT_LEECH_INTERVAL, chrLevel + ServerConstants.EXP_SPLIT_LEECH_INTERVAL);
leechInterval.addInterval(chrLevel - YamlConfig.config.server.EXP_SPLIT_LEECH_INTERVAL, chrLevel + YamlConfig.config.server.EXP_SPLIT_LEECH_INTERVAL);
}
List<MapleCharacter> expMembers = new LinkedList<>();
int totalPartyLevel = 0;
// thanks G h o s t, Alfred, Vcoc, BHB for poiting out a bug in detecting party members after membership transactions in a party took place
if (ServerConstants.USE_ENFORCE_MOB_LEVEL_RANGE) {
if (YamlConfig.config.server.USE_ENFORCE_MOB_LEVEL_RANGE) {
for (MapleCharacter member : partyParticipation.keySet().iterator().next().getPartyMembersOnSameMap()) {
if (!leechInterval.inInterval(member.getLevel())) {
underleveled.add(member);
@@ -685,7 +686,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
// thanks Prophecy & Aika for finding out Holy Symbol not being applied on party bonuses
Integer holySymbol = attacker.getBuffedValue(MapleBuffStat.HOLY_SYMBOL);
if (holySymbol != null) {
if (ServerConstants.USE_FULL_HOLY_SYMBOL) { // thanks Mordred, xinyifly, AyumiLove, andy33 for noticing HS hands out 20% of its potential on less than 3 players
if (YamlConfig.config.server.USE_FULL_HOLY_SYMBOL) { // thanks Mordred, xinyifly, AyumiLove, andy33 for noticing HS hands out 20% of its potential on less than 3 players
multiplier *= (1.0 + (holySymbol.doubleValue() / 100.0));
} else {
multiplier *= (1.0 + (holySymbol.doubleValue() / (hasPartySharers ? 100.0 : 500.0)));
@@ -734,7 +735,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
if (partyExp != null) {
partyExp *= getStatusExpMultiplier(attacker, hasPartySharers);
partyExp *= attacker.getExpRate();
partyExp *= ServerConstants.PARTY_BONUS_EXP_RATE;
partyExp *= YamlConfig.config.server.PARTY_BONUS_EXP_RATE;
} else {
partyExp = 0.0f;
}
@@ -964,7 +965,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
private void giveFamilyRep(MapleFamilyEntry entry) {
if(entry != null) {
int repGain = isBoss() ? ServerConstants.FAMILY_REP_PER_BOSS_KILL : ServerConstants.FAMILY_REP_PER_KILL;
int repGain = isBoss() ? YamlConfig.config.server.FAMILY_REP_PER_BOSS_KILL : YamlConfig.config.server.FAMILY_REP_PER_KILL;
if(getMaxHp() <= 1) repGain = 0; //don't count trash mobs
entry.giveReputationToSenior(repGain, true);
}
@@ -1401,7 +1402,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
int i = (skillid == Crusader.ARMOR_CRASH ? 1 : (skillid == WhiteKnight.MAGIC_CRASH ? 2 : 0));
debuffMobStat(statups[i]);
if(ServerConstants.USE_ANTI_IMMUNITY_CRASH) {
if(YamlConfig.config.server.USE_ANTI_IMMUNITY_CRASH) {
if (skillid == Crusader.ARMOR_CRASH) {
if(!isBuffed(MonsterStatus.WEAPON_REFLECT)) {
debuffMobStat(MonsterStatus.WEAPON_IMMUNITY);
@@ -2213,7 +2214,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
};
// had to schedule this since mob wouldn't stick to puppet aggro who knows why
this.getMap().getChannelServer().registerOverallAction(this.getMap().getId(), r, ServerConstants.UPDATE_INTERVAL);
this.getMap().getChannelServer().registerOverallAction(this.getMap().getId(), r, YamlConfig.config.server.UPDATE_INTERVAL);
}
/**
@@ -20,6 +20,7 @@
*/
package server.life;
import config.YamlConfig;
import constants.ItemConstants;
import constants.ServerConstants;
import java.io.File;
@@ -138,7 +139,7 @@ public class MapleMonsterInformationProvider {
// this reads the drop entries searching for multi-equip, properly processing them
List<MonsterDropEntry> list = retrieveDrop(monsterId);
if (hasNoMultiEquipDrops.contains(monsterId) || !ServerConstants.USE_MULTIPLE_SAME_EQUIP_DROP) {
if (hasNoMultiEquipDrops.contains(monsterId) || !YamlConfig.config.server.USE_MULTIPLE_SAME_EQUIP_DROP) {
return list;
}
+2 -1
View File
@@ -21,6 +21,7 @@
*/
package server.life;
import config.YamlConfig;
import server.life.positioner.MaplePlayerNPCPositioner;
import server.life.positioner.MaplePlayerNPCPodium;
import java.awt.Point;
@@ -426,7 +427,7 @@ public class MaplePlayerNPC extends AbstractMapleMapObject {
}
}
if(ServerConstants.USE_DEBUG) System.out.println("GOT SID " + scriptId + " POS " + pos);
if(YamlConfig.config.server.USE_DEBUG) System.out.println("GOT SID " + scriptId + " POS " + pos);
int worldId = chr.getWorld();
int jobId = (chr.getJob().getId() / 100) * 100;
@@ -19,6 +19,7 @@
*/
package server.life.positioner;
import config.YamlConfig;
import constants.ServerConstants;
import java.awt.Point;
import java.util.ArrayList;
@@ -85,7 +86,7 @@ public class MaplePlayerNPCPodium {
private static Point reorganizePlayerNpcs(MapleMap map, int newStep, List<MapleMapObject> mmoList) {
if(!mmoList.isEmpty()) {
if(ServerConstants.USE_DEBUG) System.out.println("Reorganizing pnpc map, step " + newStep);
if(YamlConfig.config.server.USE_DEBUG) System.out.println("Reorganizing pnpc map, step " + newStep);
List<MaplePlayerNPC> playerNpcs = new ArrayList<>(mmoList.size());
for(MapleMapObject mmo : mmoList) {
@@ -135,7 +136,7 @@ public class MaplePlayerNPCPodium {
int podiumStep = podiumData % (1 << 5), podiumCount = (podiumData / (1 << 5));
if(podiumCount >= 3 * podiumStep) {
if(podiumStep >= ServerConstants.PLAYERNPC_AREA_STEPS) return null;
if(podiumStep >= YamlConfig.config.server.PLAYERNPC_AREA_STEPS) return null;
List<MapleMapObject> mmoList = map.getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.PLAYER_NPC));
map.getWorldServer().setPlayerNpcMapPodiumData(map.getId(), encodePodiumData(podiumStep + 1, podiumCount + 1));
@@ -19,6 +19,7 @@
*/
package server.life.positioner;
import config.YamlConfig;
import constants.ServerConstants;
import java.awt.Point;
import java.awt.Rectangle;
@@ -59,18 +60,18 @@ public class MaplePlayerNPCPositioner {
}
private static int calcDx(int newStep) {
return ServerConstants.PLAYERNPC_AREA_X / (newStep + 1);
return YamlConfig.config.server.PLAYERNPC_AREA_X / (newStep + 1);
}
private static int calcDy(int newStep) {
return (ServerConstants.PLAYERNPC_AREA_Y / 2) + (ServerConstants.PLAYERNPC_AREA_Y / (1 << (newStep + 1)));
return (YamlConfig.config.server.PLAYERNPC_AREA_Y / 2) + (YamlConfig.config.server.PLAYERNPC_AREA_Y / (1 << (newStep + 1)));
}
private static List<Point> rearrangePlayerNpcPositions(MapleMap map, int newStep, int pnpcsSize) {
Rectangle mapArea = map.getMapArea();
int leftPx = mapArea.x + ServerConstants.PLAYERNPC_INITIAL_X, px, py = mapArea.y + ServerConstants.PLAYERNPC_INITIAL_Y;
int outx = mapArea.x + mapArea.width - ServerConstants.PLAYERNPC_INITIAL_X, outy = mapArea.y + mapArea.height;
int leftPx = mapArea.x + YamlConfig.config.server.PLAYERNPC_INITIAL_X, px, py = mapArea.y + YamlConfig.config.server.PLAYERNPC_INITIAL_Y;
int outx = mapArea.x + mapArea.width - YamlConfig.config.server.PLAYERNPC_INITIAL_X, outy = mapArea.y + mapArea.height;
int cx = calcDx(newStep), cy = calcDy(newStep);
List<Point> otherPlayerNpcs = new LinkedList<>();
@@ -101,8 +102,8 @@ public class MaplePlayerNPCPositioner {
private static Point rearrangePlayerNpcs(MapleMap map, int newStep, List<MaplePlayerNPC> pnpcs) {
Rectangle mapArea = map.getMapArea();
int leftPx = mapArea.x + ServerConstants.PLAYERNPC_INITIAL_X, px, py = mapArea.y + ServerConstants.PLAYERNPC_INITIAL_Y;
int outx = mapArea.x + mapArea.width - ServerConstants.PLAYERNPC_INITIAL_X, outy = mapArea.y + mapArea.height;
int leftPx = mapArea.x + YamlConfig.config.server.PLAYERNPC_INITIAL_X, px, py = mapArea.y + YamlConfig.config.server.PLAYERNPC_INITIAL_Y;
int outx = mapArea.x + mapArea.width - YamlConfig.config.server.PLAYERNPC_INITIAL_X, outy = mapArea.y + mapArea.height;
int cx = calcDx(newStep), cy = calcDy(newStep);
List<Point> otherPlayerNpcs = new LinkedList<>();
@@ -138,7 +139,7 @@ public class MaplePlayerNPCPositioner {
private static Point reorganizePlayerNpcs(MapleMap map, int newStep, List<MapleMapObject> mmoList) {
if(!mmoList.isEmpty()) {
if(ServerConstants.USE_DEBUG) System.out.println("Reorganizing pnpc map, step " + newStep);
if(YamlConfig.config.server.USE_DEBUG) System.out.println("Reorganizing pnpc map, step " + newStep);
List<MaplePlayerNPC> playerNpcs = new ArrayList<>(mmoList.size());
for(MapleMapObject mmo : mmoList) {
@@ -189,12 +190,12 @@ public class MaplePlayerNPCPositioner {
int cx = calcDx(initStep), cy = calcDy(initStep);
Rectangle mapArea = map.getMapArea();
int outx = mapArea.x + mapArea.width - ServerConstants.PLAYERNPC_INITIAL_X, outy = mapArea.y + mapArea.height;
int outx = mapArea.x + mapArea.width - YamlConfig.config.server.PLAYERNPC_INITIAL_X, outy = mapArea.y + mapArea.height;
boolean reorganize = false;
int i = initStep;
while(i < ServerConstants.PLAYERNPC_AREA_STEPS) {
int leftPx = mapArea.x + ServerConstants.PLAYERNPC_INITIAL_X, px, py = mapArea.y + ServerConstants.PLAYERNPC_INITIAL_Y;
while(i < YamlConfig.config.server.PLAYERNPC_AREA_STEPS) {
int leftPx = mapArea.x + YamlConfig.config.server.PLAYERNPC_INITIAL_X, px, py = mapArea.y + YamlConfig.config.server.PLAYERNPC_INITIAL_Y;
while(py < outy) {
px = leftPx;
@@ -207,7 +208,7 @@ public class MaplePlayerNPCPositioner {
map.getWorldServer().setPlayerNpcMapStep(map.getId(), i);
}
if(reorganize && ServerConstants.PLAYERNPC_ORGANIZE_AREA) {
if(reorganize && YamlConfig.config.server.PLAYERNPC_ORGANIZE_AREA) {
return reorganizePlayerNpcs(map, i, mmoList);
}
@@ -226,13 +227,13 @@ public class MaplePlayerNPCPositioner {
cx = calcDx(i);
cy = calcDy(i);
if(ServerConstants.PLAYERNPC_ORGANIZE_AREA) {
if(YamlConfig.config.server.PLAYERNPC_ORGANIZE_AREA) {
otherPlayerNpcs = rearrangePlayerNpcPositions(map, i, mmoList.size());
}
}
if(i > initStep) {
map.getWorldServer().setPlayerNpcMapStep(map.getId(), ServerConstants.PLAYERNPC_AREA_STEPS - 1);
map.getWorldServer().setPlayerNpcMapStep(map.getId(), YamlConfig.config.server.PLAYERNPC_AREA_STEPS - 1);
}
return null;
}
+3 -1
View File
@@ -23,6 +23,8 @@ package server.maps;
import java.awt.Point;
import java.util.Collection;
import config.YamlConfig;
import tools.Pair;
import client.MapleCharacter;
@@ -50,7 +52,7 @@ public class MapleDoor {
this.target = owner.getMap();
if(target.canDeployDoor(targetPosition)) {
if(ServerConstants.USE_ENFORCE_MDOOR_POSITION) {
if(YamlConfig.config.server.USE_ENFORCE_MDOOR_POSITION) {
posStatus = target.getDoorPositionStatus(targetPosition);
}
+4 -3
View File
@@ -31,6 +31,7 @@ import client.inventory.manipulator.MapleInventoryManipulator;
import client.inventory.manipulator.MapleKarmaManipulator;
import client.processor.FredrickProcessor;
import com.mysql.jdbc.Statement;
import config.YamlConfig;
import constants.ServerConstants;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -232,7 +233,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
chr.announce(MaplePacketCreator.updateHiredMerchant(this, chr));
}
if (ServerConstants.USE_ENFORCE_MERCHANT_SAVE) {
if (YamlConfig.config.server.USE_ENFORCE_MERCHANT_SAVE) {
chr.saveCharToDB(false);
}
}
@@ -287,7 +288,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
pItem.setDoesExist(false);
}
if(ServerConstants.USE_ANNOUNCE_SHOPITEMSOLD) { // idea thanks to Vcoc
if(YamlConfig.config.server.USE_ANNOUNCE_SHOPITEMSOLD) { // idea thanks to Vcoc
announceItemSold(newItem, price, getQuantityLeft(pItem.getItem().getItemId()));
}
@@ -448,7 +449,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
e.printStackTrace();
}
if (ServerConstants.USE_ENFORCE_MERCHANT_SAVE) {
if (YamlConfig.config.server.USE_ENFORCE_MERCHANT_SAVE) {
c.getPlayer().saveCharToDB(false);
}
+12 -11
View File
@@ -31,6 +31,7 @@ import client.inventory.MapleInventoryType;
import client.inventory.MaplePet;
import client.status.MonsterStatus;
import client.status.MonsterStatusEffect;
import config.YamlConfig;
import constants.GameConstants;
import constants.ItemConstants;
import constants.ServerConstants;
@@ -251,7 +252,7 @@ public class MapleMap {
private static double getRangedDistance() {
return(ServerConstants.USE_MAXRANGE ? Double.POSITIVE_INFINITY : 722500);
return(YamlConfig.config.server.USE_MAXRANGE ? Double.POSITIVE_INFINITY : 722500);
}
public List<MapleMapObject> getMapObjectsInRect(Rectangle box, List<MapleMapObjectType> types) {
@@ -752,7 +753,7 @@ public class MapleMap {
final List<MonsterDropEntry> dropEntry = new ArrayList<>();
final List<MonsterDropEntry> visibleQuestEntry = new ArrayList<>();
final List<MonsterDropEntry> otherQuestEntry = new ArrayList<>();
sortDropEntries(ServerConstants.USE_SPAWN_RELEVANT_LOOT ? mob.retrieveRelevantDrops() : mi.retrieveEffectiveDrop(mob.getId()), dropEntry, visibleQuestEntry, otherQuestEntry, chr);
sortDropEntries(YamlConfig.config.server.USE_SPAWN_RELEVANT_LOOT ? mob.retrieveRelevantDrops() : mi.retrieveEffectiveDrop(mob.getId()), dropEntry, visibleQuestEntry, otherQuestEntry, chr);
registerMobItemDrops(droptype, mobpos, chRate, pos, dropEntry, visibleQuestEntry, otherQuestEntry, globalEntry, chr, mob);
}
@@ -786,7 +787,7 @@ public class MapleMap {
expireItemsTask.cancel(false);
expireItemsTask = null;
if(ServerConstants.USE_SPAWN_LOOT_ON_ANIMATION) {
if(YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
mobSpawnLootTask.cancel(false);
mobSpawnLootTask = null;
}
@@ -846,16 +847,16 @@ public class MapleMap {
cleanItemMonitor();
}
}
}, ServerConstants.ITEM_MONITOR_TIME, ServerConstants.ITEM_MONITOR_TIME);
}, YamlConfig.config.server.ITEM_MONITOR_TIME, YamlConfig.config.server.ITEM_MONITOR_TIME);
expireItemsTask = TimerManager.getInstance().register(new Runnable() {
@Override
public void run() {
makeDisappearExpiredItemDrops();
}
}, ServerConstants.ITEM_EXPIRE_CHECK, ServerConstants.ITEM_EXPIRE_CHECK);
}, YamlConfig.config.server.ITEM_EXPIRE_CHECK, YamlConfig.config.server.ITEM_EXPIRE_CHECK);
if(ServerConstants.USE_SPAWN_LOOT_ON_ANIMATION) {
if(YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
lootLock.lock();
try {
mobLootEntries.clear();
@@ -898,7 +899,7 @@ public class MapleMap {
}
private void instantiateItemDrop(MapleMapItem mdrop) {
if(droppedItemCount.get() >= ServerConstants.ITEM_LIMIT_ON_MAP) {
if(droppedItemCount.get() >= YamlConfig.config.server.ITEM_LIMIT_ON_MAP) {
MapleMapObject mapobj;
do {
@@ -930,7 +931,7 @@ public class MapleMap {
}
private void registerItemDrop(MapleMapItem mdrop) {
droppedItems.put(mdrop, !everlast ? Server.getInstance().getCurrentTime() + ServerConstants.ITEM_EXPIRE_TIME : Long.MAX_VALUE);
droppedItems.put(mdrop, !everlast ? Server.getInstance().getCurrentTime() + YamlConfig.config.server.ITEM_EXPIRE_TIME : Long.MAX_VALUE);
}
private void unregisterItemDrop(MapleMapItem mdrop) {
@@ -975,7 +976,7 @@ public class MapleMap {
private void registerMobItemDrops(byte droptype, int mobpos, int chRate, Point pos, List<MonsterDropEntry> dropEntry, List<MonsterDropEntry> visibleQuestEntry, List<MonsterDropEntry> otherQuestEntry, List<MonsterGlobalDropEntry> globalEntry, MapleCharacter chr, MapleMonster mob) {
MobLootEntry mle = new MobLootEntry(droptype, mobpos, chRate, pos, dropEntry, visibleQuestEntry, otherQuestEntry, globalEntry, chr, mob);
if(ServerConstants.USE_SPAWN_LOOT_ON_ANIMATION) {
if(YamlConfig.config.server.USE_SPAWN_LOOT_ON_ANIMATION) {
int animationTime = mob.getAnimationTime("die1");
lootLock.lock();
@@ -2218,7 +2219,7 @@ public class MapleMap {
}
};
getWorldServer().registerTimedMapObject(expireKite, ServerConstants.KITE_EXPIRE_TIME);
getWorldServer().registerTimedMapObject(expireKite, YamlConfig.config.server.KITE_EXPIRE_TIME);
}
public final void spawnItemDrop(final MapleMapObject dropper, final MapleCharacter owner, final Item item, Point pos, final boolean ffaDrop, final boolean playerDrop) {
@@ -3680,7 +3681,7 @@ public class MapleMap {
System.out.println("----------------------------------");
*/
if(ServerConstants.USE_ENABLE_FULL_RESPAWN) {
if(YamlConfig.config.server.USE_ENABLE_FULL_RESPAWN) {
return (monsterSpawn.size() - spawnedMonstersOnMap.get());
}
+2 -1
View File
@@ -23,6 +23,7 @@ package server.maps;
import client.MapleClient;
import client.status.MonsterStatus;
import config.YamlConfig;
import constants.ServerConstants;
import java.awt.Rectangle;
@@ -256,7 +257,7 @@ public class MapleReactor extends AbstractMapleMapObject {
cancelReactorTimeout();
attackHit = wHit;
if (ServerConstants.USE_DEBUG == true) {
if (YamlConfig.config.server.USE_DEBUG == true) {
c.getPlayer().dropMessage(5, "Hitted REACTOR " + this.getId() + " with POS " + charPos + " , STANCE " + stance + " , SkillID " + skillid + " , STATE " + stats.getType(state) + " STATESIZE " + stats.getStateSize(state));
}
ReactorScriptManager.getInstance().onHit(c, this);
+2 -1
View File
@@ -2,6 +2,7 @@ package server.partyquest;
import java.util.concurrent.ScheduledFuture;
import client.MapleCharacter;
import config.YamlConfig;
import constants.LanguageConstants;
import constants.ServerConstants;
import net.server.Server;
@@ -112,7 +113,7 @@ public class MonsterCarnival {
public void run() {
respawn();
}
}, ServerConstants.RESPAWN_INTERVAL);
}, YamlConfig.config.server.RESPAWN_INTERVAL);
cs.initMonsterCarnival(cpq1, room);
} catch (Exception e) {
+4 -3
View File
@@ -31,6 +31,7 @@ import client.MapleCharacter;
import client.MapleCharacter.DelayedQuestUpdate;
import client.MapleQuestStatus;
import client.MapleQuestStatus.Status;
import config.YamlConfig;
import constants.ServerConstants;
import java.util.EnumMap;
import java.util.Set;
@@ -228,7 +229,7 @@ public class MapleQuest {
if(!repeatable) return false;
IntervalRequirement ir = (IntervalRequirement) startReqs.get(MapleQuestRequirementType.INTERVAL);
return ir.getInterval() < ServerConstants.QUEST_POINT_REPEATABLE_INTERVAL * 60 * 60 * 1000;
return ir.getInterval() < YamlConfig.config.server.QUEST_POINT_REPEATABLE_INTERVAL * 60 * 60 * 1000;
}
public boolean canStartWithoutRequirements(MapleCharacter c) {
@@ -331,8 +332,8 @@ public class MapleQuest {
c.updateQuest(newStatus);
if(id / 100 == 35 && ServerConstants.TOT_MOB_QUEST_REQUIREMENT > 0) {
int setProg = 999 - Math.min(999, ServerConstants.TOT_MOB_QUEST_REQUIREMENT);
if(id / 100 == 35 && YamlConfig.config.server.TOT_MOB_QUEST_REQUIREMENT > 0) {
int setProg = 999 - Math.min(999, YamlConfig.config.server.TOT_MOB_QUEST_REQUIREMENT);
for(Integer pid : newStatus.getProgress().keySet()) {
if(pid >= 8200000 && pid <= 8200012) {
+2 -1
View File
@@ -22,6 +22,7 @@
package server.quest.actions;
import client.MapleCharacter;
import config.YamlConfig;
import constants.ServerConstants;
import provider.MapleData;
import provider.MapleDataTool;
@@ -52,7 +53,7 @@ public class ExpAction extends MapleQuestAction {
}
public static void runAction(MapleCharacter chr, int gain) {
if (!ServerConstants.USE_QUEST_RATE) {
if (!YamlConfig.config.server.USE_QUEST_RATE) {
chr.gainExp(gain * chr.getExpRate(), true, true);
} else {
chr.gainExp(gain * chr.getQuestExpRate(), true, true);
+2 -1
View File
@@ -22,6 +22,7 @@
package server.quest.actions;
import client.MapleCharacter;
import config.YamlConfig;
import constants.ServerConstants;
import provider.MapleData;
import provider.MapleDataTool;
@@ -56,7 +57,7 @@ public class MesoAction extends MapleQuestAction {
if (gain < 0) {
chr.gainMeso(gain, true, false, true);
} else {
if (!ServerConstants.USE_QUEST_RATE) {
if (!YamlConfig.config.server.USE_QUEST_RATE) {
chr.gainMeso(gain * chr.getMesoRate(), true, false, true);
} else {
chr.gainMeso(gain * chr.getQuestMesoRate(), true, false, true);