summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-10-04 20:55:58 -0300
committershennetsind <ind@henn.et>2013-10-04 20:55:58 -0300
commitbaa5c1fc386a706ba4bf4aa48409b8947274c928 (patch)
tree565e0f5a9355587f3c3625ac374df2a3444505f4 /src/map/script.c
parent24556fbd5969a6cc2806a46b853e6252b5d7cd06 (diff)
downloadhercules-baa5c1fc386a706ba4bf4aa48409b8947274c928.tar.gz
hercules-baa5c1fc386a706ba4bf4aa48409b8947274c928.tar.bz2
hercules-baa5c1fc386a706ba4bf4aa48409b8947274c928.tar.xz
hercules-baa5c1fc386a706ba4bf4aa48409b8947274c928.zip
downrefitem script command update
Preparation for refiner/hd-ore update; Optional param added, this will allow for the officials 1/3 downgrades as well as for users to customise the value to their liking at script-level. Thanks To Haruna. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 879ca8c84..5fa248f4e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7187,13 +7187,15 @@ BUILDIN(failedrefitem)
*------------------------------------------*/
BUILDIN(downrefitem)
{
- int i = -1,num,ep;
+ int i = -1,num,ep, down = 1;
TBL_PC *sd;
- num = script_getnum(st,2);
sd = script->rid2sd(st);
if( sd == NULL )
return true;
+ num = script_getnum(st,2);
+ if( script_hasdata(st, 3) )
+ down = script_getnum(st, 3);
if (num > 0 && num <= ARRAYLENGTH(script->equip))
i = pc->checkequip(sd,script->equip[num-1]);
@@ -7203,10 +7205,11 @@ BUILDIN(downrefitem)
//Logs items, got from (N)PC scripts [Lupus]
logs->pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i],sd->inventory_data[i]);
- sd->status.inventory[i].refine++;
pc->unequipitem(sd,i,2); // status calc will happen in pc->equipitem() below
-
- clif->refine(sd->fd,2,i,sd->status.inventory[i].refine = sd->status.inventory[i].refine - 2);
+ sd->status.inventory[i].refine -= down;
+ sd->status.inventory[i].refine = cap_value( sd->status.inventory[i].refine, 0, MAX_REFINE);
+
+ clif->refine(sd->fd,2,i,sd->status.inventory[i].refine);
clif->delitem(sd,i,1,3);
//Logs items, got from (N)PC scripts [Lupus]
@@ -17375,7 +17378,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getequippercentrefinery,"i"),
BUILDIN_DEF(successrefitem,"i"),
BUILDIN_DEF(failedrefitem,"i"),
- BUILDIN_DEF(downrefitem,"i"),
+ BUILDIN_DEF(downrefitem,"i?"),
BUILDIN_DEF(statusup,"i"),
BUILDIN_DEF(statusup2,"ii"),
BUILDIN_DEF(bonus,"iv"),