Browse Source

drop rate work

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
c2e0979dc3
  1. 6
      src/engine/devcmd/cmds/SimulateBootyCmd.java
  2. 8
      src/engine/gameManager/LootManager.java
  3. 3
      src/engine/mobileAI/MobAI.java

6
src/engine/devcmd/cmds/SimulateBootyCmd.java

@ -55,7 +55,7 @@ public class SimulateBootyCmd extends AbstractDevCmd {
int failures = 0; int failures = 0;
int goldAmount = 0; int goldAmount = 0;
for (int i = 0; i < 1000; ++i) { for (int i = 0; i < 10000; ++i) {
try { try {
mob.loadInventory(); mob.loadInventory();
@ -83,7 +83,11 @@ public class SimulateBootyCmd extends AbstractDevCmd {
goldAmount += lootItem.getNumOfItems(); goldAmount += lootItem.getNumOfItems();
break; break;
default: default:
if(Warehouse.maxResources.containsKey(lootItem.getItemBaseID())){
Resources.add(lootItem);
} else {
OtherDrops.add(lootItem); OtherDrops.add(lootItem);
}
break; break;
} }
} }

8
src/engine/gameManager/LootManager.java

@ -200,9 +200,13 @@ public enum LootManager {
if (ItemBase.getItemBase(itemUUID).getType().ordinal() == Enum.ItemType.RESOURCE.ordinal()) { if (ItemBase.getItemBase(itemUUID).getType().ordinal() == Enum.ItemType.RESOURCE.ordinal()) {
int chance = ThreadLocalRandom.current().nextInt(1,101); int chance = ThreadLocalRandom.current().nextInt(1,101);
if(chance > 5) if(chance > 10)
return null; return null;
int amount = ThreadLocalRandom.current().nextInt(tableRow.minSpawn, tableRow.maxSpawn + 1); int amount = ThreadLocalRandom.current().nextInt((int)(tableRow.minSpawn * 0.5f), (int)((tableRow.maxSpawn + 1) * 0.5f));
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " HAS FOUND " + amount + " " + ItemBase.getItemBase(itemUUID).getName() + ". ");
chatMsg.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
return new MobLoot(mob, ItemBase.getItemBase(itemUUID), amount, false); return new MobLoot(mob, ItemBase.getItemBase(itemUUID), amount, false);
} }

3
src/engine/mobileAI/MobAI.java

@ -249,6 +249,9 @@ public class MobAI {
if(target.isPet() && target.isAlive() == false && target.guardCaptain.isAlive() == true){ if(target.isPet() && target.isAlive() == false && target.guardCaptain.isAlive() == true){
mob.setCombatTarget(target.guardCaptain); mob.setCombatTarget(target.guardCaptain);
} }
if(target.level > 75){
AttackMob(target,mob);
}
} catch (Exception e) { } catch (Exception e) {
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage()); Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage());
} }

Loading…
Cancel
Save