Jump to content

Question

Posted (edited)

Error:

[Error]:  Loading NPC file: npc/DRAGONAROK/Eventos/Fidelidade.txt
script error on npc/DRAGONAROK/Eventos/Fidelidade.txt line 128
    parse_line: expect command, missing function name or calling undeclared function
   123 :        mes "^3487C2- Voc� pode resgartar diversos pr�mios com Pontos de Fidelidade.^000000";
   124 :        next;
   125 :        switch(select("Sair"+( getvariableofnpc(.shop, "loyalty#controller") ? ":Resgatar Itens" : ":" )+( getvariableofnpc(.achievement, "loyalty#controller") ? ":Premia��es Extras" : "" )))
   126 :        {
   127 :                case 1: { mes .npc$; mes "Tudo bem, tenha um bom dia."; close; }
*  128 :                case 2: { mes .npc$; mes "� pra j�, olha s� os itens incr�veis que temos em nossa lojinha. ^^"; close2; 'o'penshop("loyalty#shop"); end; }
   129 :                case 3:
   130 :                        mes .npc$;
   131 :                        mes "Premia��o Padr�o";
   132 :                        mes "^ff0000Por Hora:^000000 1 Ponto de Fidelidade.";
   133 :                        mes " ";

Script npc:

*/
//=========================================
//	SQL
//	-	Copiar e colar no PhpMyAdmin
/*=========================================

	ALTER TABLE `login` 
	ADD `loyalty_minute` INT NOT NULL DEFAULT '0' , 
	ADD `loyalty_points` INT NOT NULL DEFAULT '0' ;

*/

// Quando player logar começa a contagem de tempo online.
// A cada minuto ele ganha 1 ponto
// Premiações extras a cada meta completa
// A contagem é salva por conta
-	script	loyalty#controller	-1,{ OnInit:
//====================================================
//	Configurações Sistema Fidelidade
//====================================================
//----------------------------------------------------
//	1.	Quantidade de pontos de fidelidade por hora
	set .pontos, 1;			// Padrão: 1 ponto por hora
//----------------------------------------------------
//	2.	Permitir contagem de pontos em @at/Vending?
//	-	(0) Não permitir, (1) Permitir
	set .vending, 0;		// Padrão: (0) Não permitir
//----------------------------------------------------
//	3.	Utilizar Cash ao inves de Pontos de Fidelidade?
//	-	Caso ativado atribuirá a quantidade de pontos 
//		p/hora ao comando @cash, sendo assim a cada 1h
//		online o player recebe X de cash (rops).
//	-	(0) Não permitir, (1) Permitir
	set .cash, 0;			// Padrão: (0) Desativado
//----------------------------------------------------
//	4.	Ativa sistema de conquistas?
//	-	Pontos extra para cada conquista alcançada
//	-	(0) Desativar, (1) Ativar
	set .achievement, 1;	// Padrão: (1) Ativar
//----------------------------------------------------
//	5.	Ativar Loja Itens Fidelidade
//	-	(0) Desativar, (1) Ativar
	set .shop, 1;			// Padrão: (1) Ativar
//----------------------------------------------------
//	5.1	Itens Loja Fidelidade
//	-	<item_id>,<qtd_pontos>{<item_id>,<qtd_pontos>,...};
	setarray .itens[0], 12208, 3, 12210, 4, 14232, 5, 12202, 1, 12203, 1, 12207, 1, 12204, 1, 12205, 1, 12206, 1, 13995, 4, 5423, 4300, 5137, 7200, 5490, 4300;
//----------------------------------------------------
//====================================================
//	Conquistas
//====================================================
//	<n° horas>,<quantidade pontos>;
//	6,5; 6 horas = 5 pontos.
//	Deixar (;) apenas no ultimo
	setarray .achievements[0],	6, 5,
								12, 20,
								24, 80,
								48, 320,
								96, 1280,
								192, 5120,
								384, 20480,
								768, 81920; // Ultimo

//====================================================
//	IMPORTANTE: Não Alterar as linhas abaixo
//====================================================									
donpcevent "loyalty#shop::OnInit"; end; // Carregando Loja
//----------------------------------------------------
//	Contagem de minutos/pontos
OnPCLoginEvent:
	while(1)
	{
		sleep2 60000; // 1 minuto
		if(!checkvending() || .vending)
		{
			query_sql("UPDATE `login` SET `loyalty_minute` = `loyalty_minute` + '1' WHERE `account_id` = '"+getcharid(3)+"'");
			query_sql("SELECT `loyalty_minute` FROM `login` WHERE account_id = '"+getcharid(3)+"'",.@minuto);
			if( !(.@minuto%60) )
			{
				if( .cash ) atcommand "@cash " + .pontos + "";
				else query_sql("UPDATE `login` SET `loyalty_points` = `loyalty_points` + '"+.pontos+"' WHERE `account_id` = '"+getcharid(3)+"'");
				
				if( .achievement )
				{
					for(set .@i, 0; .@i < getarraysize(.achievement); set .@i, .@i + 2)
						if( .achievements[.@i] == ( .@minuto / 60 ) ) {
							if( .cash ) atcommand "@cash " + .achievements[.@i+1];
							else query_sql("UPDATE `login` SET `loyalty_points` = `loyalty_points` + "+.achievements[.@i+1]+" WHERE account_id = '"+getcharid(3)+"'");
							announce "[Sistema de Fidelidade]: Conquista obtida, "+.achievements[.@i]+"h online, parabéns! Receba "+.achievements[.@i+1]+" Pontos de "+(.cash? "Cash" : "Fidelidade"),bc_self,0xBF5EFF;
						}
				}
			}
		}
	}
end;
}
prontera,145,206,4	script	Fidelidade	4_M_ZONDAOYAJI,{mes "[Fidelidade]";mes "Opa, se está vendo esta mensagem, é porque ocorreu um erro.";next;mes "[Fidelidade]";mes "Para corrigir, basta usar a Kafra para teleportar a outro mapa, depois volte aqui.";close;OnInit:	waitingroom "Fidelidade",0;	end;}
-	script	loyalty#agent	-1,{  callfunc "loyalty#resume"; end; }

function	script	loyalty#resume	{
	copyarray .@achievement[0], getvariableofnpc(.achievements[0],"loyalty#controller"),getarraysize(getvariableofnpc(.achievements,"loyalty#controller"));
	query_sql ("SELECT `loyalty_minute` / 60 , `loyalty_minute`, `loyalty_points` FROM `login` WHERE account_id = '"+getcharid(3)+"'",.@hora,.@minuto,.@points);
	set .npc$, "^6F34C2[Sistema de Fidelidade]^000000";
	mes .npc$;
	mes "Seja bem vind"+(Sex?"o":"a")+" ^ff0000"+strcharinfo(0)+"^000000!";
	mes "Tempo de Jogo: ^ff0000"+.@hora+" hora"+(.@hora > 1? "s" : "")+" e "+(.@minuto%60)+" minuto"+(.@minuto > 1? "s" : "")+"^000000.";
	mes "^F7AD00- Você pode acumular Pontos de Fidelidade permanecendo on-line.^000000";
	mes "^3487C2- Você pode resgartar diversos prêmios com Pontos de Fidelidade.^000000";
	next;
	switch(select("Sair"+( getvariableofnpc(.shop, "loyalty#controller") ? ":Resgatar Itens" : ":" )+( getvariableofnpc(.achievement, "loyalty#controller") ? ":Premiações Extras" : "" )))
	{
		case 1: { mes .npc$; mes "Tudo bem, tenha um bom dia."; close; }
		case 2: { mes .npc$; mes "É pra já, olha só os itens incríveis que temos em nossa lojinha. ^^"; close2; openshop("loyalty#shop"); end; }
		case 3:
			mes .npc$;
			mes "Premiação Padrão";
			mes "^ff0000Por Hora:^000000 1 Ponto de Fidelidade.";
			mes " ";
			mes "Premiações Extras: " + ( .@hora < getelementofarray(getvariableofnpc(.achievements, "loyalty#controller"), (getarraysize(getvariableofnpc(.achievements,"loyalty#controller")) - 2 )) ? "^ff0000Incompleto!":"^00B0EFCompleto!") + "^000000";
			
			for(set .@i, 0; .@i < getarraysize(.@achievement); set .@i, .@i + 2)
			{
				mes ( .@hora < .@achievement[.@i] ? "^ff0000" + .@achievement[.@i] + "h^000000: " : "^999999" + .@achievement[.@i] + ": ")  + .@achievement[.@i+1] + " Pontos de "+(getvariableofnpc(.cash,"loyalty#controller")? "Cash" : "Fidelidade")+".";
			}
			next;
			mes .npc$;
			mes "Continue juntando Pontos de Fidelidade e troque por itens incríveis aqui comigo. ^^";
			mes "Tenha um bom jogo e nos vemos por aí!";
			next;
			callfunc "loyalty#resume";
	}
}

-	trader	loyalty#shop	-1,{
OnInit:
	copyarray .@itens[0], getvariableofnpc(.itens[0],"loyalty#controller"),getarraysize(getvariableofnpc(.itens,"loyalty#controller"));
	tradertype(NST_CUSTOM);
	
	for(set .@i, 0; .@i < getarraysize(.@itens); set .@i, .@i + 2) 
		sellitem .@itens[.@i],.@itens[.@i+1];
end;

OnCountFunds: 
	query_sql ("SELECT `loyalty_points` FROM `login` WHERE account_id = '"+getcharid(3)+"'",@loyalty);
	setcurrency(@loyalty); 
end;

OnPayFunds:
	if( @loyalty < @price )  end;
	query_sql("UPDATE `login` SET `loyalty_points` = `loyalty_points` - '"+@price+"' WHERE `account_id` = '"+getcharid(3)+"'");
	purchaseok();
end;
}

/*
	Duplicates
*/
prontera,145,206,4	duplicate(loyalty#agent)	Sistema de Fidelidade#prt	4_M_ZONDAOYAJI


/* Fim do NPC */

Achei somente esse post no forum mas não está funcionando corretamente também ele não dá erro mas ele não exibe os items da loja
link: 

 

I only found this post in the forum but it is not working correctly also it does not give an error but it does not display the store items

link: 

Estou enfrentando esse erro alguém pode me ajudar.
Obrigado:

 

I'm facing this error and I can help.

Thank you:

Edited by christofereduardo

2 answers to this question

Recommended Posts

  • 0
Posted
On 10/09/2017 at 0:23 AM, M4karov said:

The openshop command does not exist in the emulator, use callshop.

Ok a make a test.

 

 

An error has been fixed but now you have created another 2

[Error]: npc_parsesrcfile: Unable to parse, probably a missing or extra TAB in file 'npc/DRAGONAROK/Eventos/Fidelidade.txt', line '149'. Skipping line...
 * w1=-
 * w2=trade
 * w3=loyalty#shop
 * w4=-1,{
[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/DRAGONAROK/Eventos/Fidelidade.txt', line '150'. Stopping...
 * w1=OnInit:
 * w2=
 * w3=
 * w4=

 

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...