forked from MagicBane/Server
Moved away from power (temporary) and into hard coded values
This commit is contained in:
@@ -14,6 +14,7 @@ import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.net.client.msg.chat.ChatSystemMsg;
|
||||
import engine.objects.*;
|
||||
import engine.util.ZoneLevel;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -100,6 +101,16 @@ public enum LootManager {
|
||||
boolean hotzoneWasRan = false;
|
||||
float dropRate = 1.0f;
|
||||
|
||||
if (mob.getSafeZone() == false)
|
||||
dropRate = LootManager.NORMAL_DROP_RATE;
|
||||
|
||||
if (inHotzone == true)
|
||||
dropRate = LootManager.HOTZONE_DROP_RATE;
|
||||
|
||||
// Adjust for camp scaling
|
||||
Zone camp = mob.getParentZone();
|
||||
dropRate = dropRate * ZoneLevel.getLootDropModifier(camp);
|
||||
|
||||
// Iterate all entries in this bootySet and process accordingly
|
||||
|
||||
for (BootySetEntry bse : entries) {
|
||||
@@ -109,12 +120,6 @@ public enum LootManager {
|
||||
break;
|
||||
case "LOOT":
|
||||
|
||||
if (mob.getSafeZone() == false)
|
||||
dropRate = LootManager.NORMAL_DROP_RATE;
|
||||
|
||||
if (inHotzone == true)
|
||||
dropRate = LootManager.HOTZONE_DROP_RATE;
|
||||
|
||||
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate))
|
||||
GenerateLootDrop(mob, bse.genTable, false); //generate normal loot drop
|
||||
|
||||
@@ -309,6 +314,9 @@ public enum LootManager {
|
||||
else
|
||||
gold = (int) (gold * NORMAL_GOLD_RATE);
|
||||
|
||||
Zone camp = mob.getParentZone();
|
||||
gold = (int) (gold * ZoneLevel.getGoldDropModifier(camp));
|
||||
|
||||
if (gold > 0) {
|
||||
MobLoot goldAmount = new MobLoot(mob, gold);
|
||||
mob.getCharItemManager().addItemToInventory(goldAmount);
|
||||
|
||||
@@ -1402,7 +1402,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
// Set Name based on parent zone level
|
||||
Zone camp = this.getParentZone();
|
||||
this.lastName = this.originalLastName + ZoneLevel.getNameSuffix(camp);
|
||||
PowersManager.applyPower(this, this, this.getLoc(), "CMP-001", camp.getCamplvl(), false);
|
||||
|
||||
//PowersManager.applyPower(this, this, this.getLoc(), "CMP-001", camp.getCamplvl(), false);
|
||||
|
||||
this.recalculateStats();
|
||||
this.setHealth(this.healthMax);
|
||||
@@ -1518,8 +1519,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
}
|
||||
|
||||
// Modify max health based on camp level - bad, we need to use effects for this
|
||||
//Zone camp = this.getParentZone();
|
||||
//h = h * ZoneLevel.getMaxHealthPctModifier(camp);
|
||||
Zone camp = this.getParentZone();
|
||||
h = h * ZoneLevel.getMaxHealthPctModifier(camp);
|
||||
|
||||
// Set max health, mana and stamina
|
||||
|
||||
@@ -1623,8 +1624,8 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
defense = (defense < 1) ? 1 : defense;
|
||||
|
||||
// Modify defense for camp level - bad, we need to use effects for this
|
||||
// Zone camp = this.getParentZone();
|
||||
// defense = defense * ZoneLevel.getDefPctModifier(camp);
|
||||
Zone camp = this.getParentZone();
|
||||
defense = defense * ZoneLevel.getDefPctModifier(camp);
|
||||
|
||||
this.defenseRating = (short) (defense + 0.5f);
|
||||
} catch (Exception e) {
|
||||
@@ -1827,6 +1828,10 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
atr *= (1 + neg_Bonus);
|
||||
}
|
||||
|
||||
// Modify atr for camp level - bad, we need to use effects for this
|
||||
Zone camp = this.getParentZone();
|
||||
atr = atr * ZoneLevel.getAtrPctModifier(camp);
|
||||
|
||||
atr = (atr < 1) ? 1 : atr;
|
||||
|
||||
// set atr
|
||||
|
||||
@@ -8,6 +8,7 @@ public class ZoneLevel {
|
||||
private static final float atrPctPerLevel = (float)0.2;
|
||||
private static final float defPctPerLevel = (float)0.2;
|
||||
private static final float lootPctPerLevel = (float)0.1;
|
||||
private static final float goldPctPerLevel = (float)0.2;
|
||||
|
||||
public static final int campLvlAnnounceThreshold = 5;
|
||||
public static final int campMaxLvl = 10;
|
||||
@@ -59,7 +60,10 @@ public class ZoneLevel {
|
||||
return getGenericModifier(zone, lootPctPerLevel);
|
||||
}
|
||||
|
||||
|
||||
public static float getGoldDropModifier(Zone zone)
|
||||
{
|
||||
return getGenericModifier(zone, goldPctPerLevel);
|
||||
}
|
||||
|
||||
private static float getGenericModifier(Zone zone, float modifierPerLevel)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user