Browse Source

drop rate work

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

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

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

8
src/engine/gameManager/LootManager.java

@ -200,9 +200,13 @@ public enum LootManager { @@ -200,9 +200,13 @@ public enum LootManager {
if (ItemBase.getItemBase(itemUUID).getType().ordinal() == Enum.ItemType.RESOURCE.ordinal()) {
int chance = ThreadLocalRandom.current().nextInt(1,101);
if(chance > 5)
if(chance > 10)
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);
}

3
src/engine/mobileAI/MobAI.java

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

Loading…
Cancel
Save