/*
||======================================================||
||======================================================||
|| NPC: ||
||======================================================||
|| Quest Maker ||
||======================================================||
|| Version 1.2.2 ||
||======================================================||
|| Made by Streiker ||
||======================================================||
|| Updates: ||
|| (5 latests) ||
|| ||
|| Version 1.0.1: ||
|| Fixed: requisites and rewards count. ||
|| ||
|| Version 1.1: ||
|| Added a dynamic next menu. ||
|| ||
|| Version 1.2: ||
|| Fixed: small bug in the menu (small for ||
|| fix, but you can't use the npc normally. ||
|| Fixed: $@quiz in the menu. ||
|| Changed the functions. ||
|| ||
|| Version 1.2.1: ||
|| Fixed: wrong english (maybe pendent). ||
|| Minor changes. ||
|| ||
|| Version 1.2.2: ||
|| Fixed: forgot a var cleaning. ||
||======================================================||
|| Description: ||
|| ||
|| A dynamic quest maker, allow variables and items, and||
|| items and variables requirements. ||
||======================================================||
|| Additional Comments: ||
|| ||
|| Just read the info of the callsubs to know how add to||
|| add quests. ||
||======================================================||
||======================================================||
*/
- script quest -1,{
function Add_Quest ;
function Add_Items ;
function Add_Vars ;
function Add_Rew1 ;
function Add_Rew2 ;
OnInit:
// Add_Quest, "Name";
// Add a new quest to the script.
// Add_Items, id, amount, {id}, {amount}.
// Add items requirements to the last added quest.
// Add_Vars, "variable", "name to show", amount, {"variable"}, {"name to show"}, {amount}.
// Add variables requirements to the last added quest.
// Add_Rew1, id, amount, {id}, {amount}.
// Add item rewards to the last added quest.
// Add_Rew2, "variable", "name to show", amount, {"variable"}, {"name to show"}, {amount}.
// Add variables rewards to the last added quest.
// Utilicen esto para probar el script, lo he probado y funciona :) .
Add_Quest ( "Red Potion" ) ;
Add_Items ( 512, 10 ) ;
Add_Vars ( "zeny", "Zenys", 100 ) ;
Add_Rew1 ( 501, 1 ) ;
Add_Rew2 ( "zeny", "Zenys", 1 );
function Add_Quest {
set $@quest, $@quest
+ 1;
return ;
}
function Add_Items {
while ( getarg ( .@a,
0 ) != 0 ) {
setd "$@quest_1_1_"+ .@b
+"_"+ $@quest,
getarg ( .@a
);
setd "$@quest_1_2_"+ .@b
+"_"+ $@quest,
getarg ( .@a
+ 1 );
}
setd "$@quest_1_4_"+ $@quest, .@b;
return ;
}
function Add_Vars {
while ( getarg ( .@a,
"" ) != "" ) {
setd "$@quest_2_1_"+ .@b
+"_"+ $@quest
+"$",
getarg ( .@a
);
setd "$@quest_2_2_"+ .@b
+"_"+ $@quest
+"$",
getarg ( .@a
+ 1 );
setd "$@quest_2_3_"+ .@b
+"_"+ $@quest,
getarg ( .@a
+ 2 );
}
setd "$@quest_2_4_"+ $@quest, .@b;
return ;
}
function Add_Rew1 {
while ( getarg ( .@a,
0 ) != 0 ) {
setd "$@quest_3_1_"+ .@b
+"_"+ $@quest,
getarg ( .@a
);
setd "$@quest_3_2_"+ .@b
+"_"+ $@quest,
getarg ( .@a
+ 1 );
}
setd "$@quest_3_4_"+ $@quest, .@b;
return ;
}
function Add_Rew2 {
while ( getarg ( .@a,
"" ) != "" ) {
setd "$@quest_4_1_"+ .@b
+"_"+ $@quest
+"$",
getarg ( .@a
);
setd "$@quest_4_2_"+ .@b
+"_"+ $@quest
+"$",
getarg ( .@a
+ 1 );
setd "$@quest_4_3_"+ .@b
+"_"+ $@quest,
getarg ( .@a
+ 2 );
}
setd "$@quest_4_4_"+ $@quest, .@b;
return ;
}
}
prontera,132,215,4 script Quests 410,{
while ( 1 ) {
set .@a$,
"^2b86b5Quests^000000";
mes "Which quest do you want to do?";
while ( set ( .@a, .@a
+ 1 ) <
= .@g
)
setd ".@m"+ .@a
+"$",
"";
while ( .@a <= $@quest ) {
setd ".@m"+ .@g
+"$",
getd ( ".@m"+ .@g
+"$" ) + getd ( "$@quest_"+ .@a
+"$" )+":";
if ( ! ( .@a % 59 ) ) {
setd ".@m"+ .@g
+"$",
getd ( ".@m"+ .@g
+"$" ) + "^a41111Next^000000:";
}
}
while ( ( ! .@b ) || ( .@b == 60 ) ) {
}
mes "Requisites of this quest:";
while ( .@c <
= getd ( "$@quest_1_4_"+ .@b
) ) {
mes "^4ca24c"+ countitem ( getd ( "$@quest_1_1_"+ .@b
+"_"+ .@c
) ) +"^000000/^a61616"+ getd ( "$@quest_1_2_"+ .@b
+"_"+ .@c
) +"^000000 "+ getitemname ( getd ( "$@quest_1_1_"+ .@b
+"_"+ .@c
) );
}
while ( .@c <
= getd ( "$@quest_2_4_"+ .@b
) ) {
mes "^4ca24c"+ getd ( getd ( "$@quest_2_1_"+ .@b
+"_"+ .@c
+"$" ) ) +"^000000/^a61616"+ getd ( "$@quest_2_3_"+ .@b
+"_"+ .@c
) +"^000000 "+ getd ( "$@quest_2_2_"+ .@b
+"_"+ .@c
+"$" );
}
mes "Rewards of this quest:";
if ( getd ( "$@quest_3_4_"+ .@b
) ) mes "---Items---";
while ( .@c <
getd ( "$@quest_3_4_"+ .@b
) ) {
}
if ( getd ( "$@quest_4_4_"+ .@b
) ) mes "---Variables---";
while ( .@c <
getd ( "$@quest_4_4_"+ .@b
) ) {
mes getd ( "$@quest_4_3_"+ .@b
+"_"+ .@c
) +" "+ getd ( "$@quest_4_2_"+ .@b
+"_"+ .@c
+"$" );
}
mes "Do you have the required?";
if ( .@d == 1 ) {
while ( .@c <
= getd ( "$@quest_1_4_"+ .@b
) ) {
if ( countitem ( getd ( "$@quest_1_1_"+ .@b
+"_"+ .@c
) ) <
getd ( "$@quest_1_2_"+ .@b
+"_"+ .@c
) ) {
set .@e,
getd ( "$@quest_1_2_"+ .@b
+"_"+ .@c
) - countitem ( getd ( "$@quest_1_1_"+ .@b
+"_"+ .@c
) );
mes "I'm sorry, but you need "+ .@e
+" "+ getitemname ( getd ( "$@quest_1_1_"+ .@b
+"_"+ .@c
) ) +" more.";
}
}
while ( .@c <
= getd ( "$@quest_2_4_"+ .@b
) ) {
if ( getd ( getd ( "$@quest_2_1_"+ .@b
+"_"+ .@c
+"$" ) ) <
getd ( "$@quest_2_3_"+ .@b
+"_"+ .@c
) ) {
set .@e,
getd ( "$@quest_2_3_"+ .@b
+"_"+ .@c
) - getd ( getd ( "$@quest_2_1_"+ .@b
+"_"+ .@c
+"$" ) );
mes "I'm sorry, but you need "+ getd ( "$@quest_2_3_"+ .@b
+"_"+ .@c
) +"^000000 "+ getd ( "$@quest_2_2_"+ .@b
+"_"+ .@c
+"$" ) +" more.";
}
}
if ( ! ( .@f ) ) {
mes "Here are your rewards!";
while ( .@c <
= getd ( "$@quest_1_4_"+ .@b
) ) {
delitem getd ( "$@quest_1_1_"+ .@b
+"_"+ .@c
),
getd ( "$@quest_1_2_"+ .@b
+"_"+ .@c
);
}
while ( .@c <
= getd ( "$@quest_2_4_"+ .@b
) ) {
setd getd ( "$@quest_2_1_"+ .@b
+"_"+ .@c
+"$" ),
getd ( getd ( "$@quest_2_1_"+ .@b
+"_"+ .@c
+"$" ) ) - getd ( "$@quest_2_3_"+ .@b
+"_"+ .@c
);
}
while ( .@c <
= getd ( "$@quest_3_4_"+ .@b
) ) {
getitem getd ( "$@quest_3_1_"+ .@b
+"_"+ .@c
),
getd ( "$@quest_3_2_"+ .@b
+"_"+ .@c
) ;
}
while ( .@c <
= getd ( "$@quest_4_4_"+ .@b
) ) {
setd getd ( "$@quest_2_1_"+ .@b
+"_"+ .@c
+"$" ),
getd ( getd ( "$@quest_2_1_"+ .@b
+"_"+ .@c
+"$" ) ) + getd ( "$@quest_4_3_"+ .@b
+"_"+ .@c
);
dispbottom "You earned "+ getd ( "$@quest_4_3_"+ .@b
+"_"+ .@c
) +" "+ getd ( "$@quest_4_2_"+ .@b
+"_"+ .@c
+"$" );
}
}
}
else mes "Well, come to see me when you're brave.";
}
if ( ! ( .@f
) ||
( .@d
== 2 ) ) close ;
}