From 40596643544250cb0c897096a0d9fb2dd71dd72f Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 7 Jul 2024 21:14:09 -0500 Subject: [PATCH] stronghold loot --- src/engine/gameManager/LootManager.java | 30 ++++++++++++++++++++----- src/engine/objects/Mine.java | 12 ++++++++++ 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/LootManager.java b/src/engine/gameManager/LootManager.java index e31d306c..a6a9e2c9 100644 --- a/src/engine/gameManager/LootManager.java +++ b/src/engine/gameManager/LootManager.java @@ -664,12 +664,12 @@ public enum LootManager { } - public static void GenerateStrongholdLoot(Mob mob, boolean commander){ + public static void GenerateStrongholdLoot(Mob mob, boolean commander) { mob.getCharItemManager().clearInventory(); int multiplier = 1; - if(commander) + if (commander) multiplier = 2; int high = 500000; @@ -681,9 +681,29 @@ public enum LootManager { mob.getCharItemManager().addItemToInventory(goldAmount); } - for(int i = 0; i < 3 * multiplier; i++){ - DropPresent(mob); - } + int random = 3211 + ThreadLocalRandom.current().nextInt(6); + if(random > 3216) + random = 3216; + + int baseLoot = rollRandomItem(random); + ItemBase contract = ItemBase.getItemBase(baseLoot); + if (contract != null) { + MobLoot toAdd = new MobLoot(mob, contract, false); + + if (toAdd != null) + mob.getCharItemManager().addItemToInventory(toAdd); + + if (commander) { + int glassID = rollRandomItem(126); + ItemBase glassItem = ItemBase.getItemBase(glassID); + if (glassItem != null) { + MobLoot toAdd2 = new MobLoot(mob, glassItem, false); + if (toAdd != null) + mob.getCharItemManager().addItemToInventory(toAdd2); + } + } + + } } } diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index 3af56fb0..dfcf28b8 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -676,22 +676,29 @@ public class Mine extends AbstractGameObject { building.setMeshUUID(407650); building.setMeshScale(new Vector3f(0,0,0)); InterestManager.setObjectDirty(building); + WorldGrid.updateObject(building); } //update tower to become stronghold mesh tower.setMeshUUID(5001500); tower.setMeshScale(new Vector3f(1,1,1)); InterestManager.setObjectDirty(tower); + WorldGrid.updateObject(tower); //create elite mobs for(int i = 0; i < 15; i++){ Mob guard = Mob.createMob(14315, Vector3fImmutable.getRandomPointOnCircle(tower.loc,30),Guild.getErrantGuild(),true,mineZone,null,0, "Elite",65); if(guard != null){ + guard.setLevel((short)65); guard.setResists(new Resists("Elite")); guard.healthMax *= 2; guard.setHealth(guard.healthMax); guard.spawnTime = 1000000000; guard.BehaviourType = Enum.MobBehaviourType.Aggro; + guard.maxDamageHandOne *= 2; + guard.minDamageHandOne *= 2; + guard.atrHandOne *= 2; + guard.defenseRating *= 2; InterestManager.setObjectDirty(guard); this.strongholdMobs.add(guard); LootManager.GenerateStrongholdLoot(guard,false); @@ -700,11 +707,16 @@ public class Mine extends AbstractGameObject { //create stronghold commander Mob commander = Mob.createMob(14315, tower.loc,Guild.getErrantGuild(),true,mineZone,null,0, "Commander",75); if(commander != null){ + commander.setLevel((short)75); commander.setResists(new Resists("Elite")); commander.healthMax *= 2; commander.setHealth(commander.healthMax); commander.spawnTime = 1000000000; commander.BehaviourType = Enum.MobBehaviourType.Aggro; + commander.maxDamageHandOne *= 3; + commander.minDamageHandOne *= 3; + commander.atrHandOne *= 3; + commander.defenseRating *= 3; InterestManager.setObjectDirty(commander); this.strongholdMobs.add(commander); LootManager.GenerateStrongholdLoot(commander,true);