From e891d353ba28f7e67fc330bf218d4c29e6f044e2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 11 Feb 2024 22:36:48 -0600 Subject: [PATCH] Vorg mobs drop random piece of set and spawn randomly between 5 and 45 minutes after death --- src/engine/gameManager/LootManager.java | 26 +++++++++++++++++++++++-- src/engine/objects/ItemBase.java | 5 +++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index a3ae1427..245f56e1 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -17,6 +17,7 @@ import engine.objects.*; import org.pmw.tinylog.Logger; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.concurrent.ThreadLocalRandom; @@ -34,6 +35,11 @@ public enum LootManager { public static HashMap> _modTables = new HashMap<>(); public static HashMap> _modTypeTables = new HashMap<>(); + public static ArrayList vorg_ha_uuids = new ArrayList<>(Arrays.asList(new Integer[]{27580, 27590, 188500, 188510, 188520, 188530, 188540, 188550, 189510})); + public static ArrayList vorg_ma_uuids = new ArrayList<>(Arrays.asList(new Integer[]{27570,188900,188910,188920,188930,188940,188950,189500})); + public static ArrayList vorg_la_uuids = new ArrayList<>(Arrays.asList(new Integer[]{27550,27560,189100,189110,189120,189130,189140,189150})); + public static ArrayList vorg_cloth_uuids = new ArrayList<>(Arrays.asList(new Integer[]{27600,188700,188720,189550,189560})); + // Drop Rates public static float NORMAL_DROP_RATE; @@ -327,8 +333,24 @@ public enum LootManager { if (equipmentRoll > dropChance) continue; - - MobLoot ml = new MobLoot(mob, me.getItemBase(), false); + ItemBase genericIB = me.getItemBase(); + if(genericIB.isVorg()){ + if(genericIB.isClothArmor()){ + //get random cloth piece + genericIB = ItemBase.getItemBase(vorg_cloth_uuids.get(ThreadLocalRandom.current().nextInt(0,vorg_cloth_uuids.size() - 1))); + } else if(genericIB.isHeavyArmor()){ + //get random heavy armor piece + genericIB = ItemBase.getItemBase(vorg_ha_uuids.get(ThreadLocalRandom.current().nextInt(0,vorg_ha_uuids.size() - 1))); + } else if(genericIB.isMediumArmor()){ + //get random medium armor piece + genericIB = ItemBase.getItemBase(vorg_ma_uuids.get(ThreadLocalRandom.current().nextInt(0,vorg_ma_uuids.size() - 1))); + } else if(genericIB.isLightArmor()){ + //get random light armor piece + genericIB = ItemBase.getItemBase(vorg_la_uuids.get(ThreadLocalRandom.current().nextInt(0,vorg_la_uuids.size() - 1))); + } + mob.spawnTime = ThreadLocalRandom.current().nextInt(300,2700); + } + MobLoot ml = new MobLoot(mob, genericIB, false); if (ml != null && dropCount < 1) { ml.setIsID(true); diff --git a/src/engine/objects/ItemBase.java b/src/engine/objects/ItemBase.java index 17c5a00c..ad5ff347 100644 --- a/src/engine/objects/ItemBase.java +++ b/src/engine/objects/ItemBase.java @@ -13,6 +13,7 @@ import engine.Enum.DamageType; import engine.Enum.GameObjectType; import engine.Enum.ItemType; import engine.gameManager.DbManager; +import engine.gameManager.LootManager; import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; @@ -914,4 +915,8 @@ public class ItemBase { public void setAutoID(boolean autoID) { this.autoID = autoID; } + + public boolean isVorg(){ + return LootManager.vorg_ha_uuids.contains(this.uuid) || LootManager.vorg_ma_uuids.contains(this.uuid) || LootManager.vorg_la_uuids.contains(this.uuid) || LootManager.vorg_cloth_uuids.contains(this.uuid); + } }