Jump to content

xazax

Members
  • Posts

    427
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by xazax

  1. 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.

  2. OnInit is invoked once all NPCs are (re)loaded, as part of the script engine's initialization. Rather than changing it's function, I'd prefer to have a separate OnLoad event. If that is a no-go, consider making this behavior optional per-NPC. Either as something like @donpcevent or an additional parameter in @loadnpc.

    I would prefer @loadnpc to trigger the OnInit label by default, and add an option (parameter) to avoid that. Opinion?

  3. 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

  4. 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.

  5. 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
×
×
  • Create New...