Browse Source

Moved away from power (temporary) and into hard coded values

NovaTest
kevin 4 months ago
parent
commit
2cdeaa4d66
  1. 20
      src/engine/gameManager/LootManager.java
  2. 15
      src/engine/objects/Mob.java
  3. 6
      src/engine/util/ZoneLevel.java

20
src/engine/gameManager/LootManager.java

@ -14,6 +14,7 @@ import engine.net.DispatchMessage;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.net.client.msg.chat.ChatSystemMsg;
import engine.objects.*; import engine.objects.*;
import engine.util.ZoneLevel;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.util.ArrayList; import java.util.ArrayList;
@ -100,6 +101,16 @@ public enum LootManager {
boolean hotzoneWasRan = false; boolean hotzoneWasRan = false;
float dropRate = 1.0f; 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 // Iterate all entries in this bootySet and process accordingly
for (BootySetEntry bse : entries) { for (BootySetEntry bse : entries) {
@ -109,12 +120,6 @@ public enum LootManager {
break; break;
case "LOOT": 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)) if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate))
GenerateLootDrop(mob, bse.genTable, false); //generate normal loot drop GenerateLootDrop(mob, bse.genTable, false); //generate normal loot drop
@ -309,6 +314,9 @@ public enum LootManager {
else else
gold = (int) (gold * NORMAL_GOLD_RATE); gold = (int) (gold * NORMAL_GOLD_RATE);
Zone camp = mob.getParentZone();
gold = (int) (gold * ZoneLevel.getGoldDropModifier(camp));
if (gold > 0) { if (gold > 0) {
MobLoot goldAmount = new MobLoot(mob, gold); MobLoot goldAmount = new MobLoot(mob, gold);
mob.getCharItemManager().addItemToInventory(goldAmount); mob.getCharItemManager().addItemToInventory(goldAmount);

15
src/engine/objects/Mob.java

@ -1402,7 +1402,8 @@ public class Mob extends AbstractIntelligenceAgent {
// Set Name based on parent zone level // Set Name based on parent zone level
Zone camp = this.getParentZone(); Zone camp = this.getParentZone();
this.lastName = this.originalLastName + ZoneLevel.getNameSuffix(camp); 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.recalculateStats();
this.setHealth(this.healthMax); 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 // Modify max health based on camp level - bad, we need to use effects for this
//Zone camp = this.getParentZone(); Zone camp = this.getParentZone();
//h = h * ZoneLevel.getMaxHealthPctModifier(camp); h = h * ZoneLevel.getMaxHealthPctModifier(camp);
// Set max health, mana and stamina // Set max health, mana and stamina
@ -1623,8 +1624,8 @@ public class Mob extends AbstractIntelligenceAgent {
defense = (defense < 1) ? 1 : defense; defense = (defense < 1) ? 1 : defense;
// Modify defense for camp level - bad, we need to use effects for this // Modify defense for camp level - bad, we need to use effects for this
// Zone camp = this.getParentZone(); Zone camp = this.getParentZone();
// defense = defense * ZoneLevel.getDefPctModifier(camp); defense = defense * ZoneLevel.getDefPctModifier(camp);
this.defenseRating = (short) (defense + 0.5f); this.defenseRating = (short) (defense + 0.5f);
} catch (Exception e) { } catch (Exception e) {
@ -1827,6 +1828,10 @@ public class Mob extends AbstractIntelligenceAgent {
atr *= (1 + neg_Bonus); 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; atr = (atr < 1) ? 1 : atr;
// set atr // set atr

6
src/engine/util/ZoneLevel.java

@ -8,6 +8,7 @@ public class ZoneLevel {
private static final float atrPctPerLevel = (float)0.2; private static final float atrPctPerLevel = (float)0.2;
private static final float defPctPerLevel = (float)0.2; private static final float defPctPerLevel = (float)0.2;
private static final float lootPctPerLevel = (float)0.1; 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 campLvlAnnounceThreshold = 5;
public static final int campMaxLvl = 10; public static final int campMaxLvl = 10;
@ -59,7 +60,10 @@ public class ZoneLevel {
return getGenericModifier(zone, lootPctPerLevel); return getGenericModifier(zone, lootPctPerLevel);
} }
public static float getGoldDropModifier(Zone zone)
{
return getGenericModifier(zone, goldPctPerLevel);
}
private static float getGenericModifier(Zone zone, float modifierPerLevel) private static float getGenericModifier(Zone zone, float modifierPerLevel)
{ {

Loading…
Cancel
Save