From 2cdeaa4d6658c9d336254131368f606fb1056b81 Mon Sep 17 00:00:00 2001 From: kevin Date: Sun, 18 Aug 2024 13:51:54 -0400 Subject: [PATCH] Moved away from power (temporary) and into hard coded values --- src/engine/gameManager/LootManager.java | 20 ++++++++++++++------ src/engine/objects/Mob.java | 15 ++++++++++----- src/engine/util/ZoneLevel.java | 6 +++++- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index 35cf63a7..d1a58e97 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -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); diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 7f144b3e..17298da5 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -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 diff --git a/src/engine/util/ZoneLevel.java b/src/engine/util/ZoneLevel.java index e2626a9e..3f3d8621 100644 --- a/src/engine/util/ZoneLevel.java +++ b/src/engine/util/ZoneLevel.java @@ -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) {