diff options
author | MadCamel <madcamel@gmail.com> | 2009-04-22 17:02:33 +0000 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-22 13:26:50 -0600 |
commit | 0c846c8806aab3f6e45550fe85f977b049d168a1 (patch) | |
tree | 3a9204b014d0a17723ee4d2da020454ecdc11674 /src/map/script.c | |
parent | 80cde8fd032856ef98906d40c1febdf5753d2750 (diff) | |
download | tmwa-0c846c8806aab3f6e45550fe85f977b049d168a1.tar.gz tmwa-0c846c8806aab3f6e45550fe85f977b049d168a1.tar.bz2 tmwa-0c846c8806aab3f6e45550fe85f977b049d168a1.tar.xz tmwa-0c846c8806aab3f6e45550fe85f977b049d168a1.zip |
Added 'shop' command to trigger a nearby shop
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c index b8e07eb..a8d9a83 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -279,6 +279,7 @@ int buildin_getsavepoint(struct script_state *st); //Lorky [Lupus] int buildin_getpartnerid(struct script_state *st); // [Fate] int buildin_areatimer(struct script_state *st); // [Jaxad0127] int buildin_isin(struct script_state *st); // [Jaxad0127] +int buildin_shop(struct script_state *st); // [MadCamel] void push_val(struct script_stack *stack,int type,int val); int run_func(struct script_state *st); @@ -480,7 +481,8 @@ struct { {buildin_getlook,"getlook","i"}, {buildin_getsavepoint,"getsavepoint","i"}, {buildin_areatimer,"areatimer","siiiiis"}, - {buildin_isin,"isin","siiii"}, // End Additions + {buildin_isin,"isin","siiii"}, + {buildin_shop,"shop","s"}, // End Additions {NULL,NULL,NULL}, }; int buildin_message(struct script_state *st); // [MouseJstr] @@ -5870,6 +5872,25 @@ int buildin_isin(struct script_state *st) return 0; } +// Trigger the shop on a (hopefully) nearby shop NPC +int buildin_shop(struct script_state *st) +{ + struct map_session_data *sd=script_rid2sd(st); + struct npc_data *nd; + char *str; + + if (!sd) + return 1; + + nd = npc_name2id(conv_str(st,& (st->stack->stack_data[st->start+2]))); + if (!nd) + return 1; + + buildin_close(st); + clif_npcbuysell(sd,nd->bl.id); + return 0; +} + // // ŽÀs•”main // |