EvilPuncker Posted May 3, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Share Posted May 3, 2012 (edited) - 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 May 8, 2012 by EvilPuncker Link to comment Share on other sites More sharing options...
xazax Posted May 7, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share Posted May 7, 2012 my bad then 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; 1 Link to comment Share on other sites More sharing options...
EvilPuncker Posted May 7, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted May 7, 2012 (edited) @xazax works like a charm now it just need a battle conf added to features and then add to trunk @edit nvm, it broke the vending skill 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 May 7, 2012 by EvilPuncker Link to comment Share on other sites More sharing options...
xazax Posted May 7, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share Posted May 7, 2012 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 More sharing options...
EvilPuncker Posted May 7, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted May 7, 2012 then it works, seems like you have to close the vending after receiving the msg Link to comment Share on other sites More sharing options...
xazax Posted May 7, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share Posted May 7, 2012 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 Link to comment Share on other sites More sharing options...
EvilPuncker Posted May 8, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted May 8, 2012 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 More sharing options...
Toshiro Posted May 8, 2012 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: 14 hours ago Share Posted May 8, 2012 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 More sharing options...
xazax Posted May 9, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share Posted May 9, 2012 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 More sharing options...
EvilPuncker Posted May 9, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted May 9, 2012 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 More sharing options...
Toshiro Posted May 9, 2012 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: 14 hours ago Share Posted May 9, 2012 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 More sharing options...
EvilPuncker Posted May 9, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Author Share Posted May 9, 2012 then it needs more fixes than I thought of Link to comment Share on other sites More sharing options...
xazax Posted May 9, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 427 Reputation: 123 Joined: 11/17/11 Last Seen: December 31, 2022 Share Posted May 9, 2012 This means, not just this patch, but also the current vending system needs some rework. Link to comment Share on other sites More sharing options...
Toshiro Posted May 9, 2012 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 106 Reputation: 29 Joined: 11/08/11 Last Seen: 14 hours ago Share Posted May 9, 2012 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 More sharing options...
Akinari Posted September 6, 2013 Group: Members Topic Count: 32 Topics Per Day: 0.01 Content Count: 247 Reputation: 207 Joined: 10/23/12 Last Seen: March 2, 2022 Share Posted September 6, 2013 This was implemented in r17187. Link to comment Share on other sites More sharing options...
Recommended Posts