Try this one. I could not test it, because I created this patch in my workplace, and I don't have a client here , hope it works.
Index: conf/msg_athena.conf
===================================================================
--- conf/msg_athena.conf (revision 16084)
+++ conf/msg_athena.conf (working copy)
@@ -531,7 +531,7 @@
616: Taekwon
617: Star Gladiator
618: Soul Linker
-//619: FREE
+619: You can not open a shop close to an npc.
//620: FREE
621: Summer
622: Gangsi
Index: src/map/clif.c
===================================================================
--- src/map/clif.c (revision 16084)
+++ src/map/clif.c (working copy)
@@ -11654,7 +11654,17 @@
sd->vended_id = 0;
}
+/// Function to check visible NPCs
+static int check_npc_near_sub(struct block_list* bl, va_list args)
+{
+ TBL_NPC* nd = (TBL_NPC*)bl;
+ if( nd->sc.option&(OPTION_HIDE|OPTION_INVISIBLE) )
+ return 0;
+
+ return 1;
+}
+
/// Confirm or cancel the shop preparation window.
/// 012f <packet len>.W <shop name>.80B { <index>.W <amount>.W <price>.L }* (CZ_REQ_OPENSTORE)
/// 01b2 <packet len>.W <shop name>.80B <result>.B { <index>.W <amount>.W <price>.L }* (CZ_REQ_OPENSTORE2)
@@ -11674,6 +11684,10 @@
clif_displaymessage (sd->fd, msg_txt(276)); // "You can't open a shop on this map"
return;
}
+ if ( flag && map_foreachinrange(&check_npc_near_sub,&sd->bl, 3, BL_NPC) > 0) {
+ clif_displaymessage (sd->fd, msg_txt(619));
+ return;
+ }
if( map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKNOVENDING) ) {
clif_displaymessage (sd->fd, msg_txt(204)); // "You can't open a shop on this cell."
return;