Jump to content

Shinto

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by Shinto

  1. in the past I also used that guide without having results ... try to do so:

    first entry in the item_db 

    • 21031,Caja_1,Caja de Nivel,2,0,,0,,,,,0xFFFFFFFF,63,2,,,70,,2000,{ getgroupitem(IG_LVLBOX); },{},{}
    • ( use getgroupitem instead of getrandgroupitem )

    there is no need to modify script_costants.hpp and itemdb.hpp

    then for second open item_group_db.txt
    and enter

    • // GroupID,ItemID,Rate
    • // LVLBOX

    IG_LVLBOX,501,1    // Red Potion

    IG_LVLBOX,502,1    // Orange Potion

    IG_LVLBOX,503,1    // Yellow Potion

    IG_LVLBOX,504,1    // White Potion

     

    I tried it with an item box that I created and it works .... I hope I helped you

  2. I use this procedure
    item_db.txt // I create the item box
    33000, Renewal_Box, Renewal Box, 18.10,, 10 ,,,,, 0xFFFFFFFF, 63.2 ,,,,,, {getgroupitem (IG_RNBOX); }, {}, {}


    then in item_group_db.txt
    I enter the items that can come out
    // ID_BOX,ITEM_ID,RATE_ITEM_Drop, Amount <---- If I'm wrong, this is the procedure
      IG_RNBOX, 607,5,3 // Yggdrasil Berry
      IG_RNBOX, 7517.3 // Gold Coin
      IG_RNBOX, 12522.4 // Blessing Scroll

     

    try also to take a look on the forum item_group_db surely there will be some tutorials

  3. yes, I try to explain myself better ...
    let's say that I have two arrays one is called array_1 and another array_2
    array_1 has these values
    example:
    Array_1 [0] = 1;
    Array_1 [1] = 2;
    array_1 [2] = 3;

    now I would like to copy the value of the array_1 in the array_2 but not in sequence but mixed
    Example
    Array_2 [0] ---> contents of Array_1 [2] (Array_2 [0] = 3;)
    Array_2 [1] ---> contents of Array_1 [0] (Array_2 [1] = 1;)
    Array_2 [2] ---> contents of Array_1 [1] (Array_2 [1] = 2;)

    I do not know if you understood unfortunately I can not explain well in this example ...

    in practice I have to randomly take an index of array_1 and copy it to array_2

     

    ----------------------------------------------------

    EDIT

    reading well I know that you understand ... I do not want to confuse your ideas

  4. hi everyone .. sorry my question a little trivial but unfortunately I can not come to head ...
    in practice I should copy the values of an array in another array but in a different arrangement (random type).

    Place an image to make you understand better why my English is not the best ... :mellow:

    grafico.png

    I tried to do it this way but logically it can happen that it copies the same value twice in the array

    @n = query_sql("SELECT `name` FROM `char`", .@name$);
    		for(.@na = 0; .@na < @n ; .@na++){ 
    			.@rand_array = rand(0,@n);
    			copyarray .@sorteggio$[.@na],.@name$[.@rand_array],@n;
    		}
     

    surely there are errors, I would be grateful if someone explained me a little better ...

    if I have not explained myself well I will try to make myself understood better
    ^_^

  5. hi to all, I wanted to share a script that I created and I hope it is useful for someone .. :)

    in practice, this npc is used with the @adminpanel or @adm command.
    a menu appears where you can
    Change Group ID
    Ban / Unban Player
    Change Name
    Change Sex
    Info Player (account_id`email`, `group_id`,` userid`, `user_pass`,` logincount`, `lastlogin`,` last_ip`, `sex`)
    definitely not the best and I appreciate the advice to improve it  ^ _ ^

    //===== rAthena Script =======================================
    //= Admin Panel
    //===== By: ==================================================
    //= Shinto 
    //============================================================
    -	script	adminPanel	-1,{
    end;
    
    OnInit:
    	.n$ = "[Admin Panel]";
    	bindatcmd "adminpanel",strnpcinfo(3)+"::OnAdminPanel";
    	bindatcmd "adm",strnpcinfo(3)+"::OnAdminPanel";
    	end;
    	
    OnAdminPanel:
    	if(getgmlevel() >= 99 ){
    		mes .n$;
    		mes "Hello "+strcharinfo(0)+".";
    		mes "Tell me what can I do for you?";
    		next;
    			//switch(select("Change Group ID:Ban/Unban Player:Change Name:Change Sex:Change Job:Info Player:Exit")){
    			switch(select("Change Group ID:Ban/Unban Player:Change Name:Change Sex:Info Player:Exit")){
    			
    				case 1://Change Group ID
    					mes .n$;
    					mes "Do you want to change the group ID of a player?";
    					mes "Please enter the Player name.";
    					next;
    					input @char_name$;
    					mes "name entered: "+@char_name$+".";
    					mes "Now enter the level";
    					input @lvl;
    					mes "level inserted: "+@lvl+".";
    					@p = query_sql("SELECT `account_id` FROM `char` WHERE `name`='"+@char_name$+"'", @account_id);
    					mes @account_id;
    					next;
    					if(@p == -1){
    						mes .n$;
    						mes "I'm sorry but the name entered is not valid!";
    						close;
    					}
    					else{
    						query_sql "UPDATE `login` SET `group_id`='"+@lvl+"' WHERE `account_id`='"+@account_id+"'";
    						@on = query_sql("SELECT `online` FROM `char` WHERE `name`='"+@char_name$+"'", @online);
    						if(@online == 1){
    							message @char_name$,"Your group level has been changed you will be logged out to make changes";
    							close2;
    							sleep2 2000;
    							atcommand "@kick " + @char_name$;
    							mes "The player has been disconnected";
    							close;
    						}
    						mes "The player is offline";
    						close2;
    						sleep2 2000;
    						end;
    					}
    					end;
    					
    
    				case 2://Ban/Unban Player
    					mes .n$;
    					mes "Do you want to ban or unban a player?";
    					next;
    						switch(select("Ban:Unban")){
    							case 1:
    								mes "enter the name of the player.";
    								next;
    								input @name_char$;
    								mes "name entered: "+@name_char$+".";
    								mes "insert the reason";
    								input @reason$;
    								mes "Enter the year in which the ban is ended:";
    								input @time_ban;
    								mes "End of ban: "+@time_ban+".";
    								next;
    								query_sql "INSERT INTO `ipbanlist` VALUE ('"+getcharip(@name_char$)+"','"+gettimestr("%Y-%m/%d %H:%M:%S",21)+"','"+gettimestr(@time_ban+"-%m/%d %H:%M:%S",21)+"','"+@reason$+"')";
    								message @name_char$,"You have been IP Banned by "+strcharinfo(0)+" [Reason: "+@reason$+"]"; 
    								close2;
    								sleep2 2000;
    								atcommand "@kick "+@name_char$;
    								mes "User disconnected";
    								close;
    								
    							case 2:
    								.@nmb = 1;
    								setarray .@name_char$[0],"";
    								@p_1 = query_sql("SELECT `list` FROM `ipbanlist`", @list_ip$);
    								mes .n$;
    								for(.@bn = 0; .@bn < @p_1; .@bn++){
    									@q = query_sql("SELECT `account_id` FROM `login` WHERE `last_ip`='"+@list_ip$[.@bn]+"'", @acc_id_ban$);
    									for(.@l = 0; .@l < @q; .@l++){
    										@o = query_sql("SELECT `name` FROM `char` WHERE `account_id`='"+@acc_id_ban$[.@l]+"'", @name_id_ban$);
    										mes ""+.@nmb+" - | IP = "+@list_ip$[.@bn]+"";
    										mes "   - | ACC ID = "+@acc_id_ban$[.@l]+"";
    										mes "   - | Char: = "+@name_id_ban$+"";
    										mes "=================================";
    										.@size_name_ban = getarraysize(@name_id_ban$);
    										.@size_id_ban = getarraysize(@acc_id_ban$);
    										copyarray .@name_char$[.@bn],@name_id_ban$[.@l],.@size_name_ban;
    										copyarray .@id_char$[.@bn],@acc_id_ban$[.@l],.@size_id_ban;
    										.@nmb++;
    									}
    								}
    								next;
    								.@size_name_char = getarraysize(.@name_char$);
    
    								.@menu_ban$ = implode(.@name_char$, ":");
    								.@select_menu_ban = select(.@menu_ban$) - 1;
    								
    								for(.@e = 0; .@e < .@size_name_ban; .@e++){
    									if(.@select_menu_ban == .@e){
    										mes "do you want to unban this player?";
    										switch(select("Yes:No")){
    											case 1://Yes
    												@k = query_sql("SELECT `account_id` FROM `char` WHERE `name`='"+.@name_char$[.@e]+"'", @id_unban$);
    												@j = query_sql("SELECT `last_ip` FROM `login` WHERE `account_id`='"+@id_unban$+"'", @ip_unban$);
    												query_sql("DELETE FROM `ipbanlist` WHERE `list` = '"+@ip_unban$+"'");
    												mes "The player has been unlocked!";
    												close;
    											case 2://NO
    												mes "Ok...Byeee!";
    												close;
    										}
    									}
    									
    								}
    								close;
    						}
    						end;
    					
    				//------- Change Name -------------------//
    				case 3://Change Name
    					mes .n$;
    					mes "Do you want to change the name of a player?";
    					next;
    					switch(select("Yes:No")){
    						case 1://Yes
    							mes "Enter the name of the player you want to change the name";
    							next;
    							input .@old_namePlayer$;
    							mes "Now enter the new name you want to assign to the player";
    							input .@new_namePlayer$;
    							mes "Old Name: "+.@old_namePlayer$+"";
    							mes "New Name: "+.@new_namePlayer$+"";
    							mes "Confirm?";
    							switch(select("Yes:No")){
    								case 1:
    									mes "The player will be disconnected for changes!";
    									query_sql "UPDATE `char` SET `name` = '"+escape_sql(.@new_namePlayer$)+"' WHERE `name` = '"+.@old_namePlayer$+"'";
    									@onl = query_sql("SELECT `online` FROM `char` WHERE `name`='"+.@new_namePlayer$+"'", @online);
    									next;
    									if(@online == 1){
    										message .@old_namePlayer$,"Your name has been changed .... you will be disconnected!";
    										close2;
    										sleep2 2000;
    										atcommand "@kick " + .@old_namePlayer$;
    										mes "The player has been disconnected";
    										close;
    									}
    									mes "The player is offline";
    									close2;
    									sleep2 2000;
    									end;
    												
    								case 2:
    									mes .n$;
    									mes "Bye...";
    									close;
    							}
    						case 2://NO
    							mes .n$;
    							mes "Bye...";
    							close;
    					}					
    					
    				//------- Sex -------------------//
    				case 4://Sex
    					mes .n$;
    					mes "Do you want to change the sex of a player?";
    					next;
    					switch(select("Yes:No")){
    						case 1://Yes
    							mes "Enter the name of the player you want to change the sex";
    							next;
    							input .@namePlayer$;
    							@sx = query_sql("SELECT `sex` FROM `char` WHERE `name`='"+.@namePlayer$+"'", @sex$);
    							if(@sex$ == "M"){
    								mes "The player is Male";
    								mes "do you want to change in female?";
    								next;
    								switch(select("Yes:No")){
    									case 1:
    										mes "The player will be disconnected for changes!";
    										query_sql "UPDATE `char` SET `sex` = 'F' WHERE `name` = '"+.@namePlayer$+"'";
    										@onl = query_sql("SELECT `online` FROM `char` WHERE `name`='"+.@namePlayer$+"'", @online);
    										next;
    										if(@online == 1){
    											message .@namePlayer$,"Your sex has been changed .... you will be disconnected!";
    											close2;
    											sleep2 2000;
    											atcommand "@kick " + .@namePlayer$;
    											mes "The player has been disconnected";
    											close;
    										}
    										mes "The player is offline";
    										close2;
    										sleep2 2000;
    										end;
    													
    									case 2:
    										mes .n$;
    										mes "Bye...";
    										close;
    								}
    							}
    							else if (@sex$ == "F"){
    								mes "The player is Female";
    								mes "do you want to change in Male?";
    								next;
    								switch(select("Yes:No")){
    									case 1:
    										mes "The player will be disconnected for changes!";
    										query_sql "UPDATE `char` SET `sex` = 'F' WHERE `name` = '"+.@namePlayer$+"'";
    										@onl = query_sql("SELECT `online` FROM `char` WHERE `name`='"+.@namePlayer$+"'", @online);
    										next;
    										if(@online == 1){
    											message .@namePlayer$,"Your sex has been changed .... you will be disconnected!";
    											close2;
    											sleep2 2000;
    											atcommand "@kick " + .@namePlayer$;
    											mes "The player has been disconnected";
    											close;
    										}
    										mes "The player is offline";
    										close2;
    										sleep2 2000;
    										end;
    													
    									case 2:
    										mes .n$;
    										mes "Bye...";
    										close;
    								}
    							}
    							
    							
    						case 2://NO
    							mes .n$;
    							mes "Bye...";
    							close;
    					}
    					end;
    					
    					
    				/*//------- Change job -------------------//
    				case 5://Exit
    					mes .n$;
    					mes "Do you want to change the class of a player?";
    					next;
    					switch(select("Yes:No")){
    						case 1://Yes
    							mes "Enter the name of the player you want to change the class";
    							next;
    							input .@namePlayer$;
    							@sx = query_sql("SELECT `class` FROM `char` WHERE `name`='"+.@namePlayer$+"'", @class);
    							@sx = query_sql("SELECT `char_id` FROM `char` WHERE `name`='"+.@namePlayer$+"'", @char_id);
    							//.@charID = getcharid(0,.@namePlayer$);
    							mes "the current class is "+jobname(@class)+"";
    							mes "what do you want to change?";
    							close;
    							
    						case 2://NO
    							mes .n$;
    							mes "Bye...";
    							close;
    					}
    					end;*/
    					
    				//------- Info Player -------------------//
    				//case 6://Info Player
    				case 5://Info Player
    					mes .n$;
    					mes "Enter the name of the player.";
    					next;
    					input .@namePlayer$;
    					@o = query_sql("SELECT `account_id` FROM `char` WHERE `name` ='"+.@namePlayer$+"'", @acc_id_player);
    					@sx = query_sql("SELECT `email`,`group_id`,`userid`,`user_pass`,`logincount`,`lastlogin`,`last_ip`,`sex` FROM `login` WHERE `account_id` ='"+@acc_id_player+"'",@email_pl$,@groupID,@user_ID$,@userPass$,@login_count,@last_login$,@last_ip$,@sex$);
    					mes "Account ID: "+@acc_id_player+"";
    					mes "Email: "+@email_pl$+"";
    					mes "Group ID: "+@groupID+"";
    					mes "User ID: "+@user_ID$+"";
    					mes "Passwrod ID: "+@userPass$+"";
    					mes "Login Count: "+@login_count+"";
    					mes "Last Login: "+@last_login$+"";
    					mes "Last IP: "+@last_ip$+"";
    					mes "Sex: "+@sex$+"";
    					close;
    
    					
    				//------- Exit -------------------//
    				//case 7://Exit
    				case 6://Info Player
    					mes .n$;
    					mes "Bye...";
    					close;
    			}
    					
    				
    	}
    	else{
    		end;
    	}
    	
    }

     

    Admin Panel.txt

     

    admin_panel.txt

  6. hello here is a script I have not tested it but it should work ... if you have problems, please ask ... you have to change the id of the items that I have not modified

    prontera,150,150,4	script	Coin Master	468,{
    
    	.npc$ = "[Coin Master]"; //<--- Change name
    	.@SoulCoin_ID = 502; //<-- Insert id Soul Coin
    	.@HollowCoin_ID = 502; //<--- Hollow coin ID
    	.@SacredCoin_ID = 502; //<--- Put SacredCoin_ID
    	
    	mes .npc$;
    	mes "Hello "+strcharinfo(0)+".";
    	mes "During your adventure you will find some Coin.";
    	mes "I can exchange them in other coins.";
    	mes "^990000500^000000 x ^333300Soul Coin^000000->^808080Hollow Coin^000000 x ^9900001^000000";
    	mes "^99000020^000000 x ^808080Hollow Coin^000000->^999900Sacred Coin^000000 x ^9900001^000000";
    	next;
    	switch(select("^333300Soul Coin^000000->^808080Hollow Coin^000000:^808080Hollow Coin^000000->^999900Sacred Coin^000000")){
    		case 1://Soul Coin -> hollow coins
    			mes .npc$;
    			mes "How many you want to exchange?";
    			next;
    			input .@count;
    			if(.@count == 0) close;
    			if(countitem(.@SoulCoin_ID) < .@count*500) goto L_NE;
    			delitem SoulCoin_ID,.@count*500;
    			getitem HollowCoin_ID,.@count;
    			close;
    			
    		case 2: //hollow coins .>> Sacred coin
    			mes .npc$;
    			mes "How many you want to exchange?";
    			next;
    			input .@count;
    			if(.@count == 0) close;
    			if(countitem(.@HollowCoin_ID) < .@count*20) goto L_NE;
    			delitem .@HollowCoin_ID,.@count*20;
    			getitem .@SacredCoin_ID,.@count;
    			close;
    	}
    	L_NE:
    		mes .npc$;
    		mes "You don't have that coin enough.";
    		close;
    	
    }
    2 hours ago, zerefff said:
    
    guys please give me coin trader npc script. 
    

    Example: 500soul coin = 1hollow coin

                    20hollow coin= 1sacred coin

    thank you guys in advance. godbless

    sorry I was wrong to understand .... -.- '

    however I remain the script in case it can serve ..... sorry again but I thought you needed a normal coin trade -.- '

    • Love 1
  7. Thanks Lights I solved ..... I modified with "sd-> card.u.items_cart" and now it works .... here is the working script :)

     

    /*==========================================
    * @whosell - List who is vending the item (amount, price, and location).
    * revamped by VoidLess, original by zephyrus_cr
    *------------------------------------------*/
    ACMD_FUNC(whosell)
    {
       char item_name[100];
       int item_id = 0, j, count = 0, sat_num = 0;
       int s_type = 1; // search bitmask: 0-name,1-id, 2-card, 4-refine
       int refine = 0,card_id = 0;
       bool flag = 0; // place dot on the minimap?
       struct map_session_data* pl_sd;
       struct s_mapiterator* iter;
       unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0;
       struct item_data *item_data;
       nullpo_retr(-1, sd);
       if (!message || !*message) {
        clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>");
        return -1;
       }
       if (sscanf(message, "+%d %d[%d]", &refine, &item_id, &card_id) == 3){
        s_type = 1+2+4;
       }
       else if (sscanf(message, "+%d %d", &refine, &item_id) == 2){
        s_type = 1+4;
       }
       else if (sscanf(message, "+%d [%d]", &refine, &card_id) == 2){
        s_type = 2+4;
       }
       else if (sscanf(message, "%d[%d]", &item_id, &card_id) == 2){
        s_type = 1+2;
       }
       else if (sscanf(message, "[%d]", &card_id) == 1){
        s_type = 2;
       }
       else if (sscanf(message, "+%d", &refine) == 1){
        s_type = 4;
       }
       else if (sscanf(message, "%d", &item_id) == 1 && item_id == atoi(message)){
       //names, that start on num are not working
       //so implemented minumum item_id>500
       //or better make item_id == atoi(message) ?
        s_type = 1;
       }
       else if (sscanf(message, "%99[^\n]", item_name) == 1){
        s_type = 1;
        if ((item_data = itemdb_searchname(item_name)) == NULL){
    	    clif_displaymessage(fd, "Not found item with this name");
    	    return -1;
        }
        item_id = item_data->nameid;
       }
       else {
        clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>");
        return -1;
       }
    
       //check card
       if(s_type & 2 && ((item_data = itemdb_exists(card_id)) == NULL || item_data->type != IT_CARD)){
        clif_displaymessage(fd, "Not found a card with than ID");
        return -1;
       }
       //check item
       if(s_type & 1 && (item_data = itemdb_exists(item_id)) == NULL){
        clif_displaymessage(fd, "Not found an item with than ID");
        return -1;
       }
       //check refine
       if(s_type & 4){
        if (refine<0 || refine>10){
    	    clif_displaymessage(fd, "Refine out of bounds: 0 - 10");
    	    return -1;
        }
        /*if(item_data->type != IT_WEAPON && item_data->type != IT_ARMOR){
    	    clif_displaymessage(fd, "Use refine only with weapon or armor");
    	    return -1;
        }*/
       }
       iter = mapit_getallusers();
       for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
       {
        if( pl_sd->vender_id ) //check if player is vending
        {
    	    for (j = 0; j < pl_sd->vend_num; j++) {
    		    if((item_data = itemdb_exists(sd->cart.u.items_cart[pl_sd->vending[j].index].nameid)) == NULL)
    			    continue;
    		    if(s_type & 1 && sd->cart.u.items_cart[pl_sd->vending[j].index].nameid != item_id)
    			    continue;
    		    if(s_type & 2 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) ||
    						    (sd->cart.u.items_cart[pl_sd->vending[j].index].card[0] != card_id &&
    						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[1] != card_id &&
    						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[2] != card_id &&
    						    sd->cart.u.items_cart[pl_sd->vending[j].index].card[3] != card_id)))
    			    continue;
    		    if(s_type & 4 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || sd->cart.u.items_cart[pl_sd->vending[j].index].refine != refine))
    			    continue;
    		    if(item_data->type == IT_ARMOR)
    			    snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].refine
    					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
    					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[0]
    					    ,pl_sd->vending[j].value
    					    ,pl_sd->vending[j].amount
    					    ,mapindex_id2name(pl_sd->mapindex)
    					    ,pl_sd->bl.x,pl_sd->bl.y
    					    ,pl_sd->status.name);
    		    else if(item_data->type == IT_WEAPON)
    			    snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d,%d,%d,%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].refine
    					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
    					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[0]
    					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[1]
    					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[2]
    					    ,sd->cart.u.items_cart[pl_sd->vending[j].index].card[3]
    					    ,pl_sd->vending[j].value
    					    ,pl_sd->vending[j].amount
    					    ,mapindex_id2name(pl_sd->mapindex)
    					    ,pl_sd->bl.x,pl_sd->bl.y
    					    ,pl_sd->status.name);
    		    else
    			    snprintf(atcmd_output, CHAT_SIZE_MAX, "ID %d | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",sd->cart.u.items_cart[pl_sd->vending[j].index].nameid
    					    ,pl_sd->vending[j].value
    					    ,pl_sd->vending[j].amount
    					    ,mapindex_id2name(pl_sd->mapindex)
    					    ,pl_sd->bl.x, pl_sd->bl.y
    					    ,pl_sd->status.name);
    		    if(pl_sd->vending[j].value < MinPrice) MinPrice = pl_sd->vending[j].value;
    		    if(pl_sd->vending[j].value > MaxPrice) MaxPrice = pl_sd->vending[j].value;
    		    clif_displaymessage(fd, atcmd_output);
    		    count++;
    		    flag = 1;
    	    }
    	    if(flag && pl_sd->mapindex == sd->mapindex){
    		    clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF);
    		    flag = 0;
    	    }
        }
       }
       mapit_free(iter);
       if(count > 0) {
        snprintf(atcmd_output,CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice);
        clif_displaymessage(fd, atcmd_output);
       } else
        clif_displaymessage(fd, "Nobody is selling it now.");
       return 0;
    }

     

  8. Lighta I modified the source as you told me but it does not work .... it always gives me error when compiling the emulator.

    Ps. I modified all the strings "pl_sd->status.cart" in "pl_sd->cart", that were in the source command

    Immagine.png.a33919d331a2c5b14d5b7e17dc9ec428.png

    Error VC++
    No operator [] corresponding to the operands

     

  9. Hello everyone, even if the post is old I prefer not to open another, and I'll explain my problem ... In practice I tried to add the command to rAthena but when I compile it with vc ++ gives me error.
    Error VC++
    
    1. class "mmo_charstatus" does not include any members "cart"

     

     atcommand.cpp

    Where am I doing wrong?

  10. Hello Radian, thanks for your help, I solved thanks to your information, certainly is to be improved but for now it works ... :)

    -- Edit

    llchrisll  I read your answer now .... You're right I saw after the error and I fixed it :) thanks .... How did I change okay?

     

    prontera,136,171,4	script	Molly	469,{
    
    	.@npcname$ = "[Molly]";
    
    		
    
    	mes .@npcname$;
    	mes "Hello "+strcharinfo(0)+".";
    	mes "I can convert your Gold Coins in Cash Points!";
    	mes "You need 15 Gold Coins for 0.100  Cash Points.";
    	mes "How many you want to exchange?";
    	next;
    			input .@count;
    			if(.@count == 0) close;
    			if(.@count < 100) close;
    			if(countitem(7517) < .@count/100*15) goto L_NE;
    			delitem 7517,.@count/100*15;
    			//set #CASHPOINTS,#CASHPOINTS+1;
    			#CASHPOINTS += .@count;
    			close;
    
    			L_NE:
    				mes .@npcname$;
    				mes "You don't have that coin enough.";
    				close;
    
    }

     

  11. Hello everyone, I am new to the forum. I would have a problem with a script that converts Gold Coin into Cash Point. The script works, but the problem is that if for example I have 10 Cash poins, when I convert 15 Gold Coin into 1 Cash Point I do not have 11 Cash Points, but rather 1. I hope I explained myself, sorry for my bad english ...

     

    prontera,136,171,4	script	Molly	469,{
    
    	.@npcname$ = "[Molly]";
    
    	mes .@npcname$;
    	mes "Hello "+strcharinfo(0)+".";
    	mes "I can convert your Gold Coin in Cash Poin!";
    	mes "You need 15 Gold Coin for 0.01 Cash Poin.";
    	mes "How many you want to exchange?";
    	next;
    			input .@count;
    			if(.@count == 0) close;
    			if(countitem(7517) < .@count*15) goto L_NE;
    			delitem 7517,.@count*15;
    			set #CASHPOINTS,#CASHPOINTS+1;
    			close;
    
    			L_NE:
    				mes .@npcname$;
    				mes "You don't have that coin enough.";
    				close;
    
    }

     

×
×
  • Create New...