Jump to content

7x7 Vend Protection Area


EvilPuncker

Recommended Posts


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

- 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

Edited by EvilPuncker
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

@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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

then it works, seems like you have to close the vending after receiving the msg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

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 :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

then it needs more fixes than I thought of :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

This means, not just this patch, but also the current vending system needs some rework.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  106
  • Reputation:   28
  • Joined:  11/08/11
  • Last Seen:  

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);

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  247
  • Reputation:   207
  • Joined:  10/23/12
  • Last Seen:  

This was implemented in r17187.

Link to comment
Share on other sites

×
×
  • Create New...