quest maker

By Streiker/uploaded by aero, 1 Month ago, written in php.
/*
   ||------------------------------------------------------||
   ||                       NPC:                           ||
   ||======================================================||
   ||                    Quest Maker                       ||
   ||======================================================||
   ||                    Version 1.0                       ||
   ||======================================================||
   ||                   Made by Streiker                   ||
   ||======================================================||
   ||                      Updates:                        ||
   ||                    (5 latests)                       ||
   ||======================================================||
   ||                     Description:                     ||
   ||                                                      ||
   || Quest Maker, enable the easy incorporation of quests.||
   ||======================================================||
   ||                  Additional Comments:                ||
   ||                                                      ||
   || At the moment none.                                  ||
   ||======================================================||
   ||======================================================||
*/
	//									

			             Separator		    Required items
// callfunc "Quest_Maker",Color ( Optional ), "Name of the quest", ID Prize 

1, Amount 1,ID Prize 2[...], Amount 2[...], 111, Required Zeny, Item 1, 

Amount 1, Item 2[...], Amount 2[...];
// 111 is used for separate the items of the required zeny

function	script	Quest_Maker	{

	set .@x1$, "["+( ( getarg ( 0, 0 ) ) ? "^"+ getarg ( 0 ) : "^2b86b5" 

);
	set .@x2$, .@x1$ +""+ getarg ( 1 ) +"^000000]";
	mes .@x2$;
	mes ( ( getarg ( 7, 0 ) ) ? "You need "+  getarg ( 5 ) +" zeny." : 

"" );
	mes "^000000Prizes of the Quest:";
	for ( set .@i, 2; getarg ( .@i, 0 ) != 111 ; set .@i,.@i + 2 )
		mes "^007c66"+ getarg ( .@i + 1 ) +" "+ getitemname ( getarg 

( .@i ) ) +".";
	mes "^000000Neccesary Items:";
	for ( set .@i, 8; getarg ( .@i, 0 ) != 0 ; set .@i,.@i + 2 )
		mes ( ( countitem ( getarg ( .@i ) ) < getarg ( .@i + 1 ) ) 

? "^800000":"^008000" ) +" "+ getarg ( .@i + 1 ) +" "+ getitemname ( getarg 

( .@i ) ) +" ["+ countitem ( getarg ( .@i ) ) +"/^008000"+ getarg ( .@i + 1 

) +"]";
	next ;
	mes .@x2$;
	mes "^000000Do you like to exchange it items?";
	select ( "Sure", "No..." ) ;
	switch ( @menu ) {

		case 1:

		for ( set .@i, 8; getarg ( .@i, 0 ) != 0 ; set .@i,.@i + 2 ) 

{
			if ( countitem ( getarg ( .@i ) ) < getarg ( .@i + 1 

) ) {
				set .@a, getarg ( .@i + 1 ) - countitem ( 

getarg ( .@i ) );
				mes "^880000I'm so sorry, but you don't have 

"+ .@a +" "+ getitemname ( getarg ( .@i ) );
				return ;
			}
			if ( zeny < getarg ( 7, 0 ) ) {
				set .@a, getarg ( 7, 0 ) - zeny;
				mes "^880000I'm so sorry, but you don't have 

"+ .@a +" zenys.";
				return ;
			}
		}
		for ( set .@i, 8; getarg ( .@i, 0 ) != 0 ; set .@i,.@i + 2 ) 

delitem getarg ( .@i ), getarg ( .@i + 1 ) ;
		for ( set .@i, 2; getarg ( .@i, 0) != 111 ; set .@i,.@i + 2 

) getitem getarg ( .@i ), getarg ( .@i + 1 ) ;
		set zeny, zeny - getarg ( 7, 0 );
		mes "Congratulations";
		mes "You won for complete the quest:";
		for ( set .@i, 2; getarg ( .@i, 0 ) != 111 ; set .@i,.@i + 2 

)
			mes "^067c00"+ getarg ( .@i + 1 ) +" "+ getitemname 

( getarg ( .@i ) ) +".";
		break ;

		case 2:

		mes "Goodbye.";
		break ;

	}
	return ;
}


// Example NPC:

	/*

-	script	asdf	-1,{

OnWhisperGlobal:

	select ( "Quest One", "Quest Two" );
	switch ( @menu ) {

		case 1:

		callfunc "Quest_Maker",0,"Quest 

One",512,1,513,3,111,1000000,502,30,503,40;
		break;

		case 2:

		callfunc "Quest_Maker","89cc44","Quest 

Two",513,59,4441,3,111,5000000,509,30,510,40,511,30;
		break;
	}
	close ;

}
	*/