summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index ce312e894..0a33c1eef 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7783,6 +7783,29 @@ BUILDIN_FUNC(downrefitem)
}
/*==========================================
+ * Delete the item equipped at pos.
+ *------------------------------------------*/
+BUILDIN_FUNC(delequip)
+{
+ int i=-1,num;
+ TBL_PC *sd;
+
+ num = script_getnum(st,2);
+ sd = script_rid2sd(st);
+ if( sd == NULL )
+ return 0;
+
+ if (num > 0 && num <= ARRAYLENGTH(equip))
+ i=pc_checkequip(sd,equip[num-1]);
+ if(i >= 0) {
+ pc_unequipitem(sd,i,3); //recalculate bonus
+ pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
+ }
+
+ return 0;
+}
+
+/*==========================================
*
*------------------------------------------*/
BUILDIN_FUNC(statusup)