I've modified the client a bit, here are the patches:
First patch:
Code: Select all
--- src/client/c-cmd.c 2010-01-31 13:48:24.000000000 +0100
+++ src/client/c-cmd.c 2010-02-26 21:36:09.134700336 +0100
@@ -777,7 +777,15 @@
ch = inkey();
if (ch >= 'A' && ch < 'A' + INVEN_PACK) { /* using capital letters to force SHIFT key usage, less accidental spam that way probably */
c = ch - 'A';
- if (inventory[c].tval) Send_msg(format("\377s%s", inventory_name[c]));
+
+ if (inventory[c].tval) {
+ if (chat_mode == CHAT_MODE_PARTY)
+ Send_msg(format("!:\377s%s", inventory_name[c]));
+ else if (chat_mode == CHAT_MODE_LEVEL)
+ Send_msg(format("#:\377s%s", inventory_name[c]));
+ else
+ Send_msg(format("\377s%s", inventory_name[c]));
+ }
}
/* restore the screen */
Code: Select all
--- src/client/c-store.c 2010-01-31 13:48:24.000000000 +0100
+++ src/client/c-store.c 2010-02-26 21:32:57.918701699 +0100
@@ -305,6 +305,114 @@
Send_store_purchase(item, amt);
}
+static void store_chat(void)
+{
+ int i, amt;
+ int item;
+
+ object_type *o_ptr;
+
+ char out_val[160];
+
+
+ /* Empty? */
+ if (store.stock_num <= 0)
+ {
+ if (store_num == 7) c_msg_print("Your home is empty.");
+ else c_msg_print("I am currently out of stock.");
+ return;
+ }
+
+
+ /* Find the number of objects on this and following pages */
+ i = (store.stock_num - store_top);
+
+ /* And then restrict it to the current page */
+ if (i > 12) i = 12;
+
+ /* Prompt */
+ if (store_num == 7)
+ {
+ sprintf(out_val, "Which item? ");
+ }
+ else
+ {
+ sprintf(out_val, "Which item? ");
+ }
+
+ /* Get the item number to be pasted */
+ if (!get_stock(&item, out_val, 0, i-1)) return;
+
+ /* Get the actual index */
+ item = item + store_top;
+
+ /* Get the actual item */
+ o_ptr = &store.stock[item];
+
+ /* Convert the price to more readable format */
+ char price [16];
+ if (store_prices[item] >= 10000)
+ sprintf (price, "%dk", store_prices[item] / 1000);
+ else
+ sprintf (price, "%d", store_prices[item]);
+
+ /* Hack -- Get the shop symbol */
+ char where [16];
+ char where_char, where_attr;
+ switch (store_num)
+ {
+ case 0:
+ where_char = '1';
+ where_attr = 'U';
+ break;
+ case 1:
+ where_char = '2';
+ where_attr = 's';
+ break;
+ case 2:
+ where_char = '3';
+ where_attr = 'w';
+ break;
+ case 3:
+ where_char = '4';
+ where_attr = 'g';
+ break;
+ case 4:
+ where_char = '5';
+ where_attr = 'b';
+ break;
+ case 5:
+ where_char = '6';
+ where_attr = 'r';
+ break;
+ case 6:
+ where_char = '7';
+ where_attr = 'D';
+ break;
+ case 8:
+ where_char = '9';
+ where_attr = 'o';
+ break;
+ case 48:
+ where_char = '7';
+ where_attr = 'v';
+ break;
+ default:
+ where_char = '?';
+ where_attr = 's';
+ break;
+ }
+ sprintf (where, "%d,%d \377%c%c\377s", p_ptr->wpos.wx, p_ptr->wpos.wy, where_attr, where_char);
+
+ /* Tell the server */
+ if (chat_mode == CHAT_MODE_PARTY)
+ Send_msg(format("!:\377s%s: %s (%s gp)", where, store_names[item], price));
+ else if (chat_mode == CHAT_MODE_LEVEL)
+ Send_msg(format("#:\377s%s: %s (%s gp)", where, store_names[item], price));
+ else
+ Send_msg(format("\377s%s:: %s (%s gp)", where, store_names[item], price));
+}
+
static void store_sell(void)
{
int item, amt;
@@ -514,6 +622,13 @@
break;
}
+ /* Paste on Chat */
+ case 'c':
+ {
+ store_chat();
+ break;
+ }
+
/* Ignore return */
case '\r':
{
I hope someone finds it useful.