mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-12-21 23:18:52 -05:00
Added option to disable congrats on max level
Added option for wilderness standstill time Closes #16 Added config for bonus xp in wild
This commit is contained in:
parent
2b976a8041
commit
d8f211d45d
@ -18,8 +18,26 @@
|
||||
|
||||
<entry key="members">false</entry>
|
||||
<entry key="f2pwildy">true</entry>
|
||||
|
||||
|
||||
<entry key="expRate">4.0</entry>
|
||||
<entry key="subExpRate">4.0</entry>
|
||||
<!-- The minimum level required for the player to get the non-combat bonus
|
||||
XP for being in the wilderness -->
|
||||
<entry key="wild-non-combat-min-level">999</entry>
|
||||
|
||||
<!-- The following two are rates that are added to the player's XP rate -->
|
||||
<entry key="wild-non-combat-bonus">0</entry>
|
||||
<entry key="wild-combat-bonus">0</entry>
|
||||
|
||||
<!-- The amount of time (in ms) that a player must stand still in the wild
|
||||
(without being in combat) before they can log out. The message will say they
|
||||
must wait x seconds. -->
|
||||
<entry key="wild-stand-still-time">10000</entry>
|
||||
|
||||
<!-- If true, a message will be sent to all online players when someone
|
||||
reaches the max level for a skill -->
|
||||
<entry key="max-level-congrats">false</entry>
|
||||
|
||||
<!-- Separate names by commas -->
|
||||
<entry key="pmods">None</entry>
|
||||
@ -45,8 +63,6 @@
|
||||
most active IPs will be stored at a time. -->
|
||||
<entry key="connection-throttle">5</entry>
|
||||
|
||||
|
||||
|
||||
<!-- Every 100 minutes -->
|
||||
<entry key="garbage-collect-interval">6000000</entry>
|
||||
<!-- Every 5 minutes -->
|
||||
|
@ -28,17 +28,15 @@ public class Config {
|
||||
|
||||
public static boolean members, f2pWildy, APPLICATION_LEVEL_BLOCKING;
|
||||
|
||||
public static double expRate, subExpRate;
|
||||
public static double expRate, subExpRate, WILD_NON_COMBAT_BONUS, WILD_COMBAT_BONUS;
|
||||
|
||||
public static String[] pmods, mods, admins;
|
||||
public static int IP_BAN_REMOVAL_DELAY;
|
||||
public static int GARBAGE_COLLECT_INTERVAL;
|
||||
public static int SAVE_INTERVAL;
|
||||
public static int IP_BAN_REMOVAL_DELAY, GARBAGE_COLLECT_INTERVAL, SAVE_INTERVAL;
|
||||
public static String DATE_FORMAT, BLOCK_COMMAND, UNBLOCK_COMMAND,
|
||||
ALERT_CONFIG, COMMAND_CONFIG;
|
||||
public static int CONNECTION_THROTTLE_SIZE;
|
||||
public static int CONNECTION_THROTTLE_SIZE, WILD_LEVEL_FOR_NON_COMBAT_BONUS, WILD_STAND_STILL_TIME;
|
||||
public static boolean OS_LEVEL_BLOCKING, APPLICATION_LEVEL_THROTTLE_ALERT,
|
||||
OS_LEVEL_THROTTLE_ALERT, OS_LEVEL_UNBLOCK_FAILED_ALERT;
|
||||
OS_LEVEL_THROTTLE_ALERT, OS_LEVEL_UNBLOCK_FAILED_ALERT, CONGRATS_FOR_MAX_LEVEL;
|
||||
|
||||
static {
|
||||
loadEnv();
|
||||
@ -111,6 +109,14 @@ public class Config {
|
||||
|
||||
ALERT_CONFIG = props.getProperty("alert-config");
|
||||
COMMAND_CONFIG = props.getProperty("command-config");
|
||||
|
||||
|
||||
WILD_STAND_STILL_TIME = Integer.parseInt(props.getProperty("wild-stand-still-time"));
|
||||
WILD_LEVEL_FOR_NON_COMBAT_BONUS = Integer.parseInt(props.getProperty("wild-non-combat-min-level"));
|
||||
WILD_NON_COMBAT_BONUS = Double.parseDouble(props.getProperty("wild-non-combat-bonus"));
|
||||
WILD_COMBAT_BONUS = Double.parseDouble(props.getProperty("wild-combat-bonus"));
|
||||
CONGRATS_FOR_MAX_LEVEL = Boolean.parseBoolean(props.getProperty("max-level-congrats"));
|
||||
|
||||
|
||||
props.clear();
|
||||
|
||||
|
@ -659,14 +659,14 @@ public final class Player extends Mob {
|
||||
public boolean canLogout() {
|
||||
if (this != null && this.location != null
|
||||
&& this.location.inWilderness()) {
|
||||
if (GameEngine.getTime() - this.getLastMoved() < 10000) {
|
||||
if (GameEngine.getTime() - this.getLastMoved() < Config.WILD_STAND_STILL_TIME) {
|
||||
getActionSender()
|
||||
.sendMessage(
|
||||
"You must stand peacefully in one place for 10 seconds!");
|
||||
"You must stand peacefully in one place for " + Config.WILD_STAND_STILL_TIME + " seconds!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return !isBusy() && GameEngine.getTime() - getCombatTimer() > 10000;
|
||||
return !isBusy() && GameEngine.getTime() - getCombatTimer() > Config.WILD_STAND_STILL_TIME;
|
||||
}
|
||||
|
||||
public boolean canReport() {
|
||||
@ -1570,7 +1570,6 @@ public final class Player extends Mob {
|
||||
return wrongwords;
|
||||
}
|
||||
|
||||
// incExp
|
||||
public int ignoreCount() {
|
||||
return ignoreList.size();
|
||||
}
|
||||
@ -1606,13 +1605,8 @@ public final class Player extends Mob {
|
||||
}
|
||||
}
|
||||
if (combat && i < 3
|
||||
&& (combatStyleToIndex() != i && getCombatStyle() != 0)) { // fix
|
||||
// for
|
||||
// accidental
|
||||
// exp
|
||||
// in
|
||||
// other
|
||||
// stats?
|
||||
&& (combatStyleToIndex() != i && getCombatStyle() != 0)) {
|
||||
// fix for accidental exp in other stats?
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1623,9 +1617,9 @@ public final class Player extends Mob {
|
||||
|
||||
if (getLocation().wildernessLevel() > 1) {
|
||||
if (combat)
|
||||
exprate = exprate * 2;
|
||||
if (getLocation().wildernessLevel() > 10 && !combat)
|
||||
exprate = exprate * 2;
|
||||
exprate += Config.WILD_COMBAT_BONUS;
|
||||
if (getLocation().wildernessLevel() > Config.WILD_LEVEL_FOR_NON_COMBAT_BONUS && !combat)
|
||||
exprate += Config.WILD_NON_COMBAT_BONUS;
|
||||
}
|
||||
|
||||
exp[i] += amount * exprate;
|
||||
@ -1639,7 +1633,7 @@ public final class Player extends Mob {
|
||||
incCurStat(i, advanced);
|
||||
incMaxStat(i, advanced);
|
||||
int stat = this.getMaxStat(i);
|
||||
if (stat == 99) {
|
||||
if (stat == 99 && Config.CONGRATS_FOR_MAX_LEVEL) {
|
||||
for (Player p : world.getPlayers()) {
|
||||
if (p != null) {
|
||||
p.getActionSender()
|
||||
|
Loading…
Reference in New Issue
Block a user