Jump to content

Mahiro

Members
  • Posts

    65
  • Joined

  • Last visited

Posts posted by Mahiro

  1. if(isequippedcnt(4457) < 3){
    	bonus2 bAddRace,RC_DemiHuman,30;
    	bonus2 bAddRace,RC_Player_Human,30;
    } else
    	message strcharinfo(0),"Solo puedes equipar 2x "+getitemname(4457)+"! Tarjeta (s) adicional (es) ha sido deshabilitada.";

    try

  2. If it works the way you want, great.

    To reset it, just make sure that when starting the event it uses this here:

    query_sql "SELECT value FROM acc_reg_num WHERE key = '#CAMPEON'",.@hcv;
    if(.@hcv)
    	query_sql "DELETE FROM acc_reg_num WHERE key = '#CAMPEON'";

     

    3 hours ago, Kawacito said:

     

    Now I have a question, how would I make it show me the first 5 users in descending order?

    Here:

    -	script	HERO_C	-1,{
    	
    	OnCampeon:
        query_sql "SELECT char_name, value FROM JM_MVPTR ORDER BY value DESC, date DESC LIMIT 5",.@rpname$,.@value;
    	
    	.@npcname$ = "[ HERO MVP ]";
    	mes .@npcname$;
    	if(.@value){
            mes "El campeon de Hero es "+.@rpname$+" con un total de "+.@value+" Puntos";
            switch(select("Reclamar Premio:TOP 5:Cancelar")){
    			clear;
    			mes .@npcname$;
    			case 1:
    			.@mkname$ = strcharinfo(0);
    			if(.@rpname$ != .@rpname$){
    				mes" Tu no eres el campeon de HERO."; 
    				close;
    			} else {
    				if(#CAMPEON){
    					mes "Lo siento pero tu ya reclamaste el el permio del Campeon";
    					close;
    				}
    				mes"toma toma tu premio";
    				getitem 40300,1;
    				set #CAMPEON , #CAMPEON + 1;
    				close;
    			}
    			
    			case 2:
    			if(!.@value){
    				mes "Not ranking at moment";
    				close;
    			}
    			mes " ";
    			for(.@i=0;.@i<getarraysize(.@value);.@i++)
    				mes (.@i+1)+"°/ "+.@rpname$[.@i]+", "+.@value[.@i]+"";
    			close;
    			
    			case 3:
    			mes "Ok, nos vemos";
                close;
    		}
    	}
    	end;
    	
    	OnInit:
        bindatcmd "campeon", strnpcinfo(0)+"::OnCampeon",60,60;
    	end;
    }

    I have not tested.

  3. 13 hours ago, Kawacito said:

    ready now if it works perfectly, a small detail for everyone to know in the insert part says: instead name replace by char_name since when creating the tables it is created as char_name and not as name, other than that it works perfectly!

    Strange.

    Search for:

    query_sql "INSERT INTO JM_MVPTR (name, value, date) VALUES ('"+escape_sql(.@mkname$)+"', 1, NOW()) ON DUPLICATE KEY UPDATE value = value + 1, date = NOW()";

    And replace it with:

    query_sql "INSERT INTO JM_MVPTR (char_name, value, date) VALUES ('"+escape_sql(.@mkname$)+"', 1, NOW()) ON DUPLICATE KEY UPDATE value = value + 1, date = NOW()";

     

    1 hour ago, Kawacito said:

    I have a small question, the event is held every 2 hours, how do I reset the points each time the event is entered?

    I thought you wanted a new script. You would have to send your complete script to understand.
    the one I sent you just counts kills on Boss type monsters everywhere in the game, and inserts the information in SQL to a query on the npc you specified to me, apparently you need it to be counting only in one event. Upload your complete script.

  4. -	script	JM_MVPCP	FAKE_NPC,{
    	
    	OnNPCKillEvent:
    	if(getmonsterinfo(killedrid,MOB_MVPEXP)){
    		.@mkname$ = strcharinfo(0);
    		query_sql "INSERT INTO JM_MVPTR (name, value, date) VALUES ('"+escape_sql(.@mkname$)+"', 1, NOW()) ON DUPLICATE KEY UPDATE value = value + 1, date = NOW()";
    		dispbottom "You gained 1 point for killing an MvP.";
    	}
    	end;
    }
    -	script	JM_MVPTR	FAKE_NPC,{
    	
    	.@npcname$ = "[ TOP MvP ]";
    	query_sql "SELECT name, value FROM JM_MVPTR ORDER BY value DESC, date DESC LIMIT 1",.@rpname$,.@value;
    	mes .@npcname$,
    	" ";
    	if(.@value){
    		mes "Player: "+.@rpname$,
    		(.@value>1? "Points: ":"Point: ")+.@value;
    		close;
    	} else {
    		mes "There is no top MVP at the moment.";
    		close;
    	}
    	end;
    	
    	OnInit:
    	query_sql "CREATE TABLE IF NOT EXISTS JM_MVPTR (char_name VARCHAR(50) UNIQUE, value FLOAT, date DATETIME)";
    	end;
    }
    prontera,100,100,4	duplicate(JM_MVPTR)	TOP MvP#prt	565

    Remove everything I asked you to add and add the one above.

    See if it works correctly.

    Try using smaller text fonts here in rAthena. It doesn't look good on my screen.

  5. -	script	JM_MVPTR	FAKE_NPC,{
    	
    	.@npcname$ = "[ TOP MvP ]";
    	query_sql "SELECT name, value, date FROM JM_MVPTR ORDER BY value DESC, date DESC LIMIT 1",.@rpname$,.@value;
      	mes .@npcname$;
    	if(.@value){
    		mes "Player: "+.@rpname$,
    		(.@value>1? "Points ":"Point: ")+.@value;
    		close;
    	} else {
    		mes "There is no top MVP at the moment.";
    		close;
    	}
    	end;
    	
    	OnInit:
    	query_sql "CREATE TABLE IF NOT EXISTS JM_MVPTR (char_name VARCHAR(50) UNIQUE, value FLOAT, date DATETIME)";
    	end;
    }
    prontera,100,100,4	duplicate(JM_MVPTR)	TOP MvP#prt	565

     

    I think there's an issue with #HEROPOINT; it belongs to the account, and there are multiple characters in the account. I wrote this script quickly, so it's good to test it as I'm not sure if it will work correctly. The SQL table will be imported automatically once the NPC is added to the game.

    Below is what you should add in place of #HEROPOINTS:

    .@mkname$ = strcharinfo(0);
    query_sql "INSERT INTO JM_MVPTR (name, value, date) VALUES ('"+scape_sql(.@mkname$)+"', 1, NOW()) ON DUPLICATE KEY UPDATE value = value + 1, date = NOW()";

    That English was from a correction tool, haha. If you need anything, just let me know

  6. Could someone give me a little help here?

    I manage to make the rune equip in the last slot, and also replace it if there is already a rune there, however when the other common slots are already occupied, it doesn't even open the window to insert a rune, or replace the current one.

     

    itemdb.hpp

    Quote

    #define itemdb_isenchant(i) (i >= 4700 && i <= 4999)

    pc.cpp

    Quote

    int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
    {
        nullpo_ret(sd);

        if (idx_equip < 0 || idx_equip >= MAX_INVENTORY) {
            return 0;
        }
        if (idx_card < 0 || idx_card >= MAX_INVENTORY) {
            return 0;
        }

        int i;
        t_itemid nameid;
        struct item_data* item_eq = sd->inventory_data[idx_equip];
        struct item_data* item_card = sd->inventory_data[idx_card];

        if(item_eq == nullptr)
            return 0; //Invalid item index.
        if(item_card == nullptr)
            return 0; //Invalid card index.
        if( sd->inventory.u.items_inventory[idx_equip].nameid == 0 || sd->inventory.u.items_inventory[idx_equip].amount < 1 )
            return 0; // target item missing
        if( sd->inventory.u.items_inventory[idx_card].nameid == 0 || sd->inventory.u.items_inventory[idx_card].amount < 1 )
            return 0; // target card missing
        if( item_eq->type != IT_WEAPON && item_eq->type != IT_ARMOR )
            return 0; // only weapons and armor are allowed
        if( item_card->type != IT_CARD )
            return 0; // must be a card
        if( sd->inventory.u.items_inventory[idx_equip].identify == 0 )
            return 0; // target must be identified
        if( itemdb_isspecial(sd->inventory.u.items_inventory[idx_equip].card[0]) )
            return 0; // card slots reserved for other purposes
        if( (item_eq->equip & item_card->equip) == 0 )
            return 0; // card cannot be compounded on this item type
        if( itemdb_isenchant(sd->inventory.u.items_inventory[idx_card].nameid) && item_eq->slots > 3 )
            return 0; // Reserved slot for Enchant is a normal slot
        if( item_eq->type == IT_WEAPON && item_card->equip == EQP_SHIELD )
            return 0; // attempted to place shield card on left-hand weapon.
        if( item_eq->type == IT_ARMOR && (item_card->equip & EQP_ACC) && ((item_card->equip & EQP_ACC) != EQP_ACC) && ((item_eq->equip & EQP_ACC) != (item_card->equip & EQP_ACC)) )
            return 0; // specific accessory-card can only be inserted to specific accessory.
        if( sd->inventory.u.items_inventory[idx_equip].equip != 0 )
            return 0; // item must be unequipped

        // remember the card id to insert
        nameid = sd->inventory.u.items_inventory[idx_card].nameid;

        if( itemdb_isenchant(nameid) ){
            i = 3; // Enchant Slot - Can overwrite current enchant
        }
        else {
            ARR_FIND( 0, item_eq->slots, i, sd->inventory.u.items_inventory[idx_equip].card[i] == 0 );
            if( i == item_eq->slots )
                return 0; // no free slots
        }

        if( pc_delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 )
        {// failed
            clif_insert_card(sd,idx_equip,idx_card,1);
        }
        else
        {// success
            log_pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->inventory.u.items_inventory[idx_equip]);
            sd->inventory.u.items_inventory[idx_equip].card[i] = nameid;
            log_pick_pc(sd, LOG_TYPE_OTHER,  1, &sd->inventory.u.items_inventory[idx_equip]);
            clif_insert_card(sd,idx_equip,idx_card,0);
            if( itemdb_isenchant(nameid) ){
                clif_delitem(sd,idx_equip,1,3);
                clif_additem(sd,idx_equip,1,0);
            }
        }
        
        return 0;
    }

     

  7. It depends. I have the same problem here, but when I move the grf to my game folder and indicate it in the .INI it runs, unlike some hexeds that run with the grf in any directory. Maybe thats your problem.

    At first I thought it was a problem with Windows, missing some files, and maybe it is, but the solution was very simple, it only took me a while to realize.

  8. -	script	test#1	FAKE_NPC,{
    	
    	OnTest:
    	.@name$ = "Mahiro";
    	callfunc ("carnage_winner", .@name$);
    	end;
    	
    	OnInit:
    	bindatcmd "test",strnpcinfo(3)+"::OnTest",0;
    	end;
    }
    function	script	carnage_winner	{
    	if(isloggedin(getcharid(3, getarg(0)))){
    		announce "Online",8;
    	} else {
    		announce "Offline",8;
    	}
    	return;
    }

    The error is similar to this topic(

    ). I've redone it several times but I keep getting the error.

    It should show an offline ad and no error.

    [Error]: buildin_getcharid: Player with nick 'Kappacitado' is not found.

  9. in all that I enter I am disconnected and/or the permanent screen is locked, and no command works, after some time it is informed that I am AFK.

    ¹ I get the icon that I'm the leader but I'm not screened for the map in question, I'm still on the map I was on. After some time it is informed that I will be kicked for being AFK, and I'm still stuck and on the same screen. Nothing works before and after.

    There are no errors in the log.

    ² I used @goto to see if the locked character went to the event map, and yes he did, but he is not there visibly, he literally disappears visually.

    ³ rAthena downloaded this month.

    jTN3zws.png 

  10. 58 minutes ago, JoseRicart said:

    Still the same, i add an image,

     

    Red Reference means i killed an MvP = Drop coin and announce it

    Green referente means i killed poring = drop coin no announce it

    drop2.png

     this?

    Spoiler

    OnNPCKillEvent:
        .@it = 607;
        if(getmonsterinfo(killedrid,MOB_MVPEXP)){
            announce strcharinfo(0)+" killed "+getmonsterinfo(killedrid,MOB_NAME)+" get "+getitemname(.@it),bc_all,0x00FF00;
            getitem .@it,1;
        }
        end;

     

    • Upvote 2
  11. 4 hours ago, IsabelaFernandez said:
      Hide contents

    babythirdclass:
        .@eac = eaclass();
        .@to_class = roclass(.@eac|EAJL_THIRD|EAJL_BABY);
        if(.@to_class >= 0)
            changebase .@to_class;

    f(BaseJob == Job_Blacksmith){ .@to_class = 4100; } // here

    if(BaseJob == Job_Alchemist){ .@to_class = 4107; } // here

        else
            mes "[Suit Provider]", "I'm sorry, but your class is not supported.";
        close;

    like this?

    Quote

    babythirdclass:
        if(BaseJob == Job_Blacksmith){ .@to_class = 4100; } // here
        if(BaseJob == Job_Alchemist){ .@to_class = 4107; } // here
        if(.@to_class >= 0)
            changebase .@to_class;
        else
            mes "[Suit Provider]", "I'm sorry, but your class is not supported.";
        close;

     

     

    4 hours ago, IsabelaFernandez said:

    ok, it worked thanks. but a question for classes that have two names for example Assassin Cross, High Wizard I type without space?

    Job_Wizard and Job_Assassin

    what comes after is already identified, unless you want to specify then use _.

  12. there are four variables that have not been set

    Spoiler

    function    script    specialbox    {
        setarray .i1[0],909,910; // Common Items
        set .i1rand,rand(0,1); // Randomize Common Items; just change max amount if you add items
        setarray .i2[0],911,912; // Rare Items
        set .i2rand,rand(0,1); // Randomize Rare Items; just change max amount if you add items
        setarray .i3[0],2199,1599; // Super Rare Items
        set .i3rand,rand(0,1); //Randomize Super Rare Items; just change max amount if you add items
        set .chance, rand(100);

            // Super Rare Item 1%
            if (.chance == 50){
            getitem .i3[.i3rand],1;
            announce "["+strcharinfo(0)+"] won a ["+getitemname(.i3[.i3rand])+"] from the Special Box.",0;
            end;
            } 

            // Rare Item 10%
            else if (.chance <= 2 && .chance >= 11){
            getitem .i2[.i2rand],1;
            announce "["+strcharinfo(0)+"] won a ["+getitemname(.i2[.i2rand])+"] from the Special Box.",0;
            end;
            } 

            // Common Items
            else {
            getitem .i1[.i1rand],1;
            end; }
    }

     

  13. 13 hours ago, IsabelaFernandez said:

    could you give an example of any class for me to copy and apply to all the others?

    f(BaseJob == Job_Blacksmith){ .@to_class = 4100; } // here

    if(BaseJob == Job_Alchemist){ .@to_class = 4107; } // here

     

    in red job name, and in blue baby 3rd class id.

    The line is the same just copy one of them and repeat below until the desired result.

  14. In this case you need to do similar to the case above:

    Spoiler

        if(BaseJob == Job_Blacksmith){ .@to_class = 4100; } // here
        if(BaseJob == Job_Alchemist){ .@to_class = 4107; } // here
        if(.@to_class >= 0)
            changebase .@to_class;
        else
            mes "[Suit Provider]", "I'm sorry, but your class is not supported.";
        close;

    you need to identify the ID of the baby you want and repeat the process.

  15. I didnt quite understand some things, but I believe this is it.

    Quote

    //####################################################
    //#                              ™ #
    //#   ####### ######  ###   ### ###   ### ###   ###  #
    //#   ###    ###  ###  ### ###   ### ###   ### ###   #
    //#   #####  ###  ###   ####      ####      #####    #
    //#   ##     ###  ###  ### ###   ### ###     ###     #
    //#   ##      ######  ###   ### ###   ###   ###      #
    //#                                                  #
    //####################################################
    //v1.0: Allows changing suits to 3rd classes;        #
    //v1.1: Added Xmas and Summer suits;                 #
    //v1.2: Added support to baby 3rd class suits.       #
    //####################################################
    que_temsky,49,133,5    script    Class Suits    485,{

    OnCommand:

        if(!vip_status(VIP_STATUS_ACTIVE)) {
            message strcharinfo(0),"This service is only avaiaible to VIP players.";
            end;
        }
        
        mes "[^00FF00Acesso VIP^000000]";
        mes "Então, deseja mudar sua aparência?";
        menu "Mudar para aparência 3rd.",thirdclass,"Mudar para aparência 3rd baby.",babythirdclass,"Second class",secondclass,"Voltar para o normal.",reset;

    thirdclass:
        .@eac = eaclass();
        if(.@eac == 10){
            .@to_class = (Sex? 4211:4212);
        } else
            if(.@eac == 9) .@to_class = 4215;
        else
        .@to_class = roclass(.@eac|EAJL_THIRD);
        if(.@to_class >= 0)
            changebase .@to_class;
        else
            mes "[Suit Provider]", "I'm sorry, but your class is not supported.";
        close;

    babythirdclass:
        .@eac = eaclass();
        .@to_class = roclass(.@eac|EAJL_2_1|EAJL_THIRD|EAJL_BABY);
        if(.@to_class >= 0)
            changebase .@to_class;
        else
            mes "[Suit Provider]", "I'm sorry, but your class is not supported.";
        close;

    secondclass:

        .@eac = eaclass();
        if(Upper)
            .@to_class = roclass(.@eac&EAJ_UPPERMASK);
        else
            .@to_class = roclass(.@eac|JOBL_2_1);
        if(.@to_class >= 0)
            changebase .@to_class;
        else
            mes "[Suit Provider]", "I'm sorry, but your class is not supported.";
        close;

    reset:
        changebase Class;
        close;

    miscsuits:
        next;
        mes "[Suit Provider]";
        mes "Which of the suits would you like to use?";
        menu "Xmas suit",xmas,"Summer suit",summer;

    xmas:
        changebase 26;
        close;

    summer:
        changebase 27;
        close;

    OnInit:

        bindatcmd "visual","Class Suits::OnCommand";
        end;

    }
     

     

×
×
  • Create New...