yuhsing

Untitled

Dec 1st, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. // NPC Name must have a Number behind it. ex Name#1 , Name#2,...
  2.  
  3. prontera,156,182,1 script Chained Quest#1 100,{
  4. function ChainedQuest;
  5. if ( getd("Quest"+ strnpcinfo(2) +"today" ) != atoi( gettimestr("%Y%m%d", 9) ) ) {
  6. setd "Quest"+ strnpcinfo(2) +"today", atoi( gettimestr("%Y%m%d", 9) );
  7. setd "Quest"+ strnpcinfo(2), 0;
  8. setd "Quest"+ strnpcinfo(2) +"done", 0;
  9. }
  10. mes "I am a Chained Quest NPC, you can only redo the previous Quest after you have finished all of my Quests.";
  11. next;
  12.  
  13. // Quest Setup :
  14. // ChainedQuest( Reward,Amount , Required Zeny, {Item1,Amount1,Item2,Amount2,...} );
  15. switch ( getd( "Quest"+strnpcinfo(2) ) ) {
  16. case 0: ChainedQuest( 7959,5, 1, 501,2);
  17. case 1: ChainedQuest( 7959,5, 1, 502,3);
  18. default:
  19. mes "Congratulation ,You have finished all the Quest i gave you, you may Re-Do if you want.";
  20. setd "Quest"+ strnpcinfo(2),0;
  21. setd "Quest"+ strnpcinfo(2) +"done", 1;
  22.  
  23. if ( getd( "Quest"+ strnpcinfo(2) +"done" ) ) {
  24. getitem "Silver_Coin", 10;
  25. }else{
  26. getitem "Gold_Coin", 5;
  27. }
  28. close;
  29. }
  30.  
  31. OnPCLoadMapEvent:
  32. showevent 1,0;
  33. end;
  34.  
  35. function ChainedQuest {
  36. for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
  37. if( countitem( getarg( .@i ) ) < ( getarg( .@i + 1 )) ){
  38. mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
  39. mes "^00FF00_______________________________^000000";
  40. mes "^FF0000Reward^000000 : "+getarg(1)+" x ^0000FF"+getitemname( getarg(0) )+"^000000";
  41. mes "^00FF00_______________________________^000000";
  42. mes "then bring me those items :";
  43. mes "^00FF00_______________________________^000000";
  44. mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
  45. for( set .@a,3; getarg( .@a,0 ) != 0 ; set .@a,.@a + 2 ){
  46. mes (( countitem(getarg( .@a )) < ( getarg(.@a + 1 )) )? "^FF0000[ "+countitem(getarg(.@a))+" / "+(getarg(.@a+1)):"^0000FF[ "+getd( "Quest"+strnpcinfo(2) ) )+" ] "+getitemname(getarg(.@a))+"^000000 ";
  47. }
  48. close;
  49. }
  50. }
  51. if( Zeny < getarg( 2 ) ){
  52. mes "You required "+getarg( 2 )+" Zeny.";
  53. close;
  54. }
  55. mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
  56. mes "Look's like you have collected all";
  57. mes "^FF0000_______________________________^000000";
  58. mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
  59. for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
  60. mes "^FF0000"+getarg( .@i+1 )+" x ^0000FF "+getitemname( getarg( .@i ) )+"^000000";
  61. }
  62. next;
  63. if( select("^0000FFContinue^000000:Cancel") == 2 ){
  64. mes "Okay..as you wish ~ come back again when you do continue it.";
  65. close;
  66. }
  67. for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
  68. delitem getarg( .@i ),getarg( .@i + 1 );
  69. }
  70. set Zeny,Zeny - getarg( 2 );
  71. set getd( "Quest"+strnpcinfo(2) ),getd( "Quest"+strnpcinfo(2) ) + 1;
  72. mes "You will be rewarded with ";
  73. mes "^0000FF_______________________________^000000";
  74. mes "^FF0000"+getarg(1)+"^000000 x ^0000FF"+getitemname( getarg(0) )+"^000000";
  75. mes "^0000FF_______________________________^000000";
  76.  
  77. if ( getd( "Quest"+ strnpcinfo(2) +"done" ) ) {
  78. getitem "Silver_Coin", 10;
  79. }else{
  80. getitem getarg(0),getarg(1);
  81. }
  82. close;
  83. }
  84. }
  85.  
  86. prontera mapflag loadevent
Advertisement
Add Comment
Please, Sign In to add comment