Jump to content
  • 0

Help: Quest Item


xrion

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  08/06/14
  • Last Seen:  

---------------Detectar idiomaAfricânerAlbanêsAlemãoAmáricoÁrabeArmênioAzerbaijanoBascoBengaliBielorrussoBirmanêsBósnioBúlgaroCanarimCatalãoCazaqueCebuanoChinês (simplificado)Chinês (tradicional)CingalêsCoreanoCorsoCroataCurdoDinamarquêsEslovacoEslovenoEspanholEsperantoEstonianoFilipinoFinlandêsFrancêsFrísio ocidentalGaélico escocêsGalegoGalêsGeorgianoGregoGuzerateHaitianoHauçáHavaianoHebraicoHíndiHmongHolandêsHúngaroIgboIídicheIndonésioInglêsIorubáIrlandêsIslandêsItalianoJaponêsJavanêsKhmerLaosianoLatimLetãoLituanoLuxemburguêsMacedônioMalaialaMalaioMalgaxeMaltêsMaoriMaratiMongolNepalêsNianjaNorueguêsPanjabiPashtoPersaPolonêsPortuguêsQuirguizRomenoRussoSamoanoSérvioSindiSomaliSoto do sulSuaíliSuecoSundanêsTadjiqueTailandêsTâmilTchecoTélugoTurcoUcranianoUrduUzbequeVietnamitaXhosaXonaZuluPortuguês
 
 
Hello people, good night, how are you?
People I would like to have this npc release 4 quest items every 20 levels, if possible leave configurable, quantity and level please
Thank you attention

forjador.txt

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

You could try this, I added a new requirement. It's not the best way (didn't want to change that much) though.

//===== rAthena Script =======================================
//= Euphy's Forja
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.6c
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= A dynamic Forja based on Lunar's, with easier config.
//= Includes support for multiple shops & cashpoints.
//= Item Preview script by ToastOfDoom.
//===== Additional Comments: =================================
//= 1.0 Initial script.
//= 1.2 Added category support.
//= 1.3 More options and fixes.
//= 1.4 Added debug settings.
//= 1.5 Replaced categories with shop IDs.
//= 1.6 Added support for purchasing stackables.
//= 1.6a Added support for previewing costumes and robes.
//= 1.6b Added 'disable_items' command.
//= 1.6c Replaced function 'A_An' with "F_InsertArticle".
//============================================================

// Shop NPCs -- supplying no argument displays entire menu.
//	callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}};
//  ADD YOUR NPC HERE
//============================================================
prt_in,65,71,3	script	Forja#1	111,{ callfunc "qshop"; }
// prontera,165,203,6	script	Forja#2	998,{ callfunc "qshop",1,2; }	// call the shop 1 and 2 defined below
// etc.. Add your Shop NPCs 'Forja#XXX' here
//============================================================


// Script Core - DO NOT DUPLICATE THIS NPC !!!!!!!!!!!!!
//============================================================
-	script	quest_shop	-1,{
function Add; function Chk; function Slot;
OnInit:
	freeloop(1);

// -----------------------------------------------------------
//  Basic shop settings.
// -----------------------------------------------------------

	set .Announce,1;	// Announce quest completion? (1: yes / 0: no)
	set .ShowSlot,1;	// Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
	set .ShowID,0;  	// Show item IDs? (1: yes / 0: no)
	set .ShowZeny,0;	// Show Zeny cost, if any? (1: yes / 0: no)
	set .MaxStack,100;	// Max number of quest items purchased at one time.

// -----------------------------------------------------------
//  Points variable -- optional quest requirement.
//	setarray .Points$[0],"<variable name>","<display name>";
// -----------------------------------------------------------

	setarray .Points$[0],
		"#CASHPOINTS", "Cash Points";


//=====================================================================================
// ------------------- ADD YOUR SHOPS NAME AND ITEMS SHOPS STARTING HERE --------------
//=====================================================================================

// -----------------------------------------------------------
//  Shop IDs -- to add shops, copy dummy data at bottom of file.
//	setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...};
// -----------------------------------------------------------

	setarray .Shops$[1],
		"Elmos",		// Shop Named 1
		"Armas",		// Shop Named 2
		"Escudos";		// Shop Named 3

// -----------------------------------------------------------
//  Quest items -- do NOT use a reward item more than once!
//	Add(<shop ID>,<reward ID>,<reward amount>,<required level>,
//	    <Zeny cost>,<point cost>,
//	    <required item ID>,<required item amount>{,...});
// -----------------------------------------------------------

// Shop 1
	Add(1,2299,1,20,0,0,7297,0,969,0,999,0,714,1);
	Add(1,5017,1,20,0,0,7297,0,969,0,999,0,714,1);
	Add(1,5022,1,20,0,0,7297,0,969,0,999,0,714,1);
	Add(1,5128,1,20,0,0,7297,0,969,0,999,0,714,1);
	Add(1,5157,1,40,0,0,7297,0,969,0,999,0,714,1);
	Add(1,5171,1,40,0,0,7297,0,969,0,999,0,714,1);
	Add(1,5217,1,40,0,0,7297,0,969,0,999,0,714,1);
	Add(1,5292,1,40,0,0,7297,0,969,0,999,0,714,1);

// Shop 2
	Add(2,1224,1,60,0,0,7297,0,969,0,999,0,714,1);	
	Add(2,1225,1,60,0,0,7297,0,969,0,999,0,714,1);
	Add(2,1226,1,60,0,0,7297,0,969,0,999,0,714,1);
	Add(2,1227,1,60,0,0,7297,0,969,0,999,0,714,1);	

// Shop 3
	Add(3,2102,1,80,0,0,7297,0,969,0,999,0,714,1);
	Add(3,2103,1,80,0,0,7297,0,969,0,999,0,714,1);
	Add(3,2105,1,80,0,0,7297,0,969,0,999,0,714,1);
	Add(3,2107,1,80,0,0,7297,0,969,0,999,0,714,1);

// -----------------------------------------------------------

//=====================================================================================
// ------------------- YOUR SHOPS AND ITEMS SHOPS HAVE BEEN ADDED ---------------------
//=====================================================================================

	freeloop(0);
	set .menu$,"";
	for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) {
		set .menu$, .menu$+.Shops$[.@i]+":";
		npcshopdelitem "qshop"+.@i,909;
	}
	end;

OnMenu:
	set .@size, getarraysize(@i);
	if (!.@size) set @shop_index, select(.menu$);
	else if (.@size == 1) set @shop_index, @i[0];
	else {
		for(set .@j,0; .@j<.@size; set .@j,.@j+1)
			set .@menu$, .@menu$+.Shops$[@i[.@j]]+":";
		set @shop_index, @i[select(.@menu$)-1];
	}
	deletearray @i[0],getarraysize(@i);
	if (.Shops$[@shop_index] == "") {
		message strcharinfo(0),"Ocorreu um erro.";
		end;
	}
	dispbottom "Selecione um item de cada vez.";
	callshop "qshop"+@shop_index,1;
	npcshopattach "qshop"+@shop_index;
	end;

OnBuyItem:
	// .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... }
	setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]);
	copyarray .@q[3],getd(".q_"+@shop_index+"_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+@shop_index+"_"+.@q[0]));
	set .@q[2],.@q[1]*.@q[3];
	set .@lvl,getd(".q_lvl_"+@q[0]);
	if (BaseLevel < .@lvl) {
		message strcharinfo(0),"You need to be at least level "+.@lvl+" to buy "+getitemname(.@q[0])+".";
		end;
	}
	if (!.@q[2] || .@q[2] > 30000) {
		message strcharinfo(0),"Você não pode comprar essa quantia "+getitemname(.@q[0])+".";
		end;
	}
	mes "[Forja]";
	mes "Item: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000";
	mes "Itens necessários:";
	disable_items;
	if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000";
	if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000";
	if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
		mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000";
	next;
	setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11);
	if (@qe[2] > 0 && ((@qe[1] & EQP_HEAD_LOW) || (@qe[1] & EQP_HEAD_TOP) || (@qe[1] & EQP_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_TOP) || (@qe[1] & EQP_COSTUME_HEAD_MID) || (@qe[1] & EQP_COSTUME_HEAD_LOW) || (@qe[1] & EQP_GARMENT) || (@qe[1] & EQP_COSTUME_GARMENT)))
		set .@preview,1;
	addtimer 1000, strnpcinfo(0)+"::OnEnd";
	while(1) {
		switch(select(" ~ Forjar ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Visualizar":"")+": ~ ^777777Fechar^000000")) {
		case 1:
			if (@qe[0]) {
				mes "[Forja]";
				mes "Falta um item ou mais..";
				close;
			}
			if (!checkweight(.@q[0],.@q[2])) {
				mes "[Forja]";
				mes "^FF0000Você precisa "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" capacidade de peso adicional para concluir este comércio.^000000";
				close;
			}
			mes "[Forja]";
			mes "Forjando aguarde...";
			soundeffect "weapon_forj.wav", 0;
			progressbar "0xRRGGBB",20;
			if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]);
			if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]);
			if (.@q[6])
				for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2)
					delitem .@q[.@i],.@q[.@i+1]*.@q[1];

			mes "Item forjado com sucesso...";
			getnameditem .@q[0],strcharinfo(0);
			soundeffect "bs_refinesuccess.wav", 0;
			specialeffect2 EF_FLOWERLEAF;
			close;
		case 2:
			setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1;
			if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2];
			else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2];
			else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2];
			else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2];
			break;
		case 3:
			close;
		}
	}

OnEnd:
	if (@qe[7]) {
		changelook LOOK_HEAD_BOTTOM, @qe[3];
		changelook LOOK_HEAD_TOP, @qe[4];
		changelook LOOK_HEAD_MID, @qe[5];
		changelook LOOK_ROBE, @qe[6];
	}
	deletearray @qe[0],8;
	end;

function Add {
	if (getitemname(getarg(1)) == "null") {
		debugmes "Item #"+getarg(1)+" inválido (skipped).";
		return;
	}
	setarray .@j[0],getarg(2),getarg(4),getarg(5);
	for(set .@i,6; .@i<getargcount(); set .@i,.@i+2) {
		if (getitemname(getarg(.@i)) == "null") {
			debugmes "Itens necessários #"+getarg(.@i)+" inválido (skipped).";
			return;
		} else
			setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1);
	}
	copyarray getd(".q_"+getarg(0)+"_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j);
	setd ".q_lvl_"+getarg(1),getarg(3);
	npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
	return;
}

function Chk {
	if (getarg(0) < getarg(1)) {
		set @qe[0],1;
		return "^FF0000";
	} else
		return "^00FF00";
}

function Slot {
	set .@s$,getitemname(getarg(0));
	switch(.ShowSlot) {
		case 1: if (!getitemslots(getarg(0))) return .@s$;
		case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) return .@s$+" ["+getitemslots(getarg(0))+"]";
		default: return .@s$;
	}
}
}

function	script	qshop	{
	deletearray @i[0],getarraysize(@i);
	for(set .@i,0; .@i<getargcount(); set .@i,.@i+1)
		set @i[.@i],getarg(.@i);
	doevent "quest_shop::OnMenu";
	end;
}


// Dummy shop data -- copy as needed.
//============================================================
-	shop	qshop1	-1,909:-1
-	shop	qshop2	-1,909:-1
-	shop	qshop3	-1,909:-1
-	shop	qshop4	-1,909:-1
-	shop	qshop5	-1,909:-1

 

Link to comment
Share on other sites

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.

×
×
  • Create New...