From 386b2af17167e5dafcbbc892dba2866c22b0934b Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sun, 29 Jun 2008 15:16:51 +0000 Subject: - 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 --- src/map/script.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/map/script.c') 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 -- cgit v1.2.3-60-g2f50