replace rune with wrapped rune

This commit is contained in:
2025-03-19 20:04:52 -05:00
parent 0e3e334cc1
commit 9caeb80ccc
2 changed files with 53 additions and 67 deletions
+1 -53
View File
@@ -89,59 +89,8 @@ public class HotzoneManager {
public static void GenerateHotzoneEpicLoot(Mob mob) { public static void GenerateHotzoneEpicLoot(Mob mob) {
mob.getCharItemManager().clearInventory(); mob.getCharItemManager().clearInventory();
Random random = new Random(); Random random = new Random();
int roll = random.nextInt(100); int roll;
int itemId; int itemId;
//ItemBase runeBase;
// if (roll >= 90) {
//35 or 40
// roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_high.size() + 1);
// itemId = HellgateManager.static_rune_ids_high.get(0);
// try {
// itemId = HellgateManager.static_rune_ids_high.get(roll);
// } catch (Exception e) {
// }
// runeBase = ItemBase.getItemBase(itemId);
// if (runeBase != null) {
// MobLoot rune = new MobLoot(mob, runeBase, true);
// if (rune != null)
// mob.getCharItemManager().addItemToInventory(rune);
// }
//} else if (roll >= 65 && roll <= 89) {
//30,35 or 40
// roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_mid.size() + 1);
// itemId = HellgateManager.static_rune_ids_mid.get(0);
// try {
// itemId = HellgateManager.static_rune_ids_mid.get(roll);
// } catch (Exception e) {
// }
// runeBase = ItemBase.getItemBase(itemId);
// if (runeBase != null) {
// MobLoot rune = new MobLoot(mob, runeBase, true);
// if (rune != null)
// mob.getCharItemManager().addItemToInventory(rune);
// }
// } else {
//5-30
// roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_low.size() + 1);
// itemId = HellgateManager.static_rune_ids_low.get(0);
// try {
// itemId = HellgateManager.static_rune_ids_low.get(roll);
// } catch (Exception ignored) {
// }
// runeBase = ItemBase.getItemBase(itemId);
// if (runeBase != null) {
// MobLoot rune = new MobLoot(mob, runeBase, true);
// if (rune != null)
// mob.getCharItemManager().addItemToInventory(rune);
// }
//}
//wrapped rune: //wrapped rune:
ItemBase runeBase = ItemBase.getItemBase(971070); ItemBase runeBase = ItemBase.getItemBase(971070);
if (runeBase != null) { if (runeBase != null) {
@@ -151,7 +100,6 @@ public class HotzoneManager {
mob.getCharItemManager().addItemToInventory(rune); mob.getCharItemManager().addItemToInventory(rune);
} }
roll = ThreadLocalRandom.current().nextInt(1, 101); roll = ThreadLocalRandom.current().nextInt(1, 101);
if (roll >= 95) { if (roll >= 95) {
//glass //glass
+47 -9
View File
@@ -17,10 +17,7 @@ import engine.objects.*;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
/** /**
@@ -614,17 +611,58 @@ public enum LootManager {
return; return;
switch (ib.getUUID()) { switch (ib.getUUID()) {
case 971070: //wrapped rune case 971070: //wrapped rune
ItemBase runeBase = null; Random random = new Random();
int roll = ThreadLocalRandom.current().nextInt(static_rune_ids.size() + 1); int roll = random.nextInt(100);
int itemId = static_rune_ids.get(0); int itemId;
ItemBase runeBase;
if (roll >= 90) {
//35 or 40
roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_high.size() + 1);
itemId = HellgateManager.static_rune_ids_high.get(0);
try { try {
itemId = static_rune_ids.get(roll); itemId = HellgateManager.static_rune_ids_high.get(roll);
} catch (Exception e) { } catch (Exception e) {
} }
runeBase = ItemBase.getItemBase(itemId); runeBase = ItemBase.getItemBase(itemId);
if (runeBase != null) { if (runeBase != null) {
winnings = new MobLoot(playerCharacter, runeBase, 1, false); MobLoot rune = new MobLoot(playerCharacter, runeBase, true);
if (rune != null)
playerCharacter.getCharItemManager().addItemToInventory(rune);
}
} else if (roll >= 65 && roll <= 89) {
//30,35 or 40
roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_mid.size() + 1);
itemId = HellgateManager.static_rune_ids_mid.get(0);
try {
itemId = HellgateManager.static_rune_ids_mid.get(roll);
} catch (Exception e) {
}
runeBase = ItemBase.getItemBase(itemId);
if (runeBase != null) {
MobLoot rune = new MobLoot(playerCharacter, runeBase, true);
if (rune != null)
playerCharacter.getCharItemManager().addItemToInventory(rune);
}
} else {
//5-30
roll = ThreadLocalRandom.current().nextInt(HellgateManager.static_rune_ids_low.size() + 1);
itemId = HellgateManager.static_rune_ids_low.get(0);
try {
itemId = HellgateManager.static_rune_ids_low.get(roll);
} catch (Exception ignored) {
}
runeBase = ItemBase.getItemBase(itemId);
if (runeBase != null) {
MobLoot rune = new MobLoot(playerCharacter, runeBase, true);
if (rune != null)
playerCharacter.getCharItemManager().addItemToInventory(rune);
}
} }
break; break;
case 971012: //wrapped glass case 971012: //wrapped glass