Jump to content

Recommended Posts

Posted

my bad then /no1 so I would like to bump with that one xD

- add this "You can no longer set up purchase shops / vends within a 7x7 area around any NPC's." from

8/17/2011 kRO Maintenance

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;

  • Upvote 1
Posted (edited)

@xazax

works like a charm /no1 now it just need a battle conf added to features and then add to trunk :)

@edit

nvm, it broke the vending skill :D steps to reproduce:

1 - go near a npc and try to open your store

2 - get the 619 msg

3 - walk away from the npc range

4 - click ok to sell the same item

5 - get "You can't sell undentified items"

6 - the item disappears until logout

Edited by EvilPuncker
Posted

Strange.

What happens, if you do a @refresh before step 4? And I wonder if there are some novending cells on the map if they have the same effect (they should). Maybe it is yet another issue with supporting "new" clients.

Posted

I wonder how the official servers hande this. Maybe they send ZC_OPENSTORE with negative or 0 number, which forces the client to close the window? Just a blind guess though, I hope somebody will make some packet capture on official servers /no1

Posted
btw it still triggers the msg even if you hit cancel instead of OK I've added a clif_refresh(sd); while there is no fix :)

That's probably not how it should be, but it's still useful if you don't want to count the cells - just use Vending, press cancel and see if you're already out of the restricted area.

Posted

btw it still triggers the msg even if you hit cancel instead of OK

I've added a clif_refresh(sd); while there is no fix :)

I modified my diff, so it also checks flag (which should hold information about which button was pressed), now it should only trigger if one hit OK.

Posted

btw it still triggers the msg even if you hit cancel instead of OK

I've added a clif_refresh(sd); while there is no fix :)

I modified my diff, so it also checks flag (which should hold information about which button was pressed), now it should only trigger if one hit OK.

now its okay, but still the message from unidentified items :/ since the shop window still open, maybe that has something to do with vending.c?

Posted

Official does not even shows you the vending window if you're in the range of an NPC and throws a message in the chatlog. Further you're unable to move while having the vending window open. Tested with the Buying Store item, but vending should be similar.

Posted

Reply packet when trying to use the Buying Store item (is not consumed) when being in the restricted range of an NPC.

10 01 E7 09 00 00 00 00 00 53

clif_skill_fail(sd, ALL_BUYING_STORE, 83, 0);

  • 1 year later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...