Project reformat.

This commit is contained in:
2024-03-24 09:42:27 -04:00
parent d0bb761344
commit 943d274e5f
53 changed files with 998 additions and 971 deletions
+28 -28
View File
@@ -80,22 +80,22 @@ public enum LootManager {
RunBootySet(_bootySetMap.get(mob.bootySet), mob, inHotzone);
//lastly, check mobs inventory for godly or disc runes to send a server announcement
for (Item it : mob.getInventory()) {
for (Item it : mob.getInventory()) {
ItemBase ib = it.getItemBase();
ItemBase ib = it.getItemBase();
if (ib == null)
break;
if (ib == null)
break;
ItemTemplate template = ItemTemplate.templates.get(it.getTemplateID());
ItemTemplate template = ItemTemplate.templates.get(it.getTemplateID());
if (ib.isDiscRune() || template.item_base_name.toLowerCase().contains("of the gods")) {
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + template.item_base_name + ". Are you tough enough to take it?");
chatMsg.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
}
if (ib.isDiscRune() || template.item_base_name.toLowerCase().contains("of the gods")) {
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + template.item_base_name + ". Are you tough enough to take it?");
chatMsg.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
}
}
}
@@ -146,7 +146,7 @@ public enum LootManager {
MobLoot outItem;
int genRoll = ThreadLocalRandom.current().nextInt(1,100 + 1);
int genRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1);
GenTableEntry selectedRow = GenTableEntry.rollTable(genTableID, genRoll, 1.0f);
@@ -161,9 +161,9 @@ public enum LootManager {
//gets the 1-320 roll for this mob
int itemTableRoll = 0;
int objectType = mob.getObjectType().ordinal();
if(mob.getObjectType().ordinal() == 52) { //52 = player character
itemTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1);
} else{
if (mob.getObjectType().ordinal() == 52) { //52 = player character
itemTableRoll = ThreadLocalRandom.current().nextInt(1, 320 + 1);
} else {
itemTableRoll = TableRoll(mob.level, inHotzone);
}
ItemTableEntry tableRow = ItemTableEntry.rollTable(itemTableId, itemTableRoll);
@@ -182,7 +182,7 @@ public enum LootManager {
outItem = new MobLoot(mob, ItemTemplate.templates.get(itemUUID), false);
if(selectedRow.pModTable != 0){
if (selectedRow.pModTable != 0) {
try {
outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone);
outItem.flags.remove(Enum.ItemFlags.Identified);
@@ -190,7 +190,7 @@ public enum LootManager {
Logger.error("Failed to GeneratePrefix for item: " + outItem.getName());
}
}
if(selectedRow.sModTable != 0){
if (selectedRow.sModTable != 0) {
try {
outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone);
outItem.flags.remove(Enum.ItemFlags.Identified);
@@ -215,9 +215,9 @@ public enum LootManager {
if (prefixTable == null)
return inItem;
int prefixTableRoll = 0;
if(mob.getObjectType().ordinal() == 52) {
prefixTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1);
} else{
if (mob.getObjectType().ordinal() == 52) {
prefixTableRoll = ThreadLocalRandom.current().nextInt(1, 320 + 1);
} else {
prefixTableRoll = TableRoll(mob.level, inHotzone);
}
ModTableEntry prefixMod = ModTableEntry.rollTable(prefixTable.modTableID, prefixTableRoll);
@@ -247,9 +247,9 @@ public enum LootManager {
if (suffixTable == null)
return inItem;
int suffixTableRoll = 0;
if(mob.getObjectType().ordinal() == 52) {
suffixTableRoll = ThreadLocalRandom.current().nextInt(1,320 + 1);
} else{
if (mob.getObjectType().ordinal() == 52) {
suffixTableRoll = ThreadLocalRandom.current().nextInt(1, 320 + 1);
} else {
suffixTableRoll = TableRoll(mob.level, inHotzone);
}
ModTableEntry suffixMod = ModTableEntry.rollTable(suffixTable.modTableID, suffixTableRoll);
@@ -332,7 +332,7 @@ public enum LootManager {
public static void GenerateEquipmentDrop(Mob mob) {
if(mob.behaviourType.equals(Enum.MobBehaviourType.HamletGuard))
if (mob.behaviourType.equals(Enum.MobBehaviourType.HamletGuard))
return; // safehold guards don't drop their equipment
//do equipment here
int dropCount = 0;
@@ -404,7 +404,7 @@ public enum LootManager {
int genRoll = ThreadLocalRandom.current().nextInt(1, 100 + 1);
GenTableEntry selectedRow = GenTableEntry.rollTable(tableID, genRoll, LootManager.NORMAL_DROP_RATE);
if(selectedRow == null)
if (selectedRow == null)
return;
//roll 220-320 for the item table selection
@@ -431,10 +431,10 @@ public enum LootManager {
//determine if the winning item needs a prefix
if(selectedRow.pModTable != 0){
int prefixRoll = ThreadLocalRandom.current().nextInt(220,320 + 1);
if (selectedRow.pModTable != 0) {
int prefixRoll = ThreadLocalRandom.current().nextInt(220, 320 + 1);
ModTableEntry prefix = ModTableEntry.rollTable(selectedRow.pModTable, prefixRoll);
if(prefix != null)
if (prefix != null)
winnings.addPermanentEnchantment(prefix.action, 0, prefix.level, true);
}