Jump to content

emundus

Members
  • Posts

    37
  • Joined

  • Last visited

Posts posted by emundus

  1. On 8/1/2024 at 12:08 PM, Yukaiii said:

    Hey guys!!
    Can anyone tell me if I can add the @quest command to my emulator?
    I'm asking this question because it's an old emulator that I'm working on.

    eAthena eamod

    I've even tried some bindatcmd commands, but without success, nothing happens.

     

    I was trying with this script.

     

     

    Thank you in advance if anyone can help me with this.

    what is happening when you use @quest?

  2. I made a basic script just to show you how it works, here is YOUR updated script and attachment showing how it works:

    image.png.68004599ab08cdb3c56469d1c0198fb8.png

     

    lhz_dun03,239,78,4    script    Bio Entrance    651,{
    function F_Warp;
    
        if (countitem(4359) > 0) goto case_1;
        end;
    
    case_1:
        //F_Warp("<map>",<x>,<y>,<item 1 ID>,<item 1 amount>{,<item 2 ID>,<item 2 amount>{...}}
        F_Warp("lhz_dun04",244,61,4359,5,4357,5,4367,5,4365,5,4363,5,4361,5);
        end;
    
        function    F_Warp    {
            .@map$ = getarg(0,"");
            .@x = getarg(1,0);
            .@y = getarg(2,0);
    
            //This loop fills a array with all the needed items
            for(.@i = 3; .@i < getargcount(); .@i += 2) {
                .@items[.@i2] = getarg(.@i);
                .@amount[.@i2] = getarg(.@i + 1);
                .@i2++;
            }
    
            //This loop checks for each item needed
            for (.@i = 0; .@i < getarraysize(.@items); .@i++) {
                if (countitem(.@items[.@i]) < .@amount[.@i]) {
                    if (!.@header) {
                        mes "I don't have enough items to use this warp..";
                        mes "I still need: "+mesitemlink(.@items[.@i])+"^FF0000"+countitem(.@items[.@i])+"^000000/^27FF00"+.@amount[.@i]+"^000000.";
                        .@header = true; 
                    }
                    mes .@amount[.@i] + " " + mesitemlink(.@items[.@i]);
                    .@missing = true;
                }
            }
            if (.@missing) return;
    
            //This loop removes each item needed
            for (.@i = 0; .@i < getarraysize(.@items); .@i++)
                delitem .@items[.@i], .@amount[.@i];
    
            warp .@map$, .@x, .@y;
            return;
        }
    }

     

  3. On 8/8/2024 at 9:01 AM, GoldRoger said:

    this one i just put at the last of script line?

    how to make that npc highlight item already have..example poring card required 3..but i have 2 pcs..that npc highlight with red color on 2pcs not enough requirement

    sir..sorry for make trouble
     

    You can use an "if" condition checking if the player has the specific amount of items, if he doesn't he shows the name of the item in red, if he does he shows it in green. If you don't know how to use colors in NPCs, here's an example:

    "[^03fc0fAlekinho^000000]";

    ^hexColor<name of npc>^000000

  4. On 6/14/2024 at 1:29 PM, Louis T Steinhil said:

    script

    -	script	RateSelect	-1,{
    
    OnPCLoginEvent:
    		switch (individual_rate) {
    			case 1:
    				.@exp_rate_multiplier = 100;
    				.@jexp_rate_multiplier = 100;
    				set .@rate_description$, "x1 (Low Rate)";
    				break;
    			case 2:
    				.@exp_rate_multiplier = 2500;
    				.@jexp_rate_multiplier = 2500;
    				set .@rate_description$, "x25 (Mid Rate)";
    				break;
    			case 3:
    				.@exp_rate_multiplier = 5000;
    				.@jexp_rate_multiplier = 5000;
    				set .@rate_description$, "x50 (High Rate)";
    				break;
    			case 4:
    				.@exp_rate_multiplier = 10000;
    				.@jexp_rate_multiplier = 10000;
    				set .@rate_description$, "x100 (Super High Rate)";
    				break;
    			default:
    				mes "[Rate Selector]";
    				mes "Select your preferred server rate for this character.";
    				mes "BE CAREFUL: YOU CAN'T CHANGE IT AFTERWARD!";
    				individual_rate = select("Low Rate:Mid Rate:High Rate:Super High Rate");
    			close2;
    			goto OnPCLoginEvent; // Return to case evaluation after selection
    		}
    		
    	// Save the multipliers to the player variables
    	set #exp_rate_multiplier, .@exp_rate_multiplier;
    	set #jexp_rate_multiplier, .@jexp_rate_multiplier;
    	fakeIcon(getcharid(0),2002,0,1);
    	dispbottom "You have chosen the " + .@rate_description$ + " for your character.";
    	end;
    
    OnNPCKillEvent:
    	// Retrieve the stored multipliers
    	.@exp_rate_multiplier = #exp_rate_multiplier;
    	.@jexp_rate_multiplier = #jexp_rate_multiplier;
    
    	.@base_exp = getmonsterinfo(killedrid, MOB_BASEEXP) * .@exp_rate_multiplier;
    	.@job_exp = getmonsterinfo(killedrid, MOB_JOBEXP) * .@jexp_rate_multiplier;
    
    	// Debug messages to track values
    	dispbottom "[Debug] Base EXP: " + .@base_exp;
    	dispbottom "[Debug] Job EXP: " + .@job_exp;
    
    	if (.@base_exp > 0 || .@job_exp > 0) {
    		// Use getcharid(0) to specify the character ID
    		getexp2(.@base_exp, .@job_exp);
    	} else {
    		dispbottom "[Error] Experience values are zero.";
    	}
    	end;
    }

    stateiconinfo.lub

    StateIconList[EFST_IDs.EFST_RATE_UP] = {
        haveTimeLimit = 1,
        posTimeLimitStr = 2,
        descript = {
            { "RATE UP", COLOR_TITLE_BUFF },
    		{ "%s", COLOR_TIME },
            { "Increases your Bonus EXP and Job Exp" },
            { "x1 / x25 / x50 / x100" },
    		{ "Grants players different rewards" },
    		{ "depending on what they choose." }
        }
        
    }

    efstids.lub

    	EFST_VIPSTATE1 = 2000,
    	EFST_VIPSTATE2 = 2001,
    	EFST_RATE_UP = 2002,	
    	__newindex = function()
    	error("unknown state")
    end
    }
    setmetatable(EFST_IDs, EFST_IDs)

    stateiconimginfo.lub

    		-- Other official effects
    		[EFST_IDs.EFST_VIPSTATE1] = "SI_VIP.tga",
    		[EFST_IDs.EFST_VIPSTATE2] = "SI_VIP2.tga",		
    		[EFST_IDs.EFST_RATE_UP] = "RATE_UP.tga",
    		[EFST_IDs.EFST_YGGDRASIL_BLESS] = "vitata500.tga",
    		[EFST_IDs.EFST_PERIOD_RECEIVEITEM_2ND] = "ITEM_G.tga",
    		[EFST_IDs.EFST_PERIOD_PLUSEXP_2ND] = "EXP_G.tga"
    
    	}
    }

    status.hpp

    /// @APIHOOK_END
    /// Do not modify code above this, since it will be automatically generated by the API again
    	EFST_VIPSTATE1 = 2000,
    	EFST_VIPSTATE2 = 2001,
    	EFST_RATE_UP = 2002,
    	EFST_MAX,

    script_constants.hpp

    /// @APIHOOK_END
    /// Do not modify code above this, since it will be automatically generated by the API again
    	export_constant(EFST_VIPSTATE1);
    	export_constant(EFST_VIPSTATE2);
    	export_constant(EFST_RATE_UP);	
    	export_constant(EFST_MAX);

    Install fakeicon:

    https://rathena.org/board/files/file/4034-fake-icon-stats/

    RATE_UP.tga 4.04 kB · 3 downloads

    image.thumb.png.52e5e81b6e6d7cd71c23b31a760d6dd5.png

    RATE_UP.tga 4.04 kB · 4 downloads

    I created 2 characters, one selecting 1x and the other 100x, in the chat debug it shows that more exp came but they have the same experience after killing the same amount of porings.

     

    Edit:

    I forgot the "multi_level_up: yes" xD Thanks ❤️

  5. When in doubt about which rate to keep on the server, I ended up creating a command for GMs to change the server rates and announce the rates to everyone if changed.

    Note: the language is in Brazilian Portuguese, feel free to modify the texts to your language.

    The script working:

    !!Don't forget to add the folder into "rAthena/npc/scripts_custom.conf"!!

    changerates.txt

    • Upvote 2
    • Love 2
  6. On 9/19/2012 at 3:05 PM, goddameit said:

    File Name: @AutoAttack
    File Submitter: goddameit
    File Submitted: 13 Sep 2012
    File Category: Source Modifications
    Content Author: Goddameit

    Idea : http://rathena.org/b...k-close-enemys/

    Preview :

     

     


    Use this command you can turn on or off auto-attack.

    It will auto-search 9x9 and attack the near one

    if there is no monster in area, you will auto-walk randomly.

    Click here to download this file

    @AutoAttack.patch

     

     

    Important Note : #31 #32

    Is working in the latest rAthena?

  7. I would like to request a "rate selector", which would be Low Rates, Mid Rates and High Rates (I would like to customize the values, if possible).
    I would also like some help with installation, thanks in advance!


    How it would work: when entering the character for the first time, the person chooses the rates they want to play and there is a "buff" showing the selected rates (or a command like @myrates).

  8. 38 minutes ago, emundus said:

    Can you help me to create a code for a command (@myrates) showing the selected rates?

    I thought about, when selecting the rates, saving a variable in the character (char_reg_num) specifying the chosen rates and then showing it in the command @myrates...

    I ended up creating the command with the values manually, thanks for the support @Winterfox!

  9. 1 hour ago, Winterfox said:

    1. I don't know how the status changes accumulate if you stack them. But I think it isn't hard for you to test that, simply choose a rate and use an item like bubble gum and check how it influences your rate.
    2. If your server is configured to have the default rates, those would be 1x, when a player chooses low it would add a bonus of 200% so 2x, on mid 2000% or 20x etc.

    It is good that you asked, since I realized I made a mistake in the script above and could correct it.

    the item buffs do not add up to the script buff

  10. -	script	RateSelect	-1,{
    	OnSetRate:
    	OnPCLoginEvent:
    		switch(individual_rate) {
    			case 1:
    				.@exp_rate_bonus = .low_rate_exp_bonus;
    				.@drop_rate_bonus = .low_rate_drop_bonus;
    				break;
    			case 2:
    				.@exp_rate_bonus = .mid_rate_exp_bonus;
    				.@drop_rate_bonus = .mid_rate_drop_bonus;
    				break;
    			case 3:
    				.@exp_rate_bonus = .high_rate_exp_bonus;
    				.@drop_rate_bonus = .high_rate_drop_bonus;
    				break;
    			default:
    				mes "Selecione suas rates preferidas para este personagem.";
    				mes "TENHA CUIDADO: VOCÊ NÃO PODE MUDAR DEPOIS!";
    				mes "[Rates EXP/Drop %]";
    				mes "- Low Rates:" + .low_rate_exp_bonus + ", " + .low_rate_drop_bonus + ".";
    				mes "- Mid Rates:" + .mid_rate_exp_bonus + ", " + .mid_rate_drop_bonus + ".";
    				mes "- High Rates:" + .high_rate_exp_bonus + ", " + .high_rate_drop_bonus + ".";
    				individual_rate = select("- Low Rate:- Mid Rate:- High Rate");
    				close2;
    				goto OnSetRate;
    		}
    
    		sc_start SC_EXPBOOST, INFINITE_TICK, .@exp_rate_bonus;
    		sc_start SC_ITEMBOOST, INFINITE_TICK, .@drop_rate_bonus;
    	end;
    
    	OnInit:
    		.low_rate_exp_bonus = 200;
    		.mid_rate_exp_bonus = 2000;
    		.high_rate_exp_bonus = 20000;
    
    		.low_rate_drop_bonus = 200;
    		.mid_rate_drop_bonus = 2000;
    		.high_rate_drop_bonus = 20000;
    }

    I translated it into my language and added the information on rates, would the code be like this?

  11. 3 minutes ago, Winterfox said:

    1. I don't know how the status changes accumulate if you stack them. But i think it isn't hard for you to test that, simply choose a rate and use an item like bubble gum and check how it influences your rate.
    2. If your server is configured to have the default rates those would be 1x, when a player chooses low it would add a bonus of 200% so 2x, on mid 2000% or 20x etc.

    Thank you so much, I will test and leave a feedback 😉

  12. On 2/25/2024 at 8:50 AM, Winterfox said:

    It won't influence the individual rates. What he provides is more or less just a poll.

    I think there is no direct way to overwrite rates directly for an individual player.

    But what you could do is set the rates of your server to default and use status changes to give each player an exp and drop bonus according to his choice to basically get the effect of different rates.
     

    -	script	RateSelect	-1,{
    	OnSetRate:
    	OnPCLoginEvent:
    		switch(individual_rate) {
    			case 1:
    				.@exp_rate_bonus = .low_rate_exp_bonus;
    				.@drop_rate_bonus = .low_rate_drop_bonus;
    				break;
    			case 2:
    				.@exp_rate_bonus = .mid_rate_exp_bonus;
    				.@drop_rate_bonus = .mid_rate_drop_bonus;
    				break;
    			case 3:
    				.@exp_rate_bonus = .high_rate_exp_bonus;
    				.@drop_rate_bonus = .high_rate_drop_bonus;
    				break;
    			default:
    				mes "Select your preferred server rate for this character.";
    				mes "BE CAREFUL: YOU CAN'T CHANGE IT AFTERWARD!"
    				individual_rate = select("Low Rate:Mid Rate:High Rate");
    				close2;
    				goto OnSetRate;
    		}
    
    		sc_start SC_EXPBOOST, INFINITE_TICK, .@exp_rate_bonus;
    		sc_start SC_ITEMBOOST, INFINITE_TICK, .@drop_rate_bonus;
    	end;
    
    	OnInit:
    		.low_rate_exp_bonus = 2;
    		.mid_rate_exp_bonus = 20;
    		.high_rate_exp_bonus = 200;
    
    		.low_rate_drop_bonus = 2;
    		.mid_rate_drop_bonus = 20;
    		.high_rate_drop_bonus = 200;
    }

     

    I would like to thank you very much for the support provided, could you answer some questions regarding the script?
    1. Are other boost items applicable separately or do they accumulate with the script boosts?
    2. is the rate based on, for example, 2x 20x and 200x?

    Thanks 😄

  13. On 5/15/2023 at 12:10 AM, ryzenthird said:

    Try this

     

    -	script	SelectRate	-1,{
    
    OnPCLoginEvent:
    	if(!server_preferred_rate){
    		mes "Select Your Preferred Server Rates";
    		switch(select("High Rate:Mid Rate:Low Rate")){
    			case 1:
    				mes "Thank you for choosing!";
    				set server_preferred_rate,1;
    				close;
    			case 2:
    				mes "Thank you for Choosing!";
    				set server_preferred_rate,2;
    				close;
    			case 3:
    				mes "Thank you for Choosing!";
    				set server_preferred_rate,3;
    				close
    			default:
    				mes "Please relogin to choose!";
    				close;
    		}	
    	}
    
    OnShowStatistics:
    	query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 1",.@highratecount);
    	query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 2",.@midratecount);
    	query_sql("SELECT COUNT(*) FROM char_reg_num WHERE `key` = 'server_preferred_rate' AND `value` = 3",.@lowratecount);
    	mes "This is the current statistics";
    	mes "High Rate Count : ("+.@highratecount+")";
    	mes "Mid Rate : ("+.@midratecount+")";
    	mes "Low Rate : ("+.@lowratecount+")";
    	close;
    
    OnInit:
    	bindatcmd("showstatistics",strnpcinfo(3)+"::OnShowStatistics",99,99);
    	end;
    	
    }

     

    Thank you, I had some personal problems and couldn't see the answer..
    I have a question: how will this influence that character's rates on the server?

  14. Looking for a solution to my problem, I ended up generating the solution to yours:

    // Criado por Alek Emundus
    // comando @loja
    // abre a lojinha básica para vender/comprar itens
    
    -	shop	ComandoShop	-1,506:-1,501:-1,502:-1,503:-1,504:-1,525:-1,601:-1,602:-1,1065:-1,645:-1,656:-1,657:-1,610:-1,713:-1
    
    -	script	ShopComando	-1,{
    	OnInit:
    		bindatcmd "loja",strnpcinfo(3) + "::OnAtcommand";
    		end;
    	OnAtcommand:
    		callshop "ComandoShop";
    		end;
    }

    I hope it helps! 😉

×
×
  • Create New...