ShopAssistant.java
|
Can someone tell me how to change shop (GP prices)? or pk point shop (pk point price) etc..?
Using OverloadX souce..
I cant seem to find how to change them.. its confusing system of price change i think which i coded..
help anyone?
ShopAssistant.java
This is a part of the shit which is in shopassistant.java
thats why i cant understand how to work out to change prices
public void buyFromShopPrice(int removeId, int removeSlot){
int ShopValue = (int)Math.floor(getItemShopValue(removeId, 0, removeSlot));
ShopValue *= 1.15;
String ShopAdd = "";
if (c.myShopId >= 17 && c.myShopId <= 18 || c.myShopId == 29) {
c.sendMessage(c.getItems().getItemName(removeId)+" : currently costs " + getSpecialItemValue(removeId) + " points.");
return;
}
if (c.myShopId == 15) {
c.sendMessage("This item current costs " + c.getItems().getUntradePrice(removeId) + " coins.");
return;
}
if (ShopValue >= 1000 && ShopValue < 1000000) {
ShopAdd = " (" + (ShopValue / 1000) + "K)";
} else if (ShopValue >= 1000000) {
ShopAdd = " (" + (ShopValue / 1000000) + " million)";
}
c.sendMessage(c.getItems().getItemName(removeId)+" : currently costs "+ShopValue+" coins"+ShopAdd);
}
public int getSpecialItemValue(int id) {
switch (id) {
case 6914:
case 6889:
return 50;
case 4447:
return 15;
case 4675:
return 50;
case 11664:
return 20;
case 11663:
return 20;
case 11665:
return 20;
case 10548:
return 20;
case 8842:
return 20;
case 10887:
return 80;
case 15313:
return 500;
case 8840:
case 8839:
return 40;
case 6570:
return 60;
case 11694:
return 200;
case 14484:
return 500;
case 11696:
return 170;
case 11698:
return 150;
case 11700:
return 150;
case 11730:
return 100;
case 15001:
return 160;
case 6920:
return 150;
case 2412:
case 2413:
case 2414:
return 50;
case 2415:
case 2416:
case 2417:
return 100;
case 11720:
return 80;
case 11722:
return 60;
case 11718:
return 40;
case 11726:
return 80;
case 11724:
case 13858:
case 13861:
case 13864:
return 100;
case 13899:
return 200;
case 13902:
return 160;
case 13738:
return 240;
case 13740:
case 13742:
return 220;
case 13744:
return 180;
case 11283:
return 120;
case 15018:
case 15019:
case 15020:
return 40;
case 15220:
return 80;
case 13736:
return 80;
case 13734:
return 60;
case 10551:
return 40;
case 2528:
return 15;
}
return 0;
}
/**
*Sell item to shop (Shop Price)
**/
public void sellToShopPrice(int removeId, int removeSlot) {
for (int i : Config.ITEM_SELLABLE) {
if (i == removeId) {
c.sendMessage("You can't sell "+c.getItems().getItemName(removeId).toLowerCase() +".");
return;
}
}
boolean IsIn = false;
if (Server.shopHandler.ShopSModifier[c.myShopId] > 1) {
for (int j = 0; j <= Server.shopHandler.ShopItemsStandard[c.myShopId]; j++) {
if (removeId == (Server.shopHandler.ShopItems[c.myShopId][j] - 1)) {
IsIn = true;
break;
}
}
} else {
IsIn = true;
}
if (IsIn == false) {
c.sendMessage("You can't sell "+c.getItems().getItemName(removeId).toLowerCase() +" to this store.");
} else {
int ShopValue = (int)Math.floor(getItemShopValue(removeId, 1, removeSlot));
String ShopAdd = "";
if (ShopValue >= 1000 && ShopValue < 1000000) {
ShopAdd = " (" + (ShopValue / 1000) + "K)";
} else if (ShopValue >= 1000000) {
ShopAdd = " (" + (ShopValue / 1000000) + " million)";
}
c.sendMessage(c.getItems().getItemName(removeId)+" : shop will buy for "+ShopValue+" coins"+ShopAdd);
}
bump
iirc it grabs the price from the item database (usually item.cfg in winterlove based servers)
Shopassistant.java
example: case 15020:
return 40;
the return # is the value of it. Aka 40 pkp points,
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |