summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-28 13:08:53 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-28 13:08:53 +0000
commit20fe02757e2dbc5c9ff8787faf2fbb97e3d5280e (patch)
tree18e0ab985131e01fbbc9b6b30f23e7707088082b /src/map/script.c
parente865d9496fe8b896082d5f62e73300b1262ddf02 (diff)
downloadhercules-20fe02757e2dbc5c9ff8787faf2fbb97e3d5280e.tar.gz
hercules-20fe02757e2dbc5c9ff8787faf2fbb97e3d5280e.tar.bz2
hercules-20fe02757e2dbc5c9ff8787faf2fbb97e3d5280e.tar.xz
hercules-20fe02757e2dbc5c9ff8787faf2fbb97e3d5280e.zip
* Added autoequip flag check (added script command 'autoequip' to manipulate in script.c) for pc_takeitem in pc.c If it impacts on perfomance, please remove it.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5401 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 4f99870d4..c0c3b9040 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -402,6 +402,7 @@ int buildin_setd(struct script_state *st);
int buildin_petstat(struct script_state *st); // [Lance] Pet Stat Rq: Dubby
int buildin_callshop(struct script_state *st); // [Skotlex]
int buildin_equip(struct script_state *st);
+int buildin_autoequip(struct script_state *st);
void push_val(struct script_stack *stack,int type,int val);
int run_func(struct script_state *st);
@@ -704,6 +705,7 @@ struct {
{buildin_petstat,"petstat","i"},
{buildin_callshop,"callshop","si"}, // [Skotlex]
{buildin_equip,"equip","i"},
+ {buildin_autoequip,"autoequip","ii"},
{buildin_setitemscript,"setitemscript","is"}, //Set NEW item bonus script. Lupus
{buildin_disguise,"disguise","i"}, //disguise player. Lupus
{buildin_undisguise,"undisguise","i"}, //undisguise player. Lupus
@@ -9408,6 +9410,17 @@ int buildin_equip(struct script_state *st)
return 0;
}
+int buildin_autoequip(struct script_state *st){
+ int nameid, flag;
+ struct item_data *item_data;
+ nameid=conv_num(st,& (st->stack->stack_data[st->start+2]));
+ flag=conv_num(st,& (st->stack->stack_data[st->start+3]));
+ if(nameid>=500 && (item_data = itemdb_search(nameid)) != NULL){
+ item_data->flag.autoequip = flag>0?1:0;
+ }
+ return 0;
+}
+
//=======================================================
// strlen [Valaris]
//-------------------------------------------------------