mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
Set currencyName
This commit is contained in:
@@ -528,10 +528,11 @@ public class ShopAssistant {
|
|||||||
currency = 995; //gp
|
currency = 995; //gp
|
||||||
}
|
}
|
||||||
int currencySlot = player.getItemAssistant().getItemSlot(currency);
|
int currencySlot = player.getItemAssistant().getItemSlot(currency);
|
||||||
|
String currencyName = ItemAssistant.getItemName(currency).toLowerCase();
|
||||||
|
|
||||||
// player has none of the required currency
|
// player has none of the required currency
|
||||||
if (currencySlot == -1) {
|
if (currencySlot == -1) {
|
||||||
player.getActionSender().sendMessage("You don't have enough " + ItemAssistant.getItemName(currency).toLowerCase() + " to buy that.");
|
player.getActionSender().sendMessage("You don't have enough " + currencyName + " to buy that.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -544,7 +545,7 @@ public class ShopAssistant {
|
|||||||
// buy as many as we can afford
|
// buy as many as we can afford
|
||||||
totalValue = value * amount;
|
totalValue = value * amount;
|
||||||
if (currencyAmount < totalValue || amount <= 0) {
|
if (currencyAmount < totalValue || amount <= 0) {
|
||||||
player.getActionSender().sendMessage("You don't have enough " + ItemAssistant.getItemName(currency).toLowerCase() + " to buy that.");
|
player.getActionSender().sendMessage("You don't have enough " + currencyName + " to buy that.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -552,7 +553,7 @@ public class ShopAssistant {
|
|||||||
String itemName = ItemAssistant.getItemName(itemID).toLowerCase();
|
String itemName = ItemAssistant.getItemName(itemID).toLowerCase();
|
||||||
if (!playerOwnsShop) {
|
if (!playerOwnsShop) {
|
||||||
player.getItemAssistant().deleteItem2(currency, totalValue);
|
player.getItemAssistant().deleteItem2(currency, totalValue);
|
||||||
player.getActionSender().sendMessage("You bought " + amount + " " + itemName + " for " + totalValue + " " + ItemAssistant.getItemName(currency).toLowerCase() + "." );
|
player.getActionSender().sendMessage("You bought " + amount + " " + itemName + " for " + totalValue + " " + currencyName + "." );
|
||||||
// If it is a player owned shop, we need to give them the coins
|
// If it is a player owned shop, we need to give them the coins
|
||||||
if (ShopHandler.ShopSModifier[player.myShopId] == 0)
|
if (ShopHandler.ShopSModifier[player.myShopId] == 0)
|
||||||
BotHandler.addCoins(shopID, totalValue);
|
BotHandler.addCoins(shopID, totalValue);
|
||||||
@@ -566,7 +567,7 @@ public class ShopAssistant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (player.getPlayerAssistant().isPlayer()) {
|
if (player.getPlayerAssistant().isPlayer()) {
|
||||||
GameLogger.writeLog(player.playerName, "shopbuying", player.playerName + " bought " + amount + " " + itemName + " for " + totalValue + " " + ItemAssistant.getItemName(currency).toLowerCase() + " from store " + shopID + ".");
|
GameLogger.writeLog(player.playerName, "shopbuying", player.playerName + " bought " + amount + " " + itemName + " for " + totalValue + " " + currencyName + " from store " + shopID + ".");
|
||||||
}
|
}
|
||||||
player.getItemAssistant().resetItems(3823);
|
player.getItemAssistant().resetItems(3823);
|
||||||
resetShop(player.myShopId);
|
resetShop(player.myShopId);
|
||||||
|
|||||||
Reference in New Issue
Block a user