disable bank / shared bank in trade and also sellitem
This commit is contained in:
parent
b8738480b2
commit
79a010e055
@ -9964,6 +9964,15 @@ void Commands::Command_TradeAddItem(Client* client, Seperator* sep)
|
|||||||
int32 index = atoi(sep->arg[0]);
|
int32 index = atoi(sep->arg[0]);
|
||||||
item = client->GetPlayer()->GetPlayerItemList()->GetItemFromIndex(index);
|
item = client->GetPlayer()->GetPlayerItemList()->GetItemFromIndex(index);
|
||||||
if (item) {
|
if (item) {
|
||||||
|
if(item->details.item_locked || item->details.equip_slot_id) {
|
||||||
|
client->SimpleMessage(CHANNEL_COLOR_RED, "You cannot trade an item currently in use.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if(item->details.inv_slot_id == -3 || item->details.inv_slot_id == -4) {
|
||||||
|
client->SimpleMessage(CHANNEL_COLOR_RED, "You cannot trade an item in the bank.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int8 result = client->GetPlayer()->trade->AddItemToTrade(client->GetPlayer(), item, atoi(sep->arg[2]), atoi(sep->arg[1]));
|
int8 result = client->GetPlayer()->trade->AddItemToTrade(client->GetPlayer(), item, atoi(sep->arg[2]), atoi(sep->arg[1]));
|
||||||
if (result == 1)
|
if (result == 1)
|
||||||
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Item is already being traded.");
|
client->SimpleMessage(CHANNEL_COLOR_YELLOW, "Item is already being traded.");
|
||||||
|
@ -8136,6 +8136,10 @@ void Client::SellItem(int32 item_id, int16 quantity, int32 unique_id) {
|
|||||||
if (!item)
|
if (!item)
|
||||||
item = player->item_list.GetItemFromID(item_id);
|
item = player->item_list.GetItemFromID(item_id);
|
||||||
if (item && master_item) {
|
if (item && master_item) {
|
||||||
|
if(item->details.inv_slot_id == -3 || item->details.inv_slot_id == -4) {
|
||||||
|
SimpleMessage(CHANNEL_COLOR_RED, "You cannot sell an item in the bank.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (item->details.item_locked || item->details.equip_slot_id)
|
if (item->details.item_locked || item->details.equip_slot_id)
|
||||||
{
|
{
|
||||||
SimpleMessage(CHANNEL_COLOR_RED, "You cannot sell the item in use.");
|
SimpleMessage(CHANNEL_COLOR_RED, "You cannot sell the item in use.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user