summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index 56dcc29..88b9f34 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -1263,3 +1263,20 @@ BUILDIN(isUnitWalking)
script_pushint(st, ud->walktimer != INVALID_TIMER);
return true;
}
+
+BUILDIN(failedRefIndex)
+{
+ getSD()
+ getInventoryIndex(2)
+
+ if (sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0)
+ return false;
+
+ sd->status.inventory[n].refine = 0;
+ if (sd->status.inventory[n].equip)
+ pc->unequipitem(sd, n, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
+ clif->refine(sd->fd, 1, n, sd->status.inventory[n].refine);
+ pc->delitem(sd, n, 1, 0, DELITEM_FAILREFINE, LOG_TYPE_SCRIPT);
+ clif->misceffect(&sd->bl, 2);
+ return true;
+}