Browse Source

Header added to new files.

master
MagicBot 1 year ago
parent
commit
cc9b5a93ee
  1. 80
      src/engine/gameManager/LootManager.java
  2. 8
      src/engine/loot/GenTable.java
  3. 8
      src/engine/loot/GenTableRow.java
  4. 8
      src/engine/loot/ItemTable.java
  5. 8
      src/engine/loot/ItemTableRow.java
  6. 8
      src/engine/loot/ModTable.java
  7. 8
      src/engine/loot/ModTableRow.java
  8. 8
      src/engine/loot/ModTypeTable.java
  9. 8
      src/engine/loot/ModTypeTableRow.java

80
src/engine/gameManager/LootManager.java

@ -179,6 +179,7 @@ public enum LootManager {
outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false);
Enum.ItemType outType = outItem.getItemBase().getType(); Enum.ItemType outType = outItem.getItemBase().getType();
if (outType.ordinal() == Enum.ItemType.WEAPON.ordinal() || outType.ordinal() == Enum.ItemType.ARMOR.ordinal() || outType.ordinal() == Enum.ItemType.JEWELRY.ordinal()) { if (outType.ordinal() == Enum.ItemType.WEAPON.ordinal() || outType.ordinal() == Enum.ItemType.ARMOR.ordinal() || outType.ordinal() == Enum.ItemType.JEWELRY.ordinal()) {
if (outItem.getItemBase().isGlass() == false) { if (outItem.getItemBase().isGlass() == false) {
@ -195,79 +196,81 @@ public enum LootManager {
} }
} }
} }
if(outItem.getPrefix() != null && outItem.getPrefix().isEmpty() == false)
if (outItem.getPrefix() != null && outItem.getPrefix().isEmpty() == false)
outItem.setIsID(false); outItem.setIsID(false);
if(outItem.getSuffix() != null && outItem.getSuffix().isEmpty() == false)
if (outItem.getSuffix() != null && outItem.getSuffix().isEmpty() == false)
outItem.setIsID(false); outItem.setIsID(false);
return outItem; return outItem;
} }
private static MobLoot GeneratePrefix(Mob mob, MobLoot inItem, int genTableID, int genRoll, Boolean inHotzone) { private static MobLoot GeneratePrefix(Mob mob, MobLoot inItem, int genTableID, int genRoll, Boolean inHotzone) {
GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll);
if (selectedRow == null) if (selectedRow == null)
return inItem; return inItem;
ModTypeTable prefixTable = modTypeTables.get(selectedRow.pModTable); ModTypeTable prefixTable = modTypeTables.get(selectedRow.pModTable);
if (prefixTable == null) if (prefixTable == null)
return inItem; return inItem;
int prefixroll = ThreadLocalRandom.current().nextInt(1, 100 + 1); int prefixroll = ThreadLocalRandom.current().nextInt(1, 100 + 1);
if (modTables.get(prefixTable.getRowForRange(prefixroll).modTableID) != null) { if (modTables.get(prefixTable.getRowForRange(prefixroll).modTableID) != null) {
ModTable prefixModTable = modTables.get(prefixTable.getRowForRange(prefixroll).modTableID); ModTable prefixModTable = modTables.get(prefixTable.getRowForRange(prefixroll).modTableID);
if (prefixModTable == null) if (prefixModTable == null)
return inItem; return inItem;
ModTableRow prefixMod = prefixModTable.getRowForRange(TableRoll(mob.level, inHotzone)); ModTableRow prefixMod = prefixModTable.getRowForRange(TableRoll(mob.level, inHotzone));
if (prefixMod == null) if (prefixMod == null)
return inItem; return inItem;
if (prefixMod != null && prefixMod.action.length() > 0) { if (prefixMod != null && prefixMod.action.length() > 0) {
inItem.setPrefix(prefixMod.action); inItem.setPrefix(prefixMod.action);
inItem.addPermanentEnchantment(prefixMod.action, 0, prefixMod.level, true); inItem.addPermanentEnchantment(prefixMod.action, 0, prefixMod.level, true);
}
} }
}
//} //}
return inItem; return inItem;
} }
private static MobLoot GenerateSuffix(Mob mob, MobLoot inItem, int genTableID, int genRoll, Boolean inHotzone) { private static MobLoot GenerateSuffix(Mob mob, MobLoot inItem, int genTableID, int genRoll, Boolean inHotzone) {
GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll); GenTableRow selectedRow = generalItemTables.get(genTableID).getRowForRange(genRoll);
if (selectedRow == null) if (selectedRow == null)
return inItem; return inItem;
int suffixroll = ThreadLocalRandom.current().nextInt(1, 100 + 1); int suffixroll = ThreadLocalRandom.current().nextInt(1, 100 + 1);
ModTypeTable suffixTable = modTypeTables.get(selectedRow.sModTable); ModTypeTable suffixTable = modTypeTables.get(selectedRow.sModTable);
if (suffixTable == null) if (suffixTable == null)
return inItem; return inItem;
if (modTables.get(suffixTable.getRowForRange(suffixroll).modTableID) != null) { if (modTables.get(suffixTable.getRowForRange(suffixroll).modTableID) != null) {
ModTable suffixModTable = modTables.get(suffixTable.getRowForRange(suffixroll).modTableID); ModTable suffixModTable = modTables.get(suffixTable.getRowForRange(suffixroll).modTableID);
if (suffixModTable == null) if (suffixModTable == null)
return inItem; return inItem;
ModTableRow suffixMod = suffixModTable.getRowForRange(TableRoll(mob.level, inHotzone)); ModTableRow suffixMod = suffixModTable.getRowForRange(TableRoll(mob.level, inHotzone));
if (suffixMod == null) if (suffixMod == null)
return inItem; return inItem;
if (suffixMod != null && suffixMod.action.length() > 0) { if (suffixMod != null && suffixMod.action.length() > 0) {
inItem.setSuffix(suffixMod.action); inItem.setSuffix(suffixMod.action);
inItem.addPermanentEnchantment(suffixMod.action, 0, suffixMod.level, false); inItem.addPermanentEnchantment(suffixMod.action, 0, suffixMod.level, false);
}
} }
//} }
return inItem; return inItem;
} }
@ -326,6 +329,7 @@ public enum LootManager {
try { try {
MobLoot toAdd = getGenTableItem(tableID, mob, inHotzone); MobLoot toAdd = getGenTableItem(tableID, mob, inHotzone);
if (toAdd != null) if (toAdd != null)
mob.getCharItemManager().addItemToInventory(toAdd); mob.getCharItemManager().addItemToInventory(toAdd);
@ -355,7 +359,7 @@ public enum LootManager {
if (ml != null) { if (ml != null) {
ml.setIsID(true); ml.setIsID(true);
ml.setDurabilityCurrent((short)(ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1)); ml.setDurabilityCurrent((short) (ml.getDurabilityCurrent() - ThreadLocalRandom.current().nextInt(5) + 1));
mob.getCharItemManager().addItemToInventory(ml); mob.getCharItemManager().addItemToInventory(ml);
} }
} }

8
src/engine/loot/GenTable.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import java.util.ArrayList; import java.util.ArrayList;

8
src/engine/loot/GenTableRow.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import java.sql.ResultSet; import java.sql.ResultSet;

8
src/engine/loot/ItemTable.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import java.util.ArrayList; import java.util.ArrayList;

8
src/engine/loot/ItemTableRow.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import java.sql.ResultSet; import java.sql.ResultSet;

8
src/engine/loot/ModTable.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import java.util.ArrayList; import java.util.ArrayList;

8
src/engine/loot/ModTableRow.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import java.sql.ResultSet; import java.sql.ResultSet;

8
src/engine/loot/ModTypeTable.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import java.util.ArrayList; import java.util.ArrayList;

8
src/engine/loot/ModTypeTableRow.java

@ -1,3 +1,11 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.loot; package engine.loot;
import java.sql.ResultSet; import java.sql.ResultSet;

Loading…
Cancel
Save