diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-06-29 15:16:51 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-06-29 15:16:51 +0000 |
commit | 386b2af17167e5dafcbbc892dba2866c22b0934b (patch) | |
tree | e0285c471d73eec77bfed84bcf3ec61d6ea643d2 /src/map/script.c | |
parent | bf559662f0d0c0d9cbdd3c3f65990b6032472e33 (diff) | |
download | hercules-386b2af17167e5dafcbbc892dba2866c22b0934b.tar.gz hercules-386b2af17167e5dafcbbc892dba2866c22b0934b.tar.bz2 hercules-386b2af17167e5dafcbbc892dba2866c22b0934b.tar.xz hercules-386b2af17167e5dafcbbc892dba2866c22b0934b.zip |
- Added support to Cash Shop for script command callshop
- Fixed a bug in OnTouchNPC
- Cleanup in barricade code.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12896 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/map/script.c b/src/map/script.c index 8781aaa92..0f3018ec8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12132,23 +12132,25 @@ BUILDIN_FUNC(callshop) if( script_hasdata(st,3) ) flag = script_getnum(st,3); nd = npc_name2id(shopname); - if (!nd || nd->bl.type!=BL_NPC || nd->subtype!=SHOP) { + if( !nd || nd->bl.type != BL_NPC || (nd->subtype != SHOP && nd->subtype != CASHSHOP) ) + { ShowError("buildin_callshop: Shop [%s] not found (or NPC is not shop type)\n", shopname); script_pushint(st,0); return 1; } - switch (flag) { - case 1: //Buy window - npc_buysellsel(sd,nd->bl.id,0); - break; - case 2: //Sell window - npc_buysellsel(sd,nd->bl.id,1); - break; - default: //Show menu - clif_npcbuysell(sd,nd->bl.id); - break; + if( nd->subtype == SHOP ) + { + switch( flag ) + { + case 1: npc_buysellsel(sd,nd->bl.id,0); break; //Buy window + case 2: npc_buysellsel(sd,nd->bl.id,1); break; //Sell window + default: clif_npcbuysell(sd,nd->bl.id); break; //Show menu + } } + else + clif_cashshop_show(sd, nd); + sd->npc_shopid = nd->bl.id; script_pushint(st,1); return 0; @@ -13636,7 +13638,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(unequip,"i"), // unequip command [Spectre] BUILDIN_DEF(getstrlen,"s"), //strlen [Valaris] BUILDIN_DEF(charisalpha,"si"), //isalpha [Valaris] - BUILDIN_DEF(setnpcdisplay,"sv?"), + BUILDIN_DEF(setnpcdisplay,"sv??"), BUILDIN_DEF(compare,"ss"), // Lordalfa - To bring strstr to scripting Engine. BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info BUILDIN_DEF(setiteminfo,"iii"), //[Lupus] set Items Buy / sell Price, etc info |