Browse Source

buying larger stacks of resources form resource vendor

lakebane-new
FatBoy-DOTC 7 months ago
parent
commit
1a0b91b068
  1. 8
      src/engine/net/client/ClientMessagePump.java
  2. 8
      src/engine/objects/Contract.java
  3. 2
      src/engine/objects/MobEquipment.java

8
src/engine/net/client/ClientMessagePump.java

@ -1407,6 +1407,11 @@ public class ClientMessagePump implements NetMsgHandler {
return; return;
int cost = me.getMagicValue(); int cost = me.getMagicValue();
int amountResource = 0;
if(ib.getType().equals(ItemType.RESOURCE) && npc.contractUUID == 900){ //resource merchant
amountResource = 3000000 / (ib.getBaseValue() * 2);
cost = amountResource * (ib.getBaseValue() * 2);
}
float bargain = sourcePlayer.getBargain(); float bargain = sourcePlayer.getBargain();
@ -1444,6 +1449,9 @@ public class ClientMessagePump implements NetMsgHandler {
if (buy != null) { if (buy != null) {
me.transferEnchants(buy); me.transferEnchants(buy);
if(ib.getType().equals(ItemType.RESOURCE) && npc.contractUUID == 900){ //resource merchant
buy.setNumOfItems(amountResource);
}
itemMan.addItemToInventory(buy); itemMan.addItemToInventory(buy);
//itemMan.updateInventory(); //itemMan.updateInventory();
} }

8
src/engine/objects/Contract.java

@ -198,6 +198,14 @@ public class Contract extends AbstractGameObject {
} }
public ArrayList<MobEquipment> getSellInventory() { public ArrayList<MobEquipment> getSellInventory() {
if(this.getObjectUUID() == 900){ //resource merchant
for(MobEquipment me : this.sellInventory){
if(me.getItemBase().getType().equals(Enum.ItemType.RESOURCE)){
int amountResource = 3000000 / (me.getItemBase().getBaseValue() * 2);
me.magicValue = amountResource * (me.getItemBase().getBaseValue() * 2);
}
}
}
return this.sellInventory; return this.sellInventory;
} }

2
src/engine/objects/MobEquipment.java

@ -34,7 +34,7 @@ public class MobEquipment extends AbstractGameObject {
private AbstractPowerAction suffix; private AbstractPowerAction suffix;
private int pValue; private int pValue;
private int sValue; private int sValue;
private int magicValue; int magicValue;
private float dropChance = 0; private float dropChance = 0;

Loading…
Cancel
Save