Jump to content
  • 0
champzro

a little help with this NPC

Question

yO...

i made this script with a friend, and both can't find where we screw up...

script works fine until we go to give all items to NPC, and get back the quest item !!!
if we have all the required itens works fine, but...
if we don't have 1 item exemple : needs 500 id = 607, we have 499 id = 607  

the NPC remove all itens of the quest, and don't show any error !!!

there he is :
 

Quote

1@def02,30,38,4	script	Quests Viajante#Killik	4_M_YOUNGKNIGHT,{
Inicio:
//Insira as quests aqui --

setarray .@quest_0, 20854,1,0,660,150,734,200,990,400,975,30,7440,300,7447,300,7450,2,7444,50; //Red aura

setarray .@quest_1, 20723,1,0,7063,200,1038,200,7048,10,641,300,983,30,7019,30,7297,10; //Black phonix wing

setarray .@quest_2, 20795,1,0,7512,350,7507,350,7325,400,7315,250,7290,10,2255,3,4406,5,982,30; //skelletron

setarray .@quest_3, 20813,1,0,4105,30,720,100,984,500,7321,250,2254,5,7446,250,978,30; //Cavalo marinho wing

setarray .@quest_4, 20756,1,0,7507,250,995,300,7561,350,749,150,7319,400,978,15,982,15,7036,5; //Ice Metal wing

//Nome do NPC

set @nomedonpc$, "^B22222"+strnpcinfo(2)+"^000000";

//Configuração Status



//Interação do NPC

mes "["+@nomedonpc$+"]";

mes "Olá ^4682B4"+strcharinfo(0)+"^000000, sobre qual quest você quer saber mais?";

for(set .@i, 0; getd (".@quest_"+ .@i); set .@i, .@i + 1)

set .@menu$, .@menu$ + ""+ getitemname (getd (".@quest_"+.@i)) + ":";

set .@i, select(.@menu$) - 1;

set .@size, getarraysize (getd (".@quest_"+.@i));

next;
VoltaMenu:
mes "["+@nomedonpc$+"]";

mes "Você escolheu ^9400D3" + getitemname (getd (".@quest_"+.@i)) + "^000000, o que deseja fazer?";

switch(select("Trocar Item", "Ver Itens Necessários", "Ver Atributos", "Visualizar Item", "Escolher Outro Item", "Sair")) {

		case 1:
		
			next;
		
			mes "["+@nomedonpc$+"]";
			mes "Tem certeza?";
		
				switch (select ("Tenho sim.", "Ainda não.")){

					case 1:
					
					next;
						
						for (set .@j, 3; .@j < .@size; set .@j, .@j + 2)

						if(countitem (getd (".@quest_"+.@i+"["+.@j+"]")) < getd (".@quest_"+.@i+"["+(.@j+1)+"]") || Zeny < getd (".@quest_"+.@i+"[2]"))
						{
							if (rand(3) == 0)
							{
								mes "["+@nomedonpc$+"]";
								mes "Tá querendo me passar a perna, garot"+(Sex?"o":"a")+"? Sai fora! E só volte quando estiver com meus itens!";
							}
							else if (rand (3) == 1)
							{
								mes "["+@nomedonpc$+"]";
								mes "Você realmente acha que pode me enganar fácil assim? Sai daqui e vá buscar meus itens!";
							}
							else
							{
								mes "["+@nomedonpc$+"]";
								mes "Tentando conseguir um item valioso como esse sem dar nada em troca? Sai da minha frente e não volte sem os itens de troca!";
							}
							close;
						}
						else
						{
							for (set .@j, 3 ; .@j<.@size ; set .@j, .@j+2)

							delitem getd (".@quest_"+.@i+"["+.@j+"]"), getd (".@quest_"+.@i+"["+(.@j+1)+"]");
							getitem getd (".@quest_"+.@i+"[0]"), getd (".@quest_"+.@i+"[1]");

							set Zeny, Zeny - getd (".@quest_"+.@i+"[2]");

								mes "["+@nomedonpc$+"]";
								mes "Aí está a sua recompensa.";

						close;
						}
						
					case 2:
					
					next;
					
					mes "["+@nomedonpc$+"]";
					mes "Volte quando tiver certeza, não me faça mais perder tempo!";

					close;
						
				}			
		close;

					case 2:
		
					next;
		
						mes "["+@nomedonpc$+"]";
						mes "Os itens que quero para produzir ^9400D3" + getitemname (getd (".@quest_"+.@i)) + "^000000 são:"; 

						for(set .@j, 3; .@j < .@size; set .@j, .@j + 2)

							mes "- " + getd (".@quest_"+.@i+"["+(.@j+1)+"]") + "x " + getitemname(getd (".@quest_"+.@i+"["+.@j+"]"));

						if (getd (".@quest_"+.@i+"[2]"))

							mes "- " + getd (".@quest_"+.@i+"[2]") + " Zenies";

					next;
					deletearray .@menu$[0],getarraysize(.@menu$);
					goto VoltaMenu;
				
					case 3:
					
					next;
					
					goto StatusCustons;

			
					case 4:

						set @bottomview, getlook(3);
						set @topview, getlook(4);
						set @midview, getlook(5);
						addtimer 1000, strnpcinfo(3)+"::On_Leave";
						set @equip,getiteminfo(getd (".@quest_"+.@i), 5);
						set @view, getiteminfo(getd (".@quest_"+.@i), 11);
						
						if(@equip != -1 && @view > 0) 
						{
						if(@equip & 1) atcommand "@changelook 3 " + @view;
						if(@equip & 256) atcommand "@changelook 1 " + @view;
						if(@equip & 512) atcommand "@changelook 2 " + @view;
						}
						next;
							
						atcommand "@changelook 1 " + @topview;
						atcommand "@changelook 2 " + @midview;
						atcommand "@changelook 3 " + @bottomview;
						set @equip,0;
						set @view,0;
						set @topview,0;
						set @midview,0;
						set @bottomview,0;
	
						goto VoltaMenu;
					
					case 5:
					next;
					deletearray .@menu$[0],getarraysize(.@menu$);
					goto Inicio;
					
					case 6:
					next;
					mes "["+@nomedonpc$+"]";
					mes "Volte quando realmente quiser algo!";
					close;
					
					
	}	
	On_Leave:
						
	set @bottomview, getlook(3);
	set @topview, getlook(4);
	set @midview, getlook(5);
	atcommand "@changelook 1 " + @topview;
	atcommand "@changelook 2 " + @midview;
	atcommand "@changelook 3 " + @bottomview;
	set @equip,0;
	set @view,0;
	set @topview,0;
	set @midview,0;
	set @bottomview,0;
	end;
	
						
	StatusCustons:
	
	if (getitemname (getd (".@quest_"+.@i))) == getitemname(getd (".@quest_0"))
	{
	mes "["+@nomedonpc$+"]";
	mes "Os atributos de ^9400D3" + getitemname (getd (".@quest_"+.@i)) + "^000000 são:^4169E1"; 
	mes " +10 Inteligência";
	mes "  +3 Desteza";
	mes "  +5 Vitalitade";
	mes "+10% Congelar Atacante";
	}
	if (getitemname (getd (".@quest_"+.@i))) == getitemname(getd (".@quest_1"))
	{
	mes "["+@nomedonpc$+"]";
	mes "Os atributos de ^9400D3" + getitemname (getd (".@quest_"+.@i)) + "^000000 são:^4169E1"; 
	mes " +1 Inteligência";
	mes "  +3 Desteza";
	mes "  +5 Vitalitade";
	mes "+10% Congelar Atacante";
	}
	if (getitemname (getd (".@quest_"+.@i))) == getitemname(getd (".@quest_2"))
	{
	mes "["+@nomedonpc$+"]";
	mes "Os atributos de ^9400D3" + getitemname (getd (".@quest_"+.@i)) + "^000000 são:^4169E1"; 
	mes " +1 Inteligência";
	mes "  +3 Desteza";
	mes "  +5 Vitalitade";
	mes "+10% Congelar Atacante";
	}
	if (getitemname (getd (".@quest_"+.@i))) == getitemname(getd (".@quest_3"))
	{
	mes "["+@nomedonpc$+"]";
	mes "Os atributos de ^9400D3" + getitemname (getd (".@quest_"+.@i)) + "^000000 são:^4169E1"; 
	mes " +1 Inteligência";
	mes "  +3 Desteza";
	mes "  +5 Vitalitade";
	mes "+10% Congelar Atacante";
	}
	if (getitemname (getd (".@quest_"+.@i))) == getitemname(getd (".@quest_4"))
	{
	mes "["+@nomedonpc$+"]";
	mes "Os atributos de ^9400D3" + getitemname (getd (".@quest_"+.@i)) + "^000000 são:^4169E1"; 
	mes " +1 Inteligência";
	mes "  +3 Desteza";
	mes "  +5 Vitalitade";
	mes "+10% Congelar Atacante";
	}
	next;
	deletearray .@menu$[0],getarraysize(.@menu$);
	goto VoltaMenu;
}

 



i Will be grateful if anyone can help me with that

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.