Jump to content

Hyroshima

Members
  • Posts

    163
  • Joined

  • Last visited

  • Days Won

    8

Posts posted by Hyroshima

  1. ^^

    script_commands.txt (/map/script.cpp)

    *itemskill <skill id>,<skill level>{,<keep requirement>};
    *itemskill "<skill name>",<skill level>{,<keep requirement>};
    
    This command is meant for item scripts to replicate single-use skills in usable
    items. It will not work properly if there is a visible dialog window or menu.
    If the skill is self or auto-targeting, it will be used immediately; otherwise a
    target cursor is shown.
    
    If <keep requirement> parameter is set to true, the skill's requirements will be checked.
    By default, the requirements for item skills are not checked, and therefore the default value is false.
    
    // When Anodyne is used, it will cast Endure (8), Level 1, as if the actual
    // skill has been used from skill tree.
    605,Anodyne,Anodyne,11,2000,0,100,,,,,10477567,2,,,,,{ itemskill 8,1; },{}
    
    // When Sienna_Execrate_Scroll_1_5 is used, it will cast Sienna Execrate Level 5 and consume 2 Red_Gemstones.
    23194,Sienna_Execrate_Scroll_1_5,Level 5 Sienna Execrate,11,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "WL_SIENNAEXECRATE",5,true; },{},{}

     

  2. 14 hours ago, Emistry said:

    there exists another way for you, in case you afraid to mess up with the index value. 

    
    for (.@i = getarraysize(.@tmp_magic_shop) - 1; .@i >= 0; .@i--)
    	if(!.@tmp_magic_shop[.@i]) 
    		deletearray .@tmp_magic_shop[.@i],1;

    start looping from the end of the array to the front...

    OMG, I even thought of doing so, but I was tired and did not reasoned more kkkkk

    Thank you ^^

    I'm creating an interesting store, i do not know if it already exists, because I've never seen something similar.

    I have not been developing anything for a while, sometimes i get stuck in a small complex problem but looking at script_command.txt I'll reminding.

    Thanks again ^^

  3. 54 minutes ago, TARTs said:
    
    prontera,152,184,5	script	formNPCTemplate	54,{
    	.@tmp_magic_shop[0] = 0;
    	.@tmp_magic_shop[1] = 1;
    	.@tmp_magic_shop[2] = 1;
    	.@tmp_magic_shop[3] = 1;
    	dispbottom "Array Value Before: " + getarraysize(.@tmp_magic_shop) + "";
    	for(.@i = 0; .@i < getarraysize(.@tmp_magic_shop); .@i++)
    	dispbottom "" + .@tmp_magic_shop[.@i] + "";
    	L_DoItAgain:
    	for(.@i = 0; .@i < getarraysize(.@tmp_magic_shop); .@i++)
    	{ 
    		if(!.@tmp_magic_shop[.@i]){
    			deletearray .@tmp_magic_shop[.@i],1;
    			goto L_DoItAgain;
    		}
    	}
    	dispbottom "Array Value After: " + getarraysize(.@tmp_magic_shop) + "";
    	for(.@i = 0; .@i < getarraysize(.@tmp_magic_shop); .@i++)
    	dispbottom "" + .@tmp_magic_shop[.@i] + "";
    	end;
    }

     

    1234.JPG

    OMG, I forgot that deletearray moves the index.

     

    Thank you very much!!

  4. Hello guys, I'm having a problem which is making me confused. The situation is the deletion of null values of an array, however a null value remains...

    dispbottom "Array Value Before: "+getarraysize(.@tmp_magic_shop)+"";
    	for(set .@i,0; .@i<getarraysize(.@tmp_magic_shop); set .@i,.@i+1)
    	{ dispbottom ""+.@tmp_magic_shop[.@i]+""; }

    RTQAvlS.jpg

     

    Remove null values.

    for(set .@i,0; .@i<getarraysize(.@tmp_magic_shop); set .@i,.@i+1)
    	{ if(!.@tmp_magic_shop[.@i]) deletearray .@tmp_magic_shop[.@i],1; }

     

    dispbottom "Array Value After: "+getarraysize(.@tmp_magic_shop)+"";
    	for(set .@i,0; .@i<getarraysize(.@tmp_magic_shop); set .@i,.@i+1)
    	{ dispbottom ""+.@tmp_magic_shop[.@i]+""; }

     

    9mZRYjS.jpg

     

    OBS:

    deletearray .@tmp_magic_shop[0],1;  <- remove that value 0

    the confusion is why this value It's not removed like the others.

     

    Thank you since now!

  5. 1 hour ago, sader1992 said:
    
    https://github.com/rathena/rathena/blob/532e043490368eea038a1808a6b35bf7c4fa0e97/doc/script_commands.txt#L678
    
    % - will give you the remainder of the division. 7%2 is equal to 1.

     

    also do you mean out side of rathena ? why is this in general support section ?

    Sorry for posting in the wrong section, I'm a little crazy.?

    I forgot about this basic math question...

    Any value divided by 2 that has left over is odd

    Thank you!

    SOLVED!!

     

     

     

    Sorry, i edited and ended up doing another post '-'

  6. Hello again ?

    I was searching and there is nothing where I can check if a number is odd or pair.

    can not create a function to check because the number may or may not have a high value.

    Thank you to all who can help!

    By: Hyro~

  7. @sweetmole

    rdy:

    prontera,152,166,5	script	Quest KMob	4_M_02,{
    
    	if(mob_qt1)
    	{
    		if(QT_MobKill1 < mob_qt1 || QT_MobKill2 < mob_qt2 || QT_MobKill3 < mob_qt3 || QT_MobKill4 < mob_qt4 || QT_MobKill5 < mob_qt5)
    		{
    			mes "You have not completed the mission!";
    			mes "Kill: ["+QT_MobKill1+"/"+mob_qt1+"] "+strmobinfo(1,mob_id1)+"";
    			if(mob_qt2) mes "Kill: ["+QT_MobKill2+"/"+mob_qt2+"] "+strmobinfo(1,mob_id2)+"";
    			if(mob_qt3) mes "Kill: ["+QT_MobKill3+"/"+mob_qt3+"] "+strmobinfo(1,mob_id3)+"";
    			if(mob_qt4) mes "Kill: ["+QT_MobKill4+"/"+mob_qt4+"] "+strmobinfo(1,mob_id4)+"";
    			if(mob_qt5) mes "Kill: ["+QT_MobKill5+"/"+mob_qt5+"] "+strmobinfo(1,mob_id5)+"";
    			close;
    		}
    
    			mes "Congratulations, you completed the quest!";
    			atcommand "@aura 2";
    			set mob_id1,0;
    			set mob_qt1,0;
    			set mob_id2,0;
    			set mob_qt2,0;
    			set mob_id3,0;
    			set mob_qt3,0;
    			set mob_id4,0;
    			set mob_qt4,0;
    			set mob_id5,0;
    			set mob_qt5,0;
    			close;
    	}
    
    	mes "Hello, will I now ask you to kill some monsters for me ok?";
    	if(select("Ok:I do not want...")==2){ close; }
    	
    	next;	
    	
    	set mob_id1,1031;	//mob_id
    	set mob_qt1,50;		//Qty
    	set mob_id2,1002;	//mob_id
    	set mob_qt2,150;	//Qty
    	set mob_id3,1166;	//mob_id
    	set mob_qt3,200;	//Qty
    	set mob_id4,1784;	//mob_id
    	set mob_qt4,250;	//Qty
    	set mob_id5,1095;	//mob_id
    	set mob_qt5,300;	//Qty
    	
    	mes "Okay, go and kill:",
    	""+mob_qt1+"x "+strmobinfo(1,mob_id1)+"",
    	""+mob_qt2+"x "+strmobinfo(1,mob_id2)+"",
    	""+mob_qt3+"x "+strmobinfo(1,mob_id3)+"",
    	""+mob_qt4+"x "+strmobinfo(1,mob_id4)+"",
    	""+mob_qt5+"x "+strmobinfo(1,mob_id5)+"";
    	close;
    	
    OnNPCKillEvent:
    
    	if(killedrid == mob_id1){ set QT_MobKill1,QT_MobKill1+1; dispbottom "["+QT_MobKill1+"/"+mob_qt1+"] "+strmobinfo(1,mob_qt1)+""; }
    	if(killedrid == mob_id2){ set QT_MobKill2,QT_MobKill2+1; dispbottom "["+QT_MobKill2+"/"+mob_qt2+"] "+strmobinfo(1,mob_qt2)+""; }
    	if(killedrid == mob_id3){ set QT_MobKill3,QT_MobKill3+1; dispbottom "["+QT_MobKill3+"/"+mob_qt3+"] "+strmobinfo(1,mob_qt3)+""; }
    	if(killedrid == mob_id4){ set QT_MobKill4,QT_MobKill4+1; dispbottom "["+QT_MobKill4+"/"+mob_qt4+"] "+strmobinfo(1,mob_qt4)+""; }
    	if(killedrid == mob_id5){ set QT_MobKill5,QT_MobKill5+1; dispbottom "["+QT_MobKill5+"/"+mob_qt5+"] "+strmobinfo(1,mob_qt5)+""; }
    end;
    }

     

    • Love 1
  8. 29 minutes ago, AnnieRuru said:
    
    if(QP_Act && killedrid == .mob_id[QP_Val])

    I'm sure this condition is wrong

    if you use Comparisons conditions ( || == &&), it only return true(1) or false(0)

    since you want to make the condition to be true that is in the .mob_id array, you have to loop it

    but the question is this, if QP_Act equals 0, so stop, and if 1 then it checks killedrid == .mob_id [QP_Val]

    or should it be:

    if(QP_Act)
    {
    	if(killedrid == .mob_id[QP_Val])
    }

    ?

    • Like 1
  9. 6 hours ago, sweetmole said:

    hi everyone 

    can i request a simple script like this

    an npc that gives u a quest to kill 5 different mobs with 1000 qty. item requirements. once done the npc will set @aura to a player 

    Hi...

    prontera,152,166,5	script	Quest KMob	4_M_02,{
    		
    	if(QP_Act)
    	{
    		if(QT_MobKill < .mob_qt[QP_Val])
    		{ mes "You have not completed the mission!","Kill: ["+QT_MobKill+"/"+.mob_qt[QP_Val]+"] "+strmobinfo(1,.mob_id[QP_Val])+""; close; }
    
    		mes "Congratulations, you completed the quest!";
    		atcommand "@aura 2";
    		set QP_Act,0;
    		set QT_MobKill,0;
    		close;
    	}
    
    	mes "Hello, will I now ask you to kill some monsters for me ok?";
    	if(select("Ok:I do not want...")==2){ close; }
    	
    	next;	
    	
    	set QP_Val,rand(1,getarraysize(.mob_id))-1;	//Get a random mob_id
    	set QP_Act,1;
    	
    	mes "Okay, go and kill "+.mob_qt[QP_Val]+"x "+strmobinfo(1,.mob_id[QP_Val])+" !";
    	close;
    	
    OnNPCKillEvent:
    
    	if(QP_Act && killedrid == .mob_id[QP_Val]){ set QT_MobKill,QT_MobKill+1; }
    	end;
    	
    OnInit:
    	setarray .mob_id[0],1031,1002,1166,1784;	//Mob ID, limited (0,126) mobs_ids
    	setarray .mob_qt[0],   1,   2,   3,   5;	//Qty kills, limited (0,126) mobs_qty
    end;
    }

     

    • MVP 1
  10. 4 hours ago, Nitrous said:

    You add all of the numbers, and each item has a rate of number/sum.

    sum = 5 + 1 + 14 = 20

    Knife = 5 / 20 = 25%

    Dagger = 1 / 20 = 5%

    Jellopy = 14 / 20 = 70%

    Many thanks for responding ^^..

    Then, as you explained, did not have repeated numbers, I figured that's repeated values are indebted by of quantity the sum of rates in which it is repeated correctly?

    my example below, how I understood ...

    Quote

    1 selects all items in the category.
    2 sum all values in `rate`
    3 after obtaining the values above, each value in `rate` will be defined based on the total value of the sum of of rates,
     and then check each item to see what the value in% is worth of that item in relation to the total value of the sum of rates!


    box1
    {
        607,5
        608,1
        609,3
        610,5
        611,10
    }


    Exp1:

        picks up all items in (box1), total: 5

    Exp2:

        sum all rates in (box1), total: 24

    Exp3:

        then define the value that each item will have a chance:

    box1 (defined rate)
    {
        607 = 20,83%
        608 = 4,16%
        609 = 12,5%
        610 = 20,83%
        611 = 41,66%

        total percent: 99,98
        total percent rounded (above of ,5): 100 
    }

     

  11. 3 hours ago, AnnieRuru said:

    Ty...

    But I wanted to understand how it was done to have this rate in% of the examples?

    https://github.com/rathena/rathena/blob/master/doc/item_group.txt#L51

    Rate: Probability to get the item. Not a percentage value!
    
    Examples:
    	IG_MyItemGroup,Knife,5
    	IG_MyItemGroup,Dagger,1
    
    	- Knife has chance 5/6 (83.3%) to be obtained
    	- Dagger has chance 1/6 (16.7%) to be obtained

     

    I created a system in sql:

    5ac209956efe9_I1a1KzA1.jpg.f585823ca78631862f2ea5293f16dc5f.jpg

    • id (auto-increment)
    • item_id
    • item_qtd (amount)
    • rate (%)
    • cat (would be like the groupid, box ID.)

     

    But the system is basically basic rand (1,100)

    	set .@rate,rand(1,100);
    
    	query_sql "SELECT `item_id`,`item_qtd`,`rate` FROM `custom_box` WHERE `rate`>='"+.@rate+"' AND `cat`='"+getarg(0)+"' ORDER BY RAND() LIMIT 1",.@id,.@qtd,.@rt;
    	if(!.@id) query_sql "SELECT `item_id`,`item_qtd`,`rate` FROM `custom_box` WHERE `rate`='100' AND `cat`='"+getarg(0)+"' ORDER BY RAND() LIMIT 1",.@id,.@qtd,.@rt;
    
    	if(!.@id){ dispbottom "[ Custom Box ]: Houve um erro, por favor informe a um GM!"; end; }
    	getitem .@id,.@qtd;
    	end;

     

    the rand () method does not work well, so I would like to understand how the rate of the items added in a custom box works.

    Thank you in advance for your attention!

    By: Hyro~

  12. Hello, I would like to understand how the item box system works

    Ex:

    // Old Card Album Obtainable Items Database
    //
    // Structure of Database:
    // GroupID,ItemID,Rate
    
    IG_CardAlbum,4001,10	// Poring Card
    IG_CardAlbum,4002,10	// Fabre Card
    IG_CardAlbum,4003,6		// Pupa Card
    // Old Blue Box Obtainable Items Database
    //
    // Structure of Database:
    // GroupID,ItemID,Rate
    
    IG_BlueBox,501,12	// Red Potion
    IG_BlueBox,502,12	// Orange Potion
    IG_BlueBox,503,12	// Yellow Potion
    IG_BlueBox,504,12	// White Potion

    I would like to know which method is being used to calculate the rate or what it is based on.

    thank you, by Hyro~

  13. 5 hours ago, Sindit said:

    Então, cara, o erro está  aqui:

    
    "+.@qpname$[.@i]+"

     

    Quando você seleciona das tabelas dando apenas um argumento, ele não cria uma array.

    Tenta assim:

    
    query_sql "SELECT `account_id`,`MaxQPoints` FROM `login` WHERE `MaxQPoints` > '0' ORDER BY `MaxQPoints` DESC LIMIT 10",.@acid,.@maxqp;
    				
    				
    for(set .@i,0; .@i<getarraysize(.@acid); set .@i,.@i+1)
    {
    	query_sql "SELECT `name` FROM `char` WHERE `account_id`='"+.@acid[.@i]+"' AND `QP_CharPref`='1'",.@qpname$;
    	mes " [ "+(.@i+1)+"º ] "+.@qpname$+" ~ "+.@maxqp[.@i]+"";
    }
    				
    close;

     

     

    Nossa mano eu jurava que que a var era uma array, muito obrigado me ajudou bastante ^^.

  14. Boa tarde pessoal ^^, então estava adicionando um pequeno ranking (sugestão de um amigo) no sistema de quest que estou finalizando, porem o for() funciona e não ao mesmo tempo.

    query_sql "SELECT `account_id`,`MaxQPoints` FROM `login` WHERE `MaxQPoints` > '0' ORDER BY `MaxQPoints` DESC LIMIT 10",.@acid,.@maxqp;
    				
    				
    for(set .@i,0; .@i<getarraysize(.@acid); set .@i,.@i+1)
    {
    	query_sql "SELECT `name` FROM `char` WHERE `account_id`='"+.@acid[.@i]+"' AND `QP_CharPref`='1'",.@qpname$;
    	mes " [ "+(.@i+1)+"º ] "+.@qpname$[.@i]+" ~ "+.@maxqp[.@i]+"";
    }
    				
    close;

     

    O problema é o seguinte, tenho 2 registro como resultado do .@acid e .@maxqp, o problema é na hora de puxar o nome do char, puxa somente o primeiro, os seguintes só mostra o .@maxqp que é da query fora fo for(), mas a questão é q não mostra o nome mas mostra o valor que o char q não mostrou o nome tem.

     

    O real problema é essa query aqui que só está executando o valor de .@i uma vez:

     

    query_sql "SELECT `name` FROM `char` WHERE `account_id`='"+.@acid[.@i]+"' AND `QP_CharPref`='1'",.@qpname$;

     

    e o resultado é esse:

    D3aiFUS.jpg

     

    Como podem ver, o .@i funciona certinho até por quê a ordem de número aparecem normal.

     

    ex aqui as colunas:

    ALTER TABLE `char` ADD `QP_CharPref` INT(1) NOT NULL default '0';
    ALTER TABLE `login` ADD `MaxQPoints` INT(5) NOT NULL default '0';

    Obs: Fiquei um tempo parado então pode ser alguma coisa haver com lógica q estrou me atrapalhando xD

     

    Um amigo sugeriu o seguinte: 

    query_sql "SELECT `char`.`name`,`login`.`MaxQPoints` FROM `char` LEFT JOIN `login`  WHERE `char`.`QP_CharPref` = 1 AND `login`.`MaxQPoints` > 0 ORDER BY `login`.`MaxQPoints` DESC LIMIT 0,10",.@name$,.@value;
    query_sql "SELECT count(account_id) FROM `login` WHERE `MaxQPoints`>='1' LIMIT 0,10",.@count;
    for(set .@i,0; .@i< .@count; set .@i,.@i+1)
    {
    mes " [ "+(.@i+1)+"º ] "+.@name$[.@i]+" ~ "+.@value[.@i]+"";
    }
    close;
    end;

     

    Porem algo no join não está correto, tentei executar direto no phpmyadmin a parte do sql e deu o mesmo erro.

    wwx4SzL.jpg

     

    Se alguém poder explicar pq o meu método não está funcionando me ajudaria muito a compreender ^^, desde já grato Hyro!

  15. Hello, sorry to revive the topic... I'm using the latest eAthena rev, manually added without any problem...

    The only problem is that tombs do not disappear!

    598882b2d12b8_WhatsAppImage2017-08-07at10_03_32.jpeg.fa07ee47889a2db9b064c97e891acb74.jpeg

     

    Thank you in advance!

     

    @Edit:

    debug show:

    [07/Aug/2017 07:30][Warning]: npc_parsename: Duplicate unique name in file 'arse_mob: Unknown mob ID %d (file '%s', line '%d').
    ', line'1'. Renaming 'helpony@moc_pryd06' to '1_124_101_85'.
    [07/Aug/2017 07:30][Debug]: this npc:
       display name 'Tomb#1511|4039238'
       unique name 'helpony@moc_pryd06'
       map=moc_pryd06, x=101, y=85
    [07/Aug/2017 07:30][Debug]: other npc:
       display name 'Tomb#1511|3788501'
       unique name 'helpony@moc_pryd06'
       map=moc_pryd06, x=103, y=84

     

×
×
  • Create New...