Jump to content

Question

Posted

 

//===== eAthena Script =======================================

//= Super Awesome Quest Template
//===== By: ==================================================
//= CalciumKid
//= & Okira
//===== Current Version: =====================================
//= 2.0
//===== Compatible With: =====================================
//= eAthena 1.0 Final +
//===== Description: =========================================
//= Quest Template
//============================================================
prontera,164,150,0 script Quest Shop 512,{
  //===== Config: ==============================================
  set .npcname$,"[^FF0000 <Headgears> ^000000]"; //Change to whatever you want the NPC name to be
  setarray .reqid[1],<1059>,<7097>,<7227>; //Item IDs for the items, required for item checks
  setarray .reqn$[1],"<Fabric>","<Burning Heart>","<TCG Card>"; //These are names of the required items, 
 
for the dialogue
  setarray .reqa[1],<100>,<100>,<1>; //These are how many of each item is required
  set .prize,<30089>; //Change this to the Item ID of the item reward
  set .prizen$,"<Hokage Hat>"; //Change this to the name of your reward
  set .prizea,<1>; //Change this to the amount of the prize item
  set .zeny,20000000; //Amount of zeny for quest (set to 0 to disable)
 
L_QUEST:
mes .npcname$;
mes "Hah! Hello there "+strcharinfo(0);
next;
mes .npcname$;
mes "I don't get many visitors, so I assume you're after my legendary ^FF0000"+.prizen$+"^000000?";
menu "Of course",-,"No way",L_EXIT;
next;
mes .npcname$;
mes "Great! I love business. I can make you a ^FF0000"+.prizen$+"^000000, but only if you bring me the 
 
materials required.";
next;
mes .npcname$;
mes "Would you like me to make one for you?";
menu "Yes",-,"No",L_EXIT;
  next;
  mes .npcname$;
  mes "I'll need the following:";
  for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
mes .reqa[.@x]+" ^FF0000"+.reqn$[.@x]+"^000000";
  }
  if (.zeny > 0) {
mes .zeny+" ^FF0000Zeny^000000";
  }
  next;
  mes .npcname$;
  mes "Do you have those items?";
  menu "Yes",-,"No",L_EXIT;
   next;
   mes .npcname$;
   for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
if(countitem(.reqid[.@x]) >= .reqa[.@x]) {mes "You've got enough ^00FF00"+.reqn
 
$[.@x]+"^000000";} else {mes "You need more ^FF0000"+.reqn$[.@x]+"^000000";}
   }
   if (.zeny > 0) {
if (Zeny < .zeny) {mes "You're missing ^FF0000Zeny^000000";}
else {mes "You've got enough ^00FF00Zeny^000000";}
   }
   next;
   mes .npcname$;
   mes "Would you like to complete the quest?";
   menu "Yes please!",-,"No Thanks",L_EXIT;
   next;
   for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
if(countitem(.reqid[.@x]) < .reqa[.@x]) goto L_EXIT2;
   }
   if (.zeny > 0) {
if (Zeny < .zeny) goto L_EXIT2;
   }
   mes .npcname$;
   mes "Brilliant! Fantastic! Here you go.";
   for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
delitem .reqid[.@x],.reqa[.@x];
   }
   if (.zeny > 0) {
set Zeny, Zeny - .zeny;
   }
   goto L_FINAL2;
   close;
L_EXIT:
   next;
   mes .npcname$;
   mes "Eh. I don't need you either. Bah!";
   close;
L_EXIT2:
   next;
   mes .npcname$;
   mes "I'm sorry, you don't have enough!";
   close;
L_FINAL2:
   next;
   mes .npcname$;
   mes "Brilliant! Fantastic! Here you go.";
   getitem .prize,1;
   close;
}

I want to make a Quest Like Hokage Hat Ex: 100 Fabric, 100 Burning Heart 1 TCG Card but It makes some error. Can someone help me please? :(

post-3525-0-43270700-1408249391_thumb.png

9 answers to this question

Recommended Posts

Posted

 

 

//===== eAthena Script =======================================

//= Super Awesome Quest Template
//===== By: ==================================================
//= CalciumKid
//= & Okira
//===== Current Version: =====================================
//= 2.0
//===== Compatible With: =====================================
//= eAthena 1.0 Final +
//===== Description: =========================================
//= Quest Template
//============================================================
prontera,164,150,0 script Quest Shop 512,{
  //===== Config: ==============================================
  set .npcname$,"[^FF0000 <Headgears> ^000000]"; //Change to whatever you want the NPC name to be
  setarray .reqid[1],<1059>,<7097>,<7227>; //Item IDs for the items, required for item checks
  setarray .reqn$[1],"<Fabric>","<Burning Heart>","<TCG Card>"; //These are names of the required items, 
 
for the dialogue
  setarray .reqa[1],<100>,<100>,<1>; //These are how many of each item is required
  set .prize,<30089>; //Change this to the Item ID of the item reward
  set .prizen$,"<Hokage Hat>"; //Change this to the name of your reward
  set .prizea,<1>; //Change this to the amount of the prize item
  set .zeny,20000000; //Amount of zeny for quest (set to 0 to disable)
 
L_QUEST:
mes .npcname$;
mes "Hah! Hello there "+strcharinfo(0);
next;
mes .npcname$;
mes "I don't get many visitors, so I assume you're after my legendary ^FF0000"+.prizen$+"^000000?";
menu "Of course",-,"No way",L_EXIT;
next;
mes .npcname$;
mes "Great! I love business. I can make you a ^FF0000"+.prizen$+"^000000, but only if you bring me the 
 
materials required.";
next;
mes .npcname$;
mes "Would you like me to make one for you?";
menu "Yes",-,"No",L_EXIT;
  next;
  mes .npcname$;
  mes "I'll need the following:";
  for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
mes .reqa[.@x]+" ^FF0000"+.reqn$[.@x]+"^000000";
  }
  if (.zeny > 0) {
mes .zeny+" ^FF0000Zeny^000000";
  }
  next;
  mes .npcname$;
  mes "Do you have those items?";
  menu "Yes",-,"No",L_EXIT;
   next;
   mes .npcname$;
   for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
if(countitem(.reqid[.@x]) >= .reqa[.@x]) {mes "You've got enough ^00FF00"+.reqn
 
$[.@x]+"^000000";} else {mes "You need more ^FF0000"+.reqn$[.@x]+"^000000";}
   }
   if (.zeny > 0) {
if (Zeny < .zeny) {mes "You're missing ^FF0000Zeny^000000";}
else {mes "You've got enough ^00FF00Zeny^000000";}
   }
   next;
   mes .npcname$;
   mes "Would you like to complete the quest?";
   menu "Yes please!",-,"No Thanks",L_EXIT;
   next;
   for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
if(countitem(.reqid[.@x]) < .reqa[.@x]) goto L_EXIT2;
   }
   if (.zeny > 0) {
if (Zeny < .zeny) goto L_EXIT2;
   }
   mes .npcname$;
   mes "Brilliant! Fantastic! Here you go.";
   for (set .@x,1; .@x < getarraysize(.reqid); set .@x,.@x + 1) {
delitem .reqid[.@x],.reqa[.@x];
   }
   if (.zeny > 0) {
set Zeny, Zeny - .zeny;
   }
   goto L_FINAL2;
   close;
L_EXIT:
   next;
   mes .npcname$;
   mes "Eh. I don't need you either. Bah!";
   close;
L_EXIT2:
   next;
   mes .npcname$;
   mes "I'm sorry, you don't have enough!";
   close;
L_FINAL2:
   next;
   mes .npcname$;
   mes "Brilliant! Fantastic! Here you go.";
   getitem .prize,1;
   close;
}

I want to make a Quest Like Hokage Hat Ex: 100 Fabric, 100 Burning Heart 1 TCG Card but It makes some error. Can someone help me please? :(

 

 

 

Why you did not use this script???

It support

  • Very simple item additions, taking only seven arguments:

    Add(<shop ID>,<reward ID>,<reward amount>,<Zeny cost>,<point cost>,<required item ID>,<required item amount>{,...});

  • Support for multiple shops/categories, if needed.
  • Support for any custom variable (ex. Cash Points).
  • User-friendly: Item requirements are color-coded by completion, and you can only proceed when all are met.
  • There's no need to number the quest items, so re-ordering takes no time at all.
  • Options to show slots, announce quests upon completion, display item IDs, and show Zeny cost.
  • Debug information for any errors in configuration.

 

Posted

Wait sir lemme try

This is what I've got sir.

This is what I've got sir.

 

 

Errr... Is that a positive feed back or some error?..?

 

Posted (edited)

This is what I've got sir

 

What revisiona are you using? @revision

I see this error somewhere in this rAthena.. Wait im searching and try to contact other scripter..

 

The error was showing on line 36 & 214...

@euphy

@emistry

@capuche

Edited by CheckMate
Posted

 

This is what I've got sir

 

What revisiona are you using? @revision

I see this error somewhere in this rAthena.. Wait im searching and try to contact other scripter..

 

I'm using eAthena. When i type @revision unknown command. Sorry I'm newbie >_<

Posted

 

 

This is what I've got sir

 

What revisiona are you using? @revision

I see this error somewhere in this rAthena.. Wait im searching and try to contact other scripter..

 

I'm using eAthena. When i type @revision unknown command. Sorry I'm newbie >_<

 

No wonder... It is because... This script was function for rAthena... 

Its ok sir...

Im also newbie.. ^  ^

Trying to help as i can.. ^ ^ 

Wait im trying searching

Posted

Ok sir thank you ^_^

Still waiting for answers... :/

 

So sorry... /sry

Try this

// Settings :
//	-	Only required to edit the ShopSetting() Function
//			Notes : You may also add / remove Menu ( If any ) 
//	-	Shop Currency can be either ItemID or Variable Name, but must write within Quotation Marks ( "" )
//			Ex. of Variable.	->	Zeny , #CASHPOINTS , #KAFRAPOINTS , CustomVariable , #CustomVariable
//	-	ERROR Message are used to show Invalid Settings in your NPC.


// Leave this alone...
-	shop	Emistry_Shop	-1,512:100


prontera,155,181,5	script	Sample	757,{
function ShopSettings;
function ValidateCost;
function CurrencyInfo;
function ClearData;
function ValueConvert;
function ErrorNotice;

mes "Each Shop from the Menu may purchase using ^FF0000Different Currency^000000.";
mes "^00FF00____________________________^000000";
mes "So,Which shop you would like to look at it";
next;
// Menu Selection
select("Shop 1","Shop 2","Shop 3");

ClearData();
ShopSettings( @menu );
npcshopitem "Emistry_Shop",512,100;
npcshopdelitem "Emistry_Shop",512;
for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1)
	npcshopadditem "Emistry_Shop",@ItemLists[.@i],@ItemCost[.@i];
mes "Okay...wait awhile";
mes "^00FF00____________________________^000000";
CurrencyInfo( @Currency$ );
mes "^00FF00____________________________^000000";
callshop "Emistry_Shop",1;
npcshopattach "Emistry_Shop";
end;


function	ShopSettings	{
	switch( getarg(0) ){
		Case 1:
			// Currency [ Item ID / Variable Name ]
			set @Currency$,"7179";
			// Item ID Lists
			setarray @ItemLists[0],6153,7227;
			// Item Price
			setarray @ItemCost[0],100,1;
			break;
		Case 2:
			// Currency [ Item ID / Variable Name ]
			set @Currency$,"7227";
			// Item ID Lists
			setarray @ItemLists[0],2306,2302,2303,2304,2305,2301;
			// Item Price
			setarray @ItemCost[0],2,2,3,4,5,6;
			break;
		Case 3:
			// Currency [ Item ID / Variable Name ]
			set @Currency$,"#CASHPOINTS";
			// Item ID Lists
			setarray @ItemLists[0],2306,2302,2303,2304,2305,2301;
			// Item Price
			setarray @ItemCost[0],20,22,34,445,52,641;
			break;
		// Case 4,5,6.....etc...
		default:
			ErrorNotice( "Invalid Menu Selection for Menu "+@menu+"." );
			close;
	}
	
	
if( @Currency$ == "" )
	ErrorNotice( "Invalid Currency Setting in Menu "+@menu+" ." );
if( getarraysize( @ItemCost ) != getarraysize( @ItemLists ) || getarraysize( @ItemLists ) != getarraysize( @ItemCost ) )
	ErrorNotice( "Missing or Extra Value of Item or Cost Settings in Menu "+@menu+" ." );
return;
}

function	ErrorNotice	{
	mes "^FF0000ERROR^000000 - "+getarg(0);
	mes "^00FF00____________________________^000000";
	mes "Inform this Message to ^0000FFGame Staffs^000000 immediately !";
	close;
}

function	CurrencyInfo	{
	if( getitemname( atoi( getarg(0) ) ) != "null" ){
		mes "Item Currency : ^FF0000"+getitemname( atoi( getarg(0) ) )+"^000000";
		mes "Available Amount : ^0000FF"+ValueConvert( countitem( atoi( getarg(0) ) ) )+"^000000";
	}else if( getitemname( atoi( getarg(0) ) ) == "null" ){
		mes "Variable Currency : ^FF0000"+getarg(0)+"^000000";
		mes "Available Amount : ^0000FF"+ValueConvert( getd( getarg(0) ) )+"^000000";
	}
return;
}

function	ValidateCost	{
	if( getitemname( atoi( getarg(0) ) ) != "null" ){
		if( countitem( atoi( getarg(0) ) ) < getarg(1) ) return 1;
	}else{
		if( getd( getarg(0) ) < getarg(1) ) return 1;
	}
return 0;
}

function ClearData	{
	set @Currency$,"";
	set @TotalCost,0;
	deletearray @bought_nameid[0],getarraysize( @bought_nameid );
	deletearray @bought_quantity[0],getarraysize( @bought_quantity );
	deletearray @ItemLists[0],getarraysize( @ItemLists );
	deletearray @ItemCost[0],getarraysize( @ItemCost );
return;
}

function	ValueConvert	{
	set .@num, atoi(""+getarg(0));
	if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
	set .@l, getstrlen(""+.@num);
	for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
		set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
			if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
	}
	return .@num$;
}

OnBuyItem:
	ShopSettings( @menu );
	for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
		for(set @j,0; @j < getarraysize( @ItemLists ); set @j,@j+1)
			if( @ItemLists[@j] == @bought_nameid[@i] )
			set @TotalCost,@TotalCost + ( @ItemCost[@j] * @bought_quantity[@i] );
	mes "^FF0000       BILLING LIST^000000";
	mes "^00FF00____________________________^000000";
	for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 )
			mes "^FF0000"+@bought_quantity[@i]+" x ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000";
	mes "^00FF00____________________________^000000";

	if( getitemname( atoi( @Currency$ ) ) != "null" )
		mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" x "+getitemname( atoi( @Currency$ ) )+"^000000";
	else if( getitemname( atoi( @Currency$ ) ) == "null" ){
		mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" "+@Currency$+"^000000";
	}
	
	mes "^00FF00____________________________^000000";
	if( ValidateCost( @Currency$,@TotalCost ) ){
		if( getitemname( atoi( @Currency$ ) ) != "null" )
			mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+getitemname( atoi( @Currency$ ) )+"^000000";
		else{
			mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+@Currency$+"^000000";
		}
	}else{
		if( select( "^0000FFPurchase^000000:Cancel" ) == 1 ){
			if( getitemname( atoi( @Currency$ ) ) != "null" )
				delitem atoi( @Currency$ ),@TotalCost;
			else{
				set getd( @Currency$ ),getd( @Currency$ ) - @TotalCost;
			}
			for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1)
				getitem @bought_nameid[@i],@bought_quantity[@i];
			message strcharinfo(0),"Purchased "+getarraysize( @bought_nameid )+" Items.";
			mes "Thank you for shopping.";
		}
	}
ClearData();
close;

}

Topic at here

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