summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2014-02-11 01:26:29 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2014-02-11 01:26:29 +0800
commit1e1b4a6a9286348192e6dcf22b816c01bc6f57b0 (patch)
treee6329664358e054d499b174858ace0a64ad7f9ac /src/map/script.c
parent537e621b81b8fdd8763342703083c1abcfb3cc3a (diff)
parentafb013850baddb26a4600b60c0ee713fb9d05784 (diff)
downloadhercules-1e1b4a6a9286348192e6dcf22b816c01bc6f57b0.tar.gz
hercules-1e1b4a6a9286348192e6dcf22b816c01bc6f57b0.tar.bz2
hercules-1e1b4a6a9286348192e6dcf22b816c01bc6f57b0.tar.xz
hercules-1e1b4a6a9286348192e6dcf22b816c01bc6f57b0.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 4fb4e7224..7ca6a7ddd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7666,9 +7666,8 @@ BUILDIN(getequippercentrefinery) {
/*==========================================
* Refine +1 item at pos and log and display refine
*------------------------------------------*/
-BUILDIN(successrefitem)
-{
- int i=-1,num,ep;
+BUILDIN(successrefitem) {
+ int i = -1 , num, ep, up = 1;
TBL_PC *sd;
num = script_getnum(st,2);
@@ -7676,6 +7675,9 @@ BUILDIN(successrefitem)
if( sd == NULL )
return true;
+ if( script_hasdata(st, 3) )
+ up = script_getnum(st, 3);
+
if (num > 0 && num <= ARRAYLENGTH(script->equip))
i=pc->checkequip(sd,script->equip[num-1]);
if(i >= 0) {
@@ -7687,7 +7689,8 @@ BUILDIN(successrefitem)
if (sd->status.inventory[i].refine >= MAX_REFINE)
return true;
- sd->status.inventory[i].refine++;
+ sd->status.inventory[i].refine += up;
+ sd->status.inventory[i].refine = cap_value( sd->status.inventory[i].refine, 0, MAX_REFINE);
pc->unequipitem(sd,i,2); // status calc will happen in pc->equipitem() below
clif->refine(sd->fd,0,i,sd->status.inventory[i].refine);
@@ -18580,7 +18583,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getequiprefinerycnt,"i"),
BUILDIN_DEF(getequipweaponlv,"i"),
BUILDIN_DEF(getequippercentrefinery,"i"),
- BUILDIN_DEF(successrefitem,"i"),
+ BUILDIN_DEF(successrefitem,"i?"),
BUILDIN_DEF(failedrefitem,"i"),
BUILDIN_DEF(downrefitem,"i?"),
BUILDIN_DEF(statusup,"i"),