Jump to content

Napster

Members
  • Posts

    196
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by Napster

  1. if you want to use please read topic reference

     

    ref topichttp://rathena.org/board/topic/60817-extended-vending-system-18/

    this version fix & cleanup support rAthena only

     

    update : 23/11/2015

     

    fix clash & cleanup

     

    version 1.9.0

    1. support new item array max (range: 1 ~ 65,534)

    2. support Autotrade persistency (please update SQL files upgrade_extended_vending_item.sql)

    3. fix map server clash when cancle windows select item

    4. cleanup some code

     

     

    version 1.9.1

    1. fix wrong msg number
    2. add battle conf show broadcas info when click shop board

    3. cleanup support rAthena revision 12425
     

    version 1.9.2

    1. fix bug autotarde can't save state type (Bugreport by Darkpurple) thank you

    2. cleanup support rAthena revision 12540

     

    version 1.9.3

    1. cleanup support rAthena revision 12836
     

    version 1.9.4

    1. cleanup support rAthena revision 15149

     

    enjoy

    upgrade_extended_vending_item.sql

    ExtendedVendingSystem_1.9.patch

    ExtendedVendingSystem_1.9.1.diff

    ExtendedVendingSystem_1.9.1_r17704.diff

    ExtendedVendingSystem_1.9.2.diff

    ExtendedVendingSystem_1.9.3_r12836.diff

    ExtendedVendingSystem_1.9.4_r15149.diff

    • Upvote 10
  2. open atcommand.c

    and find recallall

    replace this

     

    ACMD_FUNC(recallall)
    {
    	struct map_session_data* pl_sd;
    	struct s_mapiterator* iter;
    	int count;
    	nullpo_retr(-1, sd);
    
    	memset(atcmd_output, '\0', sizeof(atcmd_output));
    
    	if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) {
    		clif_displaymessage(fd, msg_txt(sd,1032)); // You are not authorized to warp someone to your current map.
    		return -1;
    	}
    
    	count = 0;
    	iter = mapit_getallusers();
    	for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
    	{
    		if (sd->status.account_id != pl_sd->status.account_id && !( pl_sd->state.vending || pl_sd->state.buyingstore || pl_sd->state.autotrade ) && pc_get_group_level(sd) >= pc_get_group_level(pl_sd))
    		{
    			if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)
    				continue; // Don't waste time warping the character to the same place.
    			if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE))
    				count++;
    			else {
    				if (pc_isdead(pl_sd)) { //Wake them up
    					pc_setstand(pl_sd, true);
    					pc_setrestartvalue(pl_sd,1);
    				}
    				pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN);
    			}
    		}
    	}
    	mapit_free(iter);
    
    	clif_displaymessage(fd, msg_txt(sd,92)); // All characters recalled!
    	if (count) {
    		sprintf(atcmd_output, msg_txt(sd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled.
    		clif_displaymessage(fd, atcmd_output);
    	}
    
    	return 0;
    }
    
    • Upvote 1
  3. check battle.c

    find 

    if( sc->data[SC_PNEUMA] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG ) {
    

    edit to

    		if( sc->data[SC_PNEUMA] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG ) {
    			d->dmg_lv = ATK_BLOCK;
    			skill_blown(src,bl,skill_get_blewcount(skill_id,skill_lv),-1,0);
    			return 0;
    		}
    

    and recompile server again

  4. thank you for update @Cydh

    i report this some problem

    1. when restart server and use autotrade config around 15 sec, and player with autotrade state & sitting

    #define pc_setsit(sd)         ( (sd)->state.dead_sit = (sd)->vd.dead_sit = 2 )
    

    but set state only, i think add to this , bcz real player login before player with autotrade not update display sitting

    			if( autotraders[i]->sit ) {
    				skill_sit(sd, 1);
    				pc_setsit(sd);
    				clif_sitting(&sd->bl);
    			}
    

    2. issues autotrade delay , i think can't protect over load from SQL

    maybe add delay login to server for player with autotrade config

     

    ex. if autotrader data upto 100 user when restart ,100 user come together

     

    thank you again

  5. wrong arguments

     

     

    *getitembound2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>{,<account ID>};

    *getitembound2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>,<bound type>{,<account ID>};

     

    getitembound2 .@rwd[.@i], .@rwd[.@i+1], 1, 0 ,0 ,0 , 0 , 0, 0, 3;

    • Upvote 1
  6. find & open in folder conf/msg_conf/map_msgconf

     

    find 

     

    380: Item Failed. [%s] is cooling down. Wait %.1f seconds.

     

    change

     

     

    380: Item Failed. [%s] is cooling down. Wait %d seconds.

     

    save and restart again

    • Upvote 1
  7. @Cydh

     

    I have idea for look & feel perfect when create shop

    			// Make him look perfect
    			unit_setdir(&sd->bl,battle_config.feature_autotrade_direction);
    
    			if( battle_config.feature_autotrade_sit )
    				pc_setsit(sd);
    

    i think allter table "action" store value for this (&dir, &head_dir, &sit)

    	if (dir || head_dir)
    	{
    		pc_setdir(sd, dir, head_dir);
    		clif_changed_dir(&sd->bl, AREA);
    	}
    
    	if( battle_config.feature_autotrade_sit )
    		pc_setsit(sd);
    

    use function input value

    sprintf(value, "%d,%d,%d", sd->ud.dir, sd->head_dir, pc_issit(sd));
    sscanf(sd->autotrade.action, "%d,%d,%d", &dir, &head_dir, &sit); 

    I Suggest it  thank you sir

    • Upvote 1
  8. @Cydh

     

    I Suggest for gm command when very need remove player with autotrade

     

    or click right gm menu
     

    void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd)
    {
    	int fd = tsd->fd;
    
    	if( fd > 0 )
    		clif_authfail_fd(fd, 15);
    	else {
    		if( tsd->state.vending && tsd->state.autotrade ){
    			if( Sql_Query( mmysql_handle, "UPDATE `%s` SET `autotrade` = 0 WHERE `id` = %d;", vendings_db, tsd->vender_id ) != SQL_SUCCESS ){
    				Sql_ShowDebug( mmysql_handle );
    			}
    		}else if( tsd->state.buyingstore && tsd->state.autotrade ){
    			if( Sql_Query( mmysql_handle, "UPDATE `%s` SET `autotrade` = 0 WHERE `id` = %d;", buyingstore_db, tsd->buyer_id ) != SQL_SUCCESS ){
    				Sql_ShowDebug( mmysql_handle );
    			}
    		}
    		map_quit(tsd);
    	}
    
    	if( sd )
    		clif_GM_kickack(sd,tsd->status.account_id);
    }
    

    thank you

    • Upvote 1
  9. check utils.c

     

    find 

    	else if(date < 20131223) return 45;
    	else if(date >= 20131223) return 46;
    
    	else return 30; //default
    }
    

    add to

    	else if(date < 20131223) return 45;
    	else if(date < 20131223) return 46;
    	else if(date >= 20140305) return 47;
    
    	else return 30; //default
    }
    

    and recompile


    and check clif.h

    find

    enum { // packet DB
    	MAX_PACKET_DB  = 0xf00,
    	MAX_PACKET_VER = 46,
    	MAX_PACKET_POS = 20,
    };
    

    edit to

    enum { // packet DB
    	MAX_PACKET_DB  = 0xf00,
    	MAX_PACKET_VER = 47,
    	MAX_PACKET_POS = 20,
    };
    

    check login_athena.conf

    // What version is allowed to connect? (if the option above is enabled)
    client_version_to_connect: 20
    

    edit to : 47

     

    check clientinfo.xml

    		<version>30</version>
    

    edit to 47

    • Upvote 2
  10. // Top = 256|1024

    // Mid = 512|2048

    // Low = 1|4096

     

    // Top+Mid = 768|3072

    // Top+Low = 257|5120

    // Mid+Low = 513|6144

    // Top+Mid+Low = 769|7168

     

    // Robe = 4|8192

    // Ammo = 32768

    // Shadow Armor = 65536

    // Shadow Weapons = 131072

    // Shadow Shield = 262144

    // Shadow Shoes = 524288

    // Shadow Acc R = 1048576

    // Shadow ACC L = 2097152

  11. @Cydh

     

    please check , i'am not sure this function support for USHRT_MAX

    /// npc_selllist for script-controlled shops
    static int npc_selllist_sub(struct map_session_data* sd, int n, unsigned short* item_list, struct npc_data* nd)
    {
    	char npc_ev[EVENT_NAME_LENGTH];
    	char card_slot[NAME_LENGTH];
    	int i, j, idx;
    	int key_nameid = 0;
    	int key_amount = 0;
    	int key_refine = 0;
    	int key_attribute = 0;
    	int key_identify = 0;
    	int key_card[MAX_SLOTS];
    

    int key_nameid = 0; <-- support 65k array (not sure)
     

    and 

    /// Returns the id of the reference
    #define reference_getid(data) ( (int32)(reference_getuid(data) & 0x00ffffff) )
    /// Returns the array index of the reference
    #define reference_getindex(data) ( (int32)(((uint32)(reference_getuid(data) & 0xff000000)) >> 24) )
    
    /// Composes the uid of a reference from the id and the index
    #define reference_uid(id,idx) ( (int32)((((uint32)(id)) & 0x00ffffff) | (((uint32)(idx)) << 24)) )
    

    not support USHRT_MAX

     

    thankyou

  12. suggestion suppot for atcommand

    @debuff 

    @debuffmap "mapname"

    @debuffall

    ACMD_FUNC(debuff) {
    	struct block_list* bl;
    
    	nullpo_retr(-1,sd);
    
    	bl = &sd->bl;
    
    	if (!bl)
    		return -1;
    
    	status_change_clear(bl, 3); // remove all effects
    	pc_bonus_script_clear_all(sd,1); /// Don't remove permanent script
    	clif_specialeffect(bl,235,AREA);
    	clif_displaymessage(sd->fd, "Remove all effects successfully.");
    	return 0;
    }
    
    ACMD_FUNC(debuffmap)
    {
    	struct map_session_data* pl_sd;
    	struct s_mapiterator* iter;
    	char map_name[MAP_NAME_LENGTH_EXT];
    	int m = -1;
    
    	nullpo_retr(-1, sd);
    
    	memset(atcmd_output, '\0', sizeof(atcmd_output));
    	memset(map_name, '\0', sizeof(map_name));
    
    	sscanf(message, "%15s", map_name);
    
    	if (map_name[0] == '\0') {
    		m = map_mapindex2mapid(sd->mapindex);
    	} else {
    		m = map_mapname2mapid(map_name);
    	}
    
    	if (m < 0) {
    		clif_displaymessage(fd, msg_txt(sd,1));
    		return -1;
    	}
    
    	iter = mapit_getallusers();
    	for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
    	{
    		if (sd->status.account_id != pl_sd->status.account_id && pl_sd->bl.m == m) {
    			status_change_clear(&pl_sd->bl, 3); // remove all effects
    			pc_bonus_script_clear_all(&pl_sd,1); /// Don't remove permanent script
    			clif_specialeffect(&pl_sd->bl,235,AREA);
    			clif_displaymessage(pl_sd->fd, "Remove all effects successfully.");
    		}
    	}
    	mapit_free(iter);
    	clif_displaymessage(fd, "All players in your map has been debuffed!");
    	return 0;
    }
    

    thank you dev team

  13. see skill.c 

    	case MO_BODYRELOCATION:
    		if (unit_movepos(src, x, y, 1, 1)) {
    #if PACKETVER >= 20111005
    			clif_snap(src, src->x, src->y);
    #else
    			clif_skill_poseffect(src,skill_id,skill_lv,src->x,src->y,tick);
    #endif
    			if (sd)
    				skill_blockpc_start (sd, MO_EXTREMITYFIST, 2000);
    		}
    		break;
    

    add this and recompile

    	case MO_BODYRELOCATION:
    		if (unit_movepos(src, x, y, 1, 1)) {
    #if PACKETVER >= 20111005
    			clif_skill_poseffect(src,skill_id,skill_lv,src->x,src->y,tick);
    			clif_snap(src, src->x, src->y);
    #else
    			clif_skill_poseffect(src,skill_id,skill_lv,src->x,src->y,tick);
    #endif
    			if (sd)
    				skill_blockpc_start (sd, MO_EXTREMITYFIST, 2000);
    		}
    		break;
    
    • Upvote 2
  14. @itembound <item name/ID> <amount> <bound type>

    @itembound2 <item name/ID> <quantity> <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4> <bound type>

     

    Creates an item bounded to the character.

    The items cannot be dropped, sold, vended, auctioned, or mailed, and in some cases cannot be traded or stored.

     

    Available types:

    -- 1: Account

    -- 2: Guild

    -- 3: Party

    -- 4: Character

×
×
  • Create New...