|
|
@ -373,7 +373,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { |
|
|
|
|
|
|
|
|
|
|
|
// Grab reference to vendor we are interacting with
|
|
|
|
// Grab reference to vendor we are interacting with
|
|
|
|
|
|
|
|
|
|
|
|
vendorNPC = (NPC) DbManager.getObject(mbEnums.GameObjectType.NPC, msg.getNpcUUID()); |
|
|
|
vendorNPC = (NPC) DbManager.getObject(mbEnums.GameObjectType.NPC, msg.npcUUID); |
|
|
|
|
|
|
|
|
|
|
|
// Oops?
|
|
|
|
// Oops?
|
|
|
|
|
|
|
|
|
|
|
@ -386,39 +386,39 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { |
|
|
|
|
|
|
|
|
|
|
|
case PRODUCE: |
|
|
|
case PRODUCE: |
|
|
|
boolean isRandom = false; |
|
|
|
boolean isRandom = false; |
|
|
|
if (msg.getUnknown03() != 0 && msg.getpToken() == 0 && msg.getsToken() == 0) |
|
|
|
if (msg.unknown03 != 0 && msg.pToken == 0 && msg.sToken == 0) |
|
|
|
isRandom = true; |
|
|
|
isRandom = true; |
|
|
|
//Create Multiple Item Function.. Fill all empty slots
|
|
|
|
//Create Multiple Item Function.. Fill all empty slots
|
|
|
|
if (msg.getSize() > 0) { |
|
|
|
if (msg.size > 0) { |
|
|
|
int emptySlots = vendorNPC.getRank() - vendorNPC.getRolling().size(); |
|
|
|
int emptySlots = vendorNPC.getRank() - vendorNPC.getRolling().size(); |
|
|
|
if (emptySlots > 0) { |
|
|
|
if (emptySlots > 0) { |
|
|
|
for (int i = 0; i < emptySlots; i++) { |
|
|
|
for (int i = 0; i < emptySlots; i++) { |
|
|
|
vendorNPC.produceItem(player.getObjectUUID(), msg.getTotal_to_produce(), isRandom, msg.getpToken(), msg.getsToken(), msg.getName(), msg.getTemplateID()); |
|
|
|
vendorNPC.produceItem(player.getObjectUUID(), msg.total_to_produce, isRandom, msg.pToken, msg.sToken, msg.name, msg.templateID); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else |
|
|
|
} else |
|
|
|
vendorNPC.produceItem(player.getObjectUUID(), msg.getTotal_to_produce(), isRandom, msg.getpToken(), msg.getsToken(), msg.getName(), msg.getTemplateID()); |
|
|
|
vendorNPC.produceItem(player.getObjectUUID(), msg.total_to_produce, isRandom, msg.pToken, msg.sToken, msg.name, msg.templateID); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case JUNK: |
|
|
|
case JUNK: |
|
|
|
junkItem(msg.getTemplateID(), vendorNPC, origin); |
|
|
|
junkItem(msg.templateID, vendorNPC, origin); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case RECYCLE: |
|
|
|
case RECYCLE: |
|
|
|
recycleItem(msg.getItems(), vendorNPC, origin); |
|
|
|
recycleItem(msg.items, vendorNPC, origin); |
|
|
|
msg.actionType = mbEnums.ProductionActionType.TAKE; |
|
|
|
msg.actionType = mbEnums.ProductionActionType.TAKE; |
|
|
|
dispatch = Dispatch.borrow(player, msg); |
|
|
|
dispatch = Dispatch.borrow(player, msg); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case COMPLETE: |
|
|
|
case COMPLETE: |
|
|
|
vendorNPC.completeItem(msg.getTemplateID()); |
|
|
|
vendorNPC.completeItem(msg.templateID); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case DEPOSIT: |
|
|
|
case DEPOSIT: |
|
|
|
depositItem(msg.getTemplateID(), vendorNPC, origin); |
|
|
|
depositItem(msg.templateID, vendorNPC, origin); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SETPRICE: |
|
|
|
case SETPRICE: |
|
|
|
setItemPrice(msg.getItemType(), msg.getTemplateID(), msg.getItemPrice(), vendorNPC, origin); |
|
|
|
setItemPrice(msg.itemType, msg.templateID, msg.itemPrice, vendorNPC, origin); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case TAKE: |
|
|
|
case TAKE: |
|
|
|
takeItem(msg.getItems(), vendorNPC, origin); |
|
|
|
takeItem(msg.items, vendorNPC, origin); |
|
|
|
dispatch = Dispatch.borrow(player, msg); |
|
|
|
dispatch = Dispatch.borrow(player, msg); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY); |
|
|
|
break; |
|
|
|
break; |
|
|
|