|
|
@ -14,6 +14,7 @@ import engine.net.DispatchMessage; |
|
|
|
import engine.net.client.msg.ErrorPopupMsg; |
|
|
|
import engine.net.client.msg.ErrorPopupMsg; |
|
|
|
import engine.net.client.msg.chat.ChatSystemMsg; |
|
|
|
import engine.net.client.msg.chat.ChatSystemMsg; |
|
|
|
import engine.objects.*; |
|
|
|
import engine.objects.*; |
|
|
|
|
|
|
|
import engine.server.MBServerStatics; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
@ -99,8 +100,8 @@ public enum LootManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void RunBootySet(ArrayList<BootySetEntry> entries, Mob mob) { |
|
|
|
private static void RunBootySet(ArrayList<BootySetEntry> entries, Mob mob) { |
|
|
|
mob.runeCounter++; |
|
|
|
mob.runeCounter++; |
|
|
|
mob.contractCounter++; |
|
|
|
mob.contractCounter++; |
|
|
|
float dropRate = NORMAL_DROP_RATE; |
|
|
|
float dropRate = NORMAL_DROP_RATE; |
|
|
|
//roll the geenric world drop table
|
|
|
|
//roll the geenric world drop table
|
|
|
|
if(mob.parentZone.getSafeZone() == 0) { |
|
|
|
if(mob.parentZone.getSafeZone() == 0) { |
|
|
@ -123,12 +124,12 @@ mob.contractCounter++; |
|
|
|
case "LOOT": |
|
|
|
case "LOOT": |
|
|
|
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) |
|
|
|
if (ThreadLocalRandom.current().nextInt(1, 100 + 1) < (bse.dropChance * dropRate)) |
|
|
|
GenerateLootDrop(mob, bse.genTable); //generate normal loot drop
|
|
|
|
GenerateLootDrop(mob, bse.genTable); //generate normal loot drop
|
|
|
|
if(mob.contractCounter >= 250){ |
|
|
|
if(mob.contractCounter * dropRate >= 250){ |
|
|
|
MobLoot extraLoot = rollForContract(bse.genTable, mob); |
|
|
|
MobLoot extraLoot = rollForContract(bse.genTable, mob); |
|
|
|
if (extraLoot != null) |
|
|
|
if (extraLoot != null) |
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
|
} |
|
|
|
} |
|
|
|
if(mob.runeCounter >= 250){ |
|
|
|
if(mob.runeCounter * dropRate >= 250){ |
|
|
|
MobLoot extraLoot = rollForRune(bse.genTable, mob); |
|
|
|
MobLoot extraLoot = rollForRune(bse.genTable, mob); |
|
|
|
if (extraLoot != null) |
|
|
|
if (extraLoot != null) |
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
|
mob.getCharItemManager().addItemToInventory(extraLoot); |
|
|
@ -575,6 +576,10 @@ mob.contractCounter++; |
|
|
|
MobLoot outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); |
|
|
|
MobLoot outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); |
|
|
|
if(outItem != null) { |
|
|
|
if(outItem != null) { |
|
|
|
mob.contractCounter = 0; |
|
|
|
mob.contractCounter = 0; |
|
|
|
|
|
|
|
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " looks like he found something special"); |
|
|
|
|
|
|
|
chatMsg.setMessageType(10); |
|
|
|
|
|
|
|
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); |
|
|
|
|
|
|
|
DispatchMessage.dispatchMsgToInterestArea(mob,chatMsg, Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE,false,false); |
|
|
|
return outItem; |
|
|
|
return outItem; |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -604,6 +609,10 @@ mob.contractCounter++; |
|
|
|
MobLoot outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); |
|
|
|
MobLoot outItem = new MobLoot(mob, ItemBase.getItemBase(itemUUID), false); |
|
|
|
if(outItem != null) { |
|
|
|
if(outItem != null) { |
|
|
|
mob.runeCounter = 0; |
|
|
|
mob.runeCounter = 0; |
|
|
|
|
|
|
|
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " looks like he found something special"); |
|
|
|
|
|
|
|
chatMsg.setMessageType(10); |
|
|
|
|
|
|
|
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); |
|
|
|
|
|
|
|
DispatchMessage.dispatchMsgToInterestArea(mob,chatMsg, Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE,false,false); |
|
|
|
return outItem; |
|
|
|
return outItem; |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|