summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-02-07 12:46:28 +0000
committerJared Adams <jaxad0127@gmail.com>2009-02-07 12:46:28 +0000
commitb80647dacebd450ca85616044503f9da9d0ddceb (patch)
tree70aad49dded1a622e0f0e7dbf1771ffab616b65c /src
parentd632e06b92d5c6e73f9f34f8ac9cb71ea7148e90 (diff)
downloadtmwa-b80647dacebd450ca85616044503f9da9d0ddceb.tar.gz
tmwa-b80647dacebd450ca85616044503f9da9d0ddceb.tar.bz2
tmwa-b80647dacebd450ca85616044503f9da9d0ddceb.tar.xz
tmwa-b80647dacebd450ca85616044503f9da9d0ddceb.zip
Add ability to use multiples of item base prices
You can now do simple multiples of the base price of items. You cac do base price * n, or base price / n: -1 base price -2 base price -3 base price / 2 -4 base prive * 2 -5 base price / 3 -6 base price * 3 ...
Diffstat (limited to 'src')
-rw-r--r--src/map/npc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index ee84c79..932bb6b 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1241,8 +1241,11 @@ static int npc_parse_shop(char *w1,char *w2,char *w3,char *w4)
} else break;
nd->u.shop_item[pos].nameid = nameid;
if (value < 0) {
+ int temp = abs(value);
if (id == NULL) id = itemdb_search(nameid);
value = id->value_buy;
+ if (temp % 2) value = value / ((temp + 1) / 2);
+ else value = value * (temp / 2);
}
nd->u.shop_item[pos].value = value;
pos++;