Browse Source

THIRD AFTER ROLLBACK: contract and rune and glass drop rates adjusted properly

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
45eb0776d6
  1. 38
      src/engine/gameManager/LootManager.java
  2. 7
      src/engine/objects/Mob.java

38
src/engine/gameManager/LootManager.java

@ -122,20 +122,16 @@ public enum LootManager {
case "LOOT": case "LOOT":
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate))
GenerateLootDrop(mob, bse.genTable); //generate normal loot drop GenerateLootDrop(mob, bse.genTable); //generate normal loot drop
if (mob.parentZone.getSafeZone() == 0 && hasExtraRolled == false && ThreadLocalRandom.current().nextInt(1, 5000) < 15 * dropRate) { if(mob.contractCounter >= 250){
int roll = ThreadLocalRandom.current().nextInt(1, 101); MobLoot extraLoot = rollForContract(bse.genTable, mob);
MobLoot extraLoot = null; if (extraLoot != null)
if (roll <= 50) { mob.getCharItemManager().addItemToInventory(extraLoot);
extraLoot = rollForContract(bse.genTable, mob); }
} if(mob.runeCounter >= 250){
if (roll >= 51) { MobLoot extraLoot = rollForRune(bse.genTable, mob);
extraLoot = rollForRune(bse.genTable, mob); if (extraLoot != null)
} mob.getCharItemManager().addItemToInventory(extraLoot);
if (extraLoot != null) { }
mob.getCharItemManager().addItemToInventory(extraLoot);
}
hasExtraRolled = true;
}
break; break;
case "ITEM": case "ITEM":
GenerateInventoryDrop(mob, bse); GenerateInventoryDrop(mob, bse);
@ -566,7 +562,7 @@ public enum LootManager {
if (_itemTables.containsKey(itemTableId) == false) if (_itemTables.containsKey(itemTableId) == false)
return null; return null;
ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(1,321)); ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(75,321));
if (tableRow == null) if (tableRow == null)
return null; return null;
@ -576,8 +572,10 @@ public enum LootManager {
return null; return null;
MobLoot outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); MobLoot outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false);
if(outItem != null) if(outItem != null) {
mob.contractCounter = 0;
return outItem; return outItem;
}
return null; return null;
} }
public static MobLoot rollForRune(int table, Mob mob){ public static MobLoot rollForRune(int table, Mob mob){
@ -593,7 +591,7 @@ public enum LootManager {
if (_itemTables.containsKey(itemTableId) == false) if (_itemTables.containsKey(itemTableId) == false)
return null; return null;
ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(1,321)); ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, ThreadLocalRandom.current().nextInt(75,321));
if (tableRow == null) if (tableRow == null)
return null; return null;
@ -603,12 +601,14 @@ public enum LootManager {
return null; return null;
MobLoot outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); MobLoot outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false);
if(outItem != null) if(outItem != null) {
mob.runeCounter = 0;
return outItem; return outItem;
}
return null; return null;
} }
public static MobLoot rollForGlass( Mob mob){ public static MobLoot rollForGlass( Mob mob){
ItemTableEntry tableRow = ItemTableEntry.rollTable(126, ThreadLocalRandom.current().nextInt(1,321)); ItemTableEntry tableRow = ItemTableEntry.rollTable(126, ThreadLocalRandom.current().nextInt(220,321));
if (tableRow == null) if (tableRow == null)
return null; return null;

7
src/engine/objects/Mob.java

@ -36,6 +36,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import static engine.gameManager.NPCManager._runeSetMap; import static engine.gameManager.NPCManager._runeSetMap;
@ -85,6 +86,9 @@ public class Mob extends AbstractIntelligenceAgent {
public boolean dropper = false; public boolean dropper = false;
public int contractCounter = 0;
public int runeCounter = 0;
// New Mobile constructor. Fill in the blanks and then call // New Mobile constructor. Fill in the blanks and then call
// PERSIST. // PERSIST.
public Mob() { public Mob() {
@ -167,6 +171,9 @@ public class Mob extends AbstractIntelligenceAgent {
//this.setResists(Resists.getResists(rs.getInt("mob_spawnType"))); //this.setResists(Resists.getResists(rs.getInt("mob_spawnType")));
setResistsForMob(this); setResistsForMob(this);
this.contractCounter = ThreadLocalRandom.current().nextInt(250);
this.runeCounter = ThreadLocalRandom.current().nextInt(250);
} catch (Exception e) { } catch (Exception e) {
Logger.error(e + " " + this.dbID); Logger.error(e + " " + this.dbID);
} }

Loading…
Cancel
Save