diff options
author | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-03 09:37:36 +0000 |
---|---|---|
committer | Lance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-03 09:37:36 +0000 |
commit | 953e7a71cb6d5daad3993473d8db2d4802a6b09d (patch) | |
tree | a8b376d3a433bfcc97e1f825fed8e577446b0abc /src/map/script.c | |
parent | 2467c9cb40b5f630bb3d1462cb71072881f1b8e7 (diff) | |
download | hercules-953e7a71cb6d5daad3993473d8db2d4802a6b09d.tar.gz hercules-953e7a71cb6d5daad3993473d8db2d4802a6b09d.tar.bz2 hercules-953e7a71cb6d5daad3993473d8db2d4802a6b09d.tar.xz hercules-953e7a71cb6d5daad3993473d8db2d4802a6b09d.zip |
* Added buildin_checkvending and buildin_checkchatting.
modified Changelog-Trunk.txt
modified src/map/script.c
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9395 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 56547df55..b3b559312 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3582,6 +3582,8 @@ int buildin_setitemscript(struct script_state *st); int buildin_disguise(struct script_state *st); int buildin_undisguise(struct script_state *st); int buildin_getmonsterinfo(struct script_state *st); // [Lupus] +int buildin_checkvending(struct script_state *st); // check vending [Nab4] +int buildin_checkchatting(struct script_state *st); // check chatting [Marka] #ifdef PCRE_SUPPORT int buildin_defpattern(struct script_state *st); // MouseJstr @@ -3918,6 +3920,8 @@ struct script_function buildin_func[] = { {buildin_homunculus_evolution,"homevolution",""}, //[orn] {buildin_eaclass,"eaclass","*"}, //[Skotlex] {buildin_roclass,"roclass","i*"}, //[Skotlex] + {buildin_checkvending,"checkvending","*"}, + {buildin_checkchatting,"checkchatting","*"}, {NULL,NULL,NULL}, }; @@ -11865,6 +11869,39 @@ int buildin_getmonsterinfo(struct script_state *st) return 0; } +int buildin_checkvending(struct script_state *st){ // check vending [Nab4] + struct map_session_data *sd = NULL; + + if(st->end > st->start + 2) + sd = map_nick2sd(conv_str(st,&st->stack->stack_data[st->start+2])); + else + sd = script_rid2sd(st); + + if(sd) + push_val(st->stack, C_INT, (sd->vender_id != 0)); + else + push_val(st->stack, C_INT, 0); + + return 0; +} + + +int buildin_checkchatting(struct script_state *st){ // check chatting [Marka] + struct map_session_data *sd = NULL; + + if(st->end > st->start + 2) + sd = map_nick2sd(conv_str(st,&st->stack->stack_data[st->start+2])); + else + sd = script_rid2sd(st); + + if(sd) + push_val(st->stack, C_INT, (sd->chatID != 0)); + else + push_val(st->stack, C_INT, 0); + + return 0; +} + int axtoi(char *hexStg) { int n = 0; // position in string int m = 0; // position in digit[] to shift |