Refactored caching of drop rates. Whittling away at MBServerStatics.
This commit is contained in:
@@ -9,10 +9,12 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.TargetColor;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.server.world.WorldServer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.TreeMap;
|
||||
@@ -333,7 +335,7 @@ public class Experience {
|
||||
double xp = 0.0;
|
||||
|
||||
//Get the xp modifier for the world
|
||||
float xpMod = MBServerStatics.EXP_RATE_MOD;
|
||||
float xpMod = Enum.DropRateType.EXP_RATE_MOD.rate;
|
||||
|
||||
|
||||
|
||||
@@ -393,7 +395,7 @@ public class Experience {
|
||||
// Modify for hotzone
|
||||
if (xp != 0)
|
||||
if (ZoneManager.inHotZone(mob.getLoc()))
|
||||
xp *= MBServerStatics.HOT_EXP_RATE_MOD;
|
||||
xp *= Enum.DropRateType.HOT_EXP_RATE_MOD.rate;
|
||||
|
||||
// Check for 0 XP due to white mob, otherwise subtract penalty
|
||||
// xp
|
||||
@@ -427,7 +429,7 @@ public class Experience {
|
||||
|
||||
// Modify for hotzone
|
||||
if (ZoneManager.inHotZone(mob.getLoc()))
|
||||
xp *= MBServerStatics.HOT_EXP_RATE_MOD;
|
||||
xp *= Enum.DropRateType.HOT_EXP_RATE_MOD.rate;
|
||||
|
||||
// Errant penalty
|
||||
if (xp != 1)
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ItemContainerType;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.Enum.OwnerType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.server.MBServerStatics;
|
||||
import engine.server.world.WorldServer;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -208,7 +210,7 @@ public class LootTable {
|
||||
|
||||
float chance = mlb.getChance() *.01f;
|
||||
|
||||
chance *= MBServerStatics.DROP_RATE_MOD;
|
||||
chance *= Enum.DropRateType.DROP_RATE_MOD.rate;
|
||||
|
||||
calculatedLootTable = mlb.getLootTableID();
|
||||
|
||||
|
||||
@@ -1508,15 +1508,15 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
|
||||
|
||||
//server specific gold multiplier
|
||||
double goldMod = MBServerStatics.GOLD_RATE_MOD;
|
||||
double goldMod = DropRateType.GOLD_RATE_MOD.rate;
|
||||
gold *= goldMod;
|
||||
|
||||
//modify for hotzone
|
||||
|
||||
if (ZoneManager.inHotZone(mob.getLoc()))
|
||||
gold *= MBServerStatics.HOT_GOLD_RATE_MOD;
|
||||
gold *= DropRateType.HOT_GOLD_RATE_MOD.rate;
|
||||
|
||||
gold *= MBServerStatics.GOLD_RATE_MOD;
|
||||
gold *= DropRateType.GOLD_RATE_MOD.rate;
|
||||
|
||||
return (int) gold;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user