buying larger stacks of resources form resource vendor
This commit is contained in:
@@ -1407,6 +1407,11 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
return;
|
||||
|
||||
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();
|
||||
|
||||
@@ -1444,6 +1449,9 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
|
||||
if (buy != null) {
|
||||
me.transferEnchants(buy);
|
||||
if(ib.getType().equals(ItemType.RESOURCE) && npc.contractUUID == 900){ //resource merchant
|
||||
buy.setNumOfItems(amountResource);
|
||||
}
|
||||
itemMan.addItemToInventory(buy);
|
||||
//itemMan.updateInventory();
|
||||
}
|
||||
|
||||
@@ -198,6 +198,14 @@ public class Contract extends AbstractGameObject {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MobEquipment extends AbstractGameObject {
|
||||
private AbstractPowerAction suffix;
|
||||
private int pValue;
|
||||
private int sValue;
|
||||
private int magicValue;
|
||||
int magicValue;
|
||||
|
||||
private float dropChance = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user