Jump to content
  • 0

Hi I'm new shop using the dynamic system


montero11

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   1
  • Joined:  04/26/15
  • Last Seen:  

good afternoon I'm posting for the first time and I have some doubts about the dinamic system, I have a script, looking and reading hise not if this is right or wrong but I would like there is an error that help to correct me, I'm new

 

what I want is to make one npc shop and not several options

 

evolvedmajestic.txt

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  387
  • Reputation:   60
  • Joined:  10/08/13
  • Last Seen:  

what did you want actually? please be more specific. The script already show there is only one shop.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  265
  • Reputation:   95
  • Joined:  09/30/14
  • Last Seen:  

The idea behind that NPC is to have a ton of headgear quests in one NPC. I suggest doing something simpler for what you want. A turn-in quest would work.

//===== eAthena Script =======================================
//= Euphy's Quest Shop
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.4a - eAthena
//===== Description: =========================================
//= A dynamic quest shop based on Lunar's, with easier config.
//= Includes support for multiple shops & cashpoints.
//= Item Preview script by ToastOfDoom.
//============================================================
					
prontera,139,167,5	script	Hat Maker	61,{
function Add; function Chk; function Slot; function A_An;
	npcshopdelitem "qshop3",909;
	dispbottom "Select one item at a time.";
	callshop "qshop3";
	npcshopattach "qshop3";
	end;

function Add {
	if (getitemname(getarg(1))=="null") {
		debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; }
	for(set .@n,5; .@n<127; set .@n,.@n+2) {
		if (!getarg(.@n,0)) break;
		if (getitemname(getarg(.@n))=="null") {
			debugmes "Quest requirement #"+getarg(.@n)+" invalid (skipped)."; return; } }
	for(set .@i,2; .@i<.@n; set .@i,.@i+1)
		set getd(".q_"+getarg(1)+"["+(.@i-2)+"]"), getarg(.@i);
	npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
	sleep 1;
	return; }
function Chk {
	if (getarg(0)<getarg(1)) { set @qe0,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 A_An {
	setarray .@A$[0],"a","e","i","o","u";
	set .@B$, "_"+getarg(0);
	for(set .@i,0; .@i<5; set .@i,.@i+1)
		if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0);
	return "a "+getarg(0); }

OnBuyItem:
	set .@q[0],@bought_nameid;
	copyarray .@q[1],getd(".q_"+@bought_nameid+"[0]"),getarraysize(getd(".q_"+@bought_nameid+"[0]"));
	if (!.@q[1]) { message strcharinfo(0),"An error has occurred."; end; }
	mes "[Quest Shop]";
	mes "Reward: ^0055FF"+((.@q[1]>1)?.@q[1]+"x ":"")+Slot(.@q[0])+"^000000";
	mes "Requirements:";
	if (.@q[2]) mes " > "+Chk(Zeny,.@q[2])+.@q[2]+" Zeny^000000";
	if (.@q[3]) mes " > "+Chk(getd(.Points$[0]),.@q[3])+.@q[3]+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+.@q[3]+")^000000";
	if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2)
		mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1])+((.DisplayID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+.@q[.@i+1]+")^000000";
	next;
	set @qe1, getiteminfo(.@q[0],5); set @qe2, getiteminfo(.@q[0],11);
	addtimer 1000, strnpcinfo(1)+"::OnEnd";
	while(1){
		switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((((@qe1&1) || (@qe1&256) || (@qe1&512)) && @qe2>0 && !@qe6)?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
			case 1:
				if (@qe0) { 
					mes "[Quest Shop]";
					mes "You're missing one or more quest requirements.";
					close; }
				if (!checkweight(.@q[0],.@q[1])) {
					mes "[Quest Shop]";
					mes "^FF0000You need "+(((.@q[1]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
					close; }
				if (.@q[2]) set Zeny, Zeny-.@q[2];
				if (.@q[3]) setd .Points$[0], getd(.Points$[0])-.@q[3];
				if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2)
					delitem .@q[.@i],.@q[.@i+1];
				getitem .@q[0],.@q[1];
				if (.Announce) announce strcharinfo(0)+" has created "+A_An(getitemname(.@q[0]))+"!",0;
				specialeffect2 699;
				close;
			case 2:
				set @qe3, getlook(3); set @qe4, getlook(4); set @qe5, getlook(5);
				if (@qe1&1) atcommand "@changelook 3 "+@qe2;
				if (@qe1&256) atcommand "@changelook 1 "+@qe2;
				if (@qe1&512) atcommand "@changelook 2 "+@qe2;
				set @qe6,1;
				break;
			case 3:
				close; } }

OnEnd:
	if (@qe6) { atcommand "@changelook 3 "+@qe3; atcommand "@changelook 1 "+@qe4; atcommand "@changelook 2 "+@qe5; }
	for(set .@i,0; .@i<7; set .@i,.@i+1) setd "@qe"+.@i,0;
	end;
OnInit:
// --------------------- Config ---------------------
// Custom points, if needed: "<variable>","<name to display>"
	setarray .Points$[0],"#CASHPOINTS","Cash Points";

	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 .DisplayID,0;	// Show item IDs? (1: yes / 0: no)
	set .ShowZeny,0;	// Show Zeny cost, if any? (1: yes / 0: no)

// Shop categories, if needed: "<Shop 1>","<Shop 2>"{,...};
// Duplicate dummy data for any additional shops (bottom of script).
// If no categories, use the second line instead (remove //).

	setarray .Shops$[1],"Headgears","Weapons","Other";
	// set .Shops$,"n/a";

// Add(<shop number>,<reward ID>,<reward amount>,<Zeny cost>,<point cost>,
//     <required item ID>,<required item amount>{,...});
// Shop number corresponds with order above (default is 1).
// Note: Do NOT use a reward item more than once!

	Add(3,5217,1,0,0,912,1);

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

}

// -------- Dummy data (duplicate as needed) --------
-	shop	qshop1	-1,909:-1
-	shop	qshop2	-1,909:-1
-	shop	qshop3	-1,909:-1

But if you insist, you can use this. Just change this line:

Add(3,5217,1,0,0,912,1);

912 is the first item required, 1 means you need one. You can keep adding more items with more commas. (913,10,914,25) etc.

Edited by Nova
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   1
  • Joined:  04/26/15
  • Last Seen:  

Ok  good I will prove that this runs me and I hope to uzarlo by myself if I have a problem I can here postiar same or new post ???

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  265
  • Reputation:   95
  • Joined:  09/30/14
  • Last Seen:  

Yeah just reply here if it doesn't work.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   1
  • Joined:  04/26/15
  • Last Seen:  

Hi sorry for bothering but uze follow the script that gave me i was reading and analyzing and implement the NPC and all but leave me my custom item dond this quest could say I made the fatal error 

I just want one for my different custom option

 

ngzz13.jpg


poring_w02,95,195,5 script Evolved Majestic 62,{
function Add; function Chk; function Slot; function A_An;
npcshopdelitem "qshop4",909;
dispbottom "Select one item at a time.";
callshop "qshop4";
npcshopattach "qshop4";
end;

function Add {
if (getitemname(getarg(1))=="null") {
debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; }
for(set .@n,5; .@n<127; set .@n,.@n+2) {
if (!getarg(.@n,0)) break;
if (getitemname(getarg(.@n))=="null") {
debugmes "Quest requirement #"+getarg(.@n)+" invalid (skipped)."; return; } }
for(set .@i,2; .@i<.@n; set .@i,.@i+1)
set getd(".q_"+getarg(1)+"["+(.@i-2)+"]"), getarg(.@i);
npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
sleep 1;
return; }
function Chk {
if (getarg(0)<getarg(1)) { set @qe0,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 A_An {
setarray .@A$[0],"a","e","i","o","u";
set .@B$, "_"+getarg(0);
for(set .@i,0; .@i<5; set .@i,.@i+1)
if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0);
return "a "+getarg(0); }

OnBuyItem:
set .@q[0],@bought_nameid;
copyarray .@q[1],getd(".q_"+@bought_nameid+"[0]"),getarraysize(getd(".q_"+@bought_nameid+"[0]"));
if (!.@q[1]) { message strcharinfo(0),"An error has occurred."; end; }
mes "[Quest Shop]";
mes "Reward: ^0055FF"+((.@q[1]>1)?.@q[1]+"x ":"")+Slot(.@q[0])+"^000000";
mes "Requirements:";
if (.@q[2]) mes " > "+Chk(Zeny,.@q[2])+.@q[2]+" Zeny^000000";
if (.@q[3]) mes " > "+Chk(getd(.Points$[0]),.@q[3])+.@q[3]+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+.@q[3]+")^000000";
if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2)
mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1])+((.DisplayID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+.@q[.@i+1]+")^000000";
next;
set @qe1, getiteminfo(.@q[0],5); set @qe2, getiteminfo(.@q[0],11);
addtimer 1000, strnpcinfo(1)+"::OnEnd";
while(1){
switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((((@qe1&1) || (@qe1&256) || (@qe1&512)) && @qe2>0 && !@qe6)?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
case 1:
if (@qe0) { 
mes "[Quest Shop]";
mes "You're missing one or more quest requirements.";
close; }
if (!checkweight(.@q[0],.@q[1])) {
mes "[Quest Shop]";
mes "^FF0000You need "+(((.@q[1]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
close; }
if (.@q[2]) set Zeny, Zeny-.@q[2];
if (.@q[3]) setd .Points$[0], getd(.Points$[0])-.@q[3];
if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2)
delitem .@q[.@i],.@q[.@i+1];
getitem .@q[0],.@q[1];
if (.Announce) announce strcharinfo(0)+" has created "+A_An(getitemname(.@q[0]))+"!",0;
specialeffect2 699;
close;
case 2:
set @qe3, getlook(3); set @qe4, getlook(4); set @qe5, getlook(5);
if (@qe1&1) atcommand "@changelook 3 "+@qe2;
if (@qe1&256) atcommand "@changelook 1 "+@qe2;
if (@qe1&512) atcommand "@changelook 2 "+@qe2;
set @qe6,1;
break;
case 3:
close; } }

OnEnd:
if (@qe6) { atcommand "@changelook 3 "+@qe3; atcommand "@changelook 1 "+@qe4; atcommand "@changelook 2 "+@qe5; }
for(set .@i,0; .@i<7; set .@i,.@i+1) setd "@qe"+.@i,0;
end;
OnInit:
// --------------------- Config ---------------------
// Custom points, if needed: "<variable>","<name to display>"
setarray .Points$[0],"#CASHPOINTS","Cash Points";

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 .DisplayID,0; // Show item IDs? (1: yes / 0: no)
set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no)

// Shop categories, if needed: "<Shop 1>","<Shop 2>"{,...};
// Duplicate dummy data for any additional shops (bottom of script).
// If no categories, use the second line instead (remove //).

setarray .Shops$[1],"Headgears","Weapons","Other";
// set .Shops$,"n/a";

// Add(<shop number>,<reward ID>,<reward amount>,<Zeny cost>,<point cost>,
//     <required item ID>,<required item amount>{,...});
// Shop number corresponds with order above (default is 1).
// Note: Do NOT use a reward item more than once!

Add(1,29144,1,5000000,0,727,300,982,30,931,250,920,250,7291,10);
Add(1,29145,1,5000000,0,1045,300,975,30,7440,250,725,250,7290,10);
Add(1,29146,1,5000000,0,7512,300,981,30,1099,250,7347,250,7296,10);
Add(1,29147,1,5000000,0,1002,300,979,30,956,250,1042,250,7297,10);
Add(1,29148,1,5000000,0,1055,300,976,30,985,250,960,250,7017,10);
Add(1,29149,1,5000000,0,1032,300,980,30,522,250,1058,250,7292,10);
Add(1,29150,1,5000000,0,7119,300,978,30,925,250,1020,250,7158,10);
// --------------------------------------------------

}

// -------- Dummy data (duplicate as needed) --------
- shop qshop1 -1,909:-1
- shop qshop2 -1,909:-1
- shop qshop3 -1,909:-1
- shop qshop4 -1,909:-1 
Edited by Emistry
Use CODEBOX.
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@montero11

you added the items to shop #1 ...but you open shop #4 ....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   1
  • Joined:  04/26/15
  • Last Seen:  

o.o but if you just want one store as I do? So I'm watching but watch this picture does not let me do the quest

 

sorry to be bothering is that as I speak English a little mind) = sorry to be bothering it is that as I speak English a little mind) = and I do not respond in Spanish c topics:

 

30cvb0g.jpg

Edited by montero11
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  265
  • Reputation:   95
  • Joined:  09/30/14
  • Last Seen:  

Posted · Hidden by Emistry, July 13, 2015 - non-english
Hidden by Emistry, July 13, 2015 - non-english

Solo puedes comprar uno a la vez usando ese script. Parece que estas tratando de comprar mas que uno.

Link to comment

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   1
  • Joined:  04/26/15
  • Last Seen:  

Posted · Hidden by Emistry, July 13, 2015 - non-english
Hidden by Emistry, July 13, 2015 - non-english

Nova Muchas Gracias Ya Lo Resolvi gracias por tu ayuda me sacaste de varios Lios puedes serar el tema gracias

  • Upvote 1
Link to comment

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  265
  • Reputation:   95
  • Joined:  09/30/14
  • Last Seen:  

You're welcome. :]

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...