|
|
|
@ -17,10 +17,7 @@ import engine.objects.*;
@@ -17,10 +17,7 @@ import engine.objects.*;
|
|
|
|
|
import engine.server.MBServerStatics; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.concurrent.ThreadLocalRandom; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -614,17 +611,58 @@ public enum LootManager {
@@ -614,17 +611,58 @@ public enum LootManager {
|
|
|
|
|
return; |
|
|
|
|
switch (ib.getUUID()) { |
|
|
|
|
case 971070: //wrapped rune
|
|
|
|
|
ItemBase runeBase = null; |
|
|
|
|
int roll = ThreadLocalRandom.current().nextInt(static_rune_ids.size() + 1); |
|
|
|
|
int itemId = static_rune_ids.get(0); |
|
|
|
|
try { |
|
|
|
|
itemId = static_rune_ids.get(roll); |
|
|
|
|
}catch(Exception e){ |
|
|
|
|
Random random = new Random(); |
|
|
|
|
int roll = random.nextInt(100); |
|
|
|
|
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) { |
|
|
|
|
winnings = new MobLoot(playerCharacter, runeBase, 1, false); |
|
|
|
|
} |
|
|
|
|
runeBase = ItemBase.getItemBase(itemId); |
|
|
|
|
if (runeBase != null) { |
|
|
|
|
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; |
|
|
|
|
case 971012: //wrapped glass
|
|
|
|
|