Index: src/map/script.c
===================================================================
--- src/map/script.c (revision 1)
+++ src/map/script.c (revision 23)
@@ -329,7 +329,7 @@
 	MF_NOCHAT,
 	MF_NOEXPPENALTY,
-	MF_GUILDLOCK,
-	MF_HOSTILE
+	MF_GUILDLOCK
 };
+
 const char* script_op2name(int op)
 {
@@ -4324,6 +4324,5 @@
 		return 0;
 
-	map_foreachinarea(buildin_areawarp_sub,
-		m,x0,y0,x1,y1,BL_PC,	index,x,y );
+	map_foreachinarea(buildin_areawarp_sub, m,x0,y0,x1,y1,BL_PC, index,x,y);
 	return 0;
 }
@@ -7571,6 +7570,5 @@
 	}
 		
-	map_foreachinmap(buildin_killmonsterall_sub_strip,
-		m,BL_MOB);
+	map_foreachinmap(buildin_killmonsterall_sub_strip,m,BL_MOB);
 	return 0;
 }
@@ -9029,5 +9027,4 @@
 			case MF_PARTYLOCK:		script_pushint(st,map[m].flag.partylock); break;
 			case MF_GUILDLOCK:		script_pushint(st,map[m].flag.guildlock); break;
-			case MF_HOSTILE:		script_pushint(st,map[m].flag.hostile); break;//Sketchy
 		}
 	}
@@ -9094,5 +9091,4 @@
 			case MF_PARTYLOCK:     map[m].flag.partylock=1; break;
 			case MF_GUILDLOCK:     map[m].flag.guildlock=1; break;
-			case MF_HOSTILE:		map[m].flag.hostile=1; break;//Sketchy
 		}
 	}
@@ -9156,5 +9152,4 @@
 			case MF_PARTYLOCK:     map[m].flag.partylock=0; break;
 			case MF_GUILDLOCK:     map[m].flag.guildlock=0; break;
-			case MF_HOSTILE:		map[m].flag.hostile=0; break;//Sketchy
 		}
 	}
@@ -11810,8 +11805,8 @@
 	data = script_getdata(st,3);
 
+	if( script_hasdata(st,4) )
+		class_ = script_getnum(st,4);
 	if( script_hasdata(st,5) )
 		size = script_getnum(st,5);
-	if( script_hasdata(st,4) )
-		class_ = script_getnum(st,4);
 
 	get_val(st, data);
@@ -12150,5 +12145,6 @@
 		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);
@@ -12156,15 +12152,16 @@
 	}
 	
-	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);
@@ -13381,47 +13378,4 @@
 }
 
-/// Changes invoking character to alliance [sketchy]
-/// usage: alliance;
-BUILDIN_FUNC(god)
-{
-TBL_PC* sd;
-sd = script_rid2sd(st);
-if( sd == NULL )
-return 0;
-
-sd->state.demon = 0;
-sd->state.god = 1;
-return 0;
-}
-
-/// Changes invoking character to horde [sketchy]
-/// usage: horde;
-BUILDIN_FUNC(demon)
-{
-TBL_PC* sd;
-
-sd = script_rid2sd(st);
-if( sd == NULL )
-return 0;
-
-sd->state.god = 0;
-sd->state.demon = 1;
-return 0;
-}
-
-/// Clears faction [sketchy]
-/// usage: factionclear;
-BUILDIN_FUNC(factionclear)
-{
-TBL_PC* sd;
-
-sd = script_rid2sd(st);
-if( sd == NULL )
-return 0;
-
-sd->state.god = 0;
-sd->state.demon = 0;
-return 0;
-}
 
 // declarations that were supposed to be exported from npc_chat.c
@@ -13697,5 +13651,5 @@
 	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
@@ -13774,7 +13728,4 @@
 	BUILDIN_DEF(setquestobjective, "iisi"),
 	BUILDIN_DEF(setqueststatus, "ii"),
-	BUILDIN_DEF(god,""), // sets invoking character to alliance [Sketchy]
-	BUILDIN_DEF(demon,""), // sets invoking character to horde [Sketchy]
-	BUILDIN_DEF(factionclear,""), // clears invoking character's factions [Sketchy]
 	BUILDIN_DEF(hasquest, "i"),
 	{NULL,NULL,NULL},
