Browse Source

forced hourly rune and contract drops

lakebane-master
FatBoy-DOTC 5 months ago
parent
commit
de1bc375ca
  1. 11
      src/engine/gameManager/LootManager.java
  2. 2
      src/engine/objects/Zone.java

11
src/engine/gameManager/LootManager.java

@ -130,6 +130,15 @@ public enum LootManager { @@ -130,6 +130,15 @@ public enum LootManager {
mob.getCharItemManager().addItemToInventory(extraLoot);
}
hasExtraRolled = true;
if(mob.parentZone.lastContractDrop + 3600000 > System.currentTimeMillis()){
//no contract in last hour, force roll for one
rollForContract(bse.genTable, mob);
}
if(mob.parentZone.lastRuneDrop + 3600000 > System.currentTimeMillis()){
//no rune in last hour, force roll for one
rollForRune(bse.genTable, mob);
}
}
break;
case "ITEM":
@ -532,6 +541,7 @@ public enum LootManager { @@ -532,6 +541,7 @@ public enum LootManager {
}
public static MobLoot rollForContract(int table, Mob mob) {
mob.parentZone.lastContractDrop = System.currentTimeMillis();
int roll = (table == 1900 || table == 1500) ? 73 : 99;
GenTableEntry selectedRow = GenTableEntry.rollTable(table, roll, 1.0f);
if (selectedRow == null) {
@ -552,6 +562,7 @@ public enum LootManager { @@ -552,6 +562,7 @@ public enum LootManager {
}
public static MobLoot rollForRune(int table, Mob mob) {
mob.parentZone.lastRuneDrop = System.currentTimeMillis();
int roll = (table == 1900 || table == 1500) ? 77 : 97;
GenTableEntry selectedRow = GenTableEntry.rollTable(table, roll, 1.0f);
if (selectedRow == null) {

2
src/engine/objects/Zone.java

@ -61,6 +61,8 @@ public class Zone extends AbstractGameObject { @@ -61,6 +61,8 @@ public class Zone extends AbstractGameObject {
//public static ArrayList<Mob> respawnQue = new ArrayList<>();
public static final Set<Mob> respawnQue = Collections.newSetFromMap(new ConcurrentHashMap<>());
public static long lastRespawn = 0;
public long lastRuneDrop = 0;
public long lastContractDrop = 0;
/**
* ResultSet Constructor
*/

Loading…
Cancel
Save