Jump to content
  • 0

help with chain quest


Kariton Revolution

Question


  • Group:  Members
  • Topic Count:  161
  • Topics Per Day:  0.04
  • Content Count:  429
  • Reputation:   5
  • Joined:  11/21/11
  • Last Seen:  

hi. im using emistry chain quest . is that possible that in the first quest the reward is the random drop of a treasure box ? how can i do that? :(

 

// NPC Name must have a Number behind it.  ex Name#1 , Name#2,...

prontera,155,181,5    script    Chained Quest#1    757,{
function    ChainedQuest;
mes "I am a Chained Quest NPC, you can only redo the previous Quest after you have finished all of my Quests.";
next;

// Quest Setup :
// ChainedQuest( Reward,Amount , Required Zeny, {Item1,Amount1,Item2,Amount2,...} );
switch( getd( "Quest"+strnpcinfo(2) ) ){
    Case 0: ChainedQuest( 5001,1, 10000, 607,10 );
    Case 1: ChainedQuest( 5002,1, 15000, 607,20, 608,20 );
    Case 2: ChainedQuest( 5003,1, 20000, 607,30, 608,30, 7539,30 );
//    Case 3: ChainedQuest( 5004,1, 25000, 607,40, 608,30, 7539,40 ,501,10 );
//    Case 4: ChainedQuest( 5005,1, 30000, 607,50, 608,30, 7539,50 ,501,10 ,502,10 );
//    Case 5: ChainedQuest(....);
//    Case 6: ChainedQuest(....);
default:
    mes "Congratulation ,You have finished all the Quest i gave you, you may Re-Do if you want.";
    set getd( "Quest"+strnpcinfo(2) ),0;
    close;
}

OnPCLoadMapEvent:
    showevent 1,0;
    end;

function    ChainedQuest    {
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        if( countitem( getarg( .@i ) ) < ( getarg( .@i + 1 )) ){
            mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
            mes "^00FF00_______________________________^000000";
            mes "^FF0000Reward^000000 : "+getarg(1)+" x ^0000FF"+getitemname( getarg(0) )+"^000000";
            mes "^00FF00_______________________________^000000";
            mes "then bring me those items :";
            mes "^00FF00_______________________________^000000";
            mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
            for( set .@a,3; getarg( .@a,0 ) != 0 ; set .@a,.@a + 2 ){
                mes (( countitem(getarg( .@a )) < ( getarg(.@a + 1 )) )? "^FF0000[ "+countitem(getarg(.@a))+" / "+(getarg(.@a+1)):"^0000FF[ "+getd( "Quest"+strnpcinfo(2) ) )+" ] "+getitemname(getarg(.@a))+"^000000 ";
                }
            close;
            }
        }
    if( Zeny < getarg( 2 ) ){
        mes "You required "+getarg( 2 )+" Zeny.";
        close;
        }
    mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
    mes "Look's like you have collected all";
    mes "^FF0000_______________________________^000000";
    mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        mes "^FF0000"+getarg( .@i+1 )+" x ^0000FF "+getitemname( getarg( .@i ) )+"^000000";
        }
    next;
    if( select("^0000FFContinue^000000:Cancel") == 2 ){
        mes "Okay..as you wish ~ come back again when you do continue it.";
        close;
        }
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
        delitem getarg( .@i ),getarg( .@i + 1 );
        }
    set Zeny,Zeny - getarg( 2 );
    set getd( "Quest"+strnpcinfo(2) ),getd( "Quest"+strnpcinfo(2) ) + 1;
    mes "You will be rewarded with ";
    mes "^0000FF_______________________________^000000";
    mes "^FF0000"+getarg(1)+"^000000 x ^0000FF"+getitemname( getarg(0) )+"^000000";
    mes "^0000FF_______________________________^000000";
    getitem getarg(0),getarg(1);
    close;
    }
}

prontera    mapflag    loadevent
Edited by Emistry
changed to code bbcode.
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

after

function    ChainedQuest;

insert:

setarray .TBOX[0],(INPUT ITEM ID HERE),(INPUT ITEM ID HERE),(INPUT ITEM ID HERE),(INPUT ITEM ID HERE);

sampe:

setarray .TBOX[0],501,502,503,504;

 

in case:

 Case 1: ChainedQuest(.TBOX[rand(getarraysize(.TBOX))]),1, 20000, 607,30, 608,30, 7539,30 );

hmmm im new in scripting but this might get the idea.
someone correct me if im wrong.

Edited by Lil Troll
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  276
  • Reputation:   24
  • Joined:  07/06/13
  • Last Seen:  

    // NPC Name must have a Number behind it. ex Name#1 , Name#2,...
     
    prontera,155,181,5 script Chained Quest#1 757,{
    function ChainedQuest;
    
    setarray .TBox[0],501,502,503,504;                        // Set TBOX
    setarray .Val[0],10,15,20,25;                             // Set Random Value of Requirements
    setarray .Zeny[0],2000000,2500000,3000000,3500000;        // Set Zeny Here
    setarray .Req[0],607,671,674,676,677;                     // Set Requirments Here
    setarray .Prize[0],1,2,3;                                 // Set Prize Value Here

    mes "I am a Chained Quest NPC, you can only redo the previous Quest after you have finished all of my Quests.";
    next;
     
    // Quest Setup :
    // ChainedQuest( Reward,Amount , Required Zeny, {Item1,Amount1,Item2,Amount2,...} );
    switch( getd( "Quest"+strnpcinfo(2) ) ){
    // Add Case if you want, just copy the format below:
    Case 0: ChainedQuest( .TBox,.Prize, .Zeny, .Req,.Val );
    Case 1: ChainedQuest( .TBox,.Prize, .Zeny, .Req,.Val, .Req,.Val );
    Case 2: ChainedQuest( .TBox,.Prize, .Zeny, .Req,.Val, .Req,.Val, .Req,.Val );
    
    default:
    mes "Congratulation ,You have finished all the Quest i gave you, you may Re-Do if you want.";
    set getd( "Quest"+strnpcinfo(2) ),0;
    close;
    }
     
    OnPCLoadMapEvent:
    showevent 1,0;
    end;
     
    function ChainedQuest {
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
    if( countitem( getarg( .@i ) ) < ( getarg( .@i + 1 )) ){
    mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
    mes "^00FF00_______________________________^000000";
    mes "^FF0000Reward^000000 : "+getarg(1)+" x ^0000FF"+getitemname( getarg(0) )+"^000000";
    mes "^00FF00_______________________________^000000";
    mes "then bring me those items :";
    mes "^00FF00_______________________________^000000";
    mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
    for( set .@a,3; getarg( .@a,0 ) != 0 ; set .@a,.@a + 2 ){
    mes (( countitem(getarg( .@a )) < ( getarg(.@a + 1 )) )? "^FF0000[ "+countitem(getarg(.@a))+" / "+(getarg(.@a+1)):"^0000FF[ "+getd( "Quest"+strnpcinfo(2) ) )+" ] "+getitemname(getarg(.@a))+"^000000 ";
    }
    close;
    }
    }
    if( Zeny < getarg( 2 ) ){
    mes "You required "+getarg( 2 )+" Zeny.";
    close;
    }
    mes "[ ^FF0000Part "+( getd( "Quest"+strnpcinfo(2) ) + 1 )+"^000000 ]";
    mes "Look's like you have collected all";
    mes "^FF0000_______________________________^000000";
    mes ( Zeny < getarg(2) ? "^FF0000":"^0000FF" )+getarg(2)+" Zeny^000000";
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
    mes "^FF0000"+getarg( .@i+1 )+" x ^0000FF "+getitemname( getarg( .@i ) )+"^000000";
    }
    next;
    if( select("^0000FFContinue^000000:Cancel") == 2 ){
    mes "Okay..as you wish ~ come back again when you do continue it.";
    close;
    }
    for( set .@i,3; getarg( .@i,0 ) != 0 ; set .@i,.@i + 2 ){
    delitem getarg( .@i ),getarg( .@i + 1 );
    }
    set Zeny,Zeny - getarg( 2 );
    set getd( "Quest"+strnpcinfo(2) ),getd( "Quest"+strnpcinfo(2) ) + 1;
    mes "You will be rewarded with ";
    mes "^0000FF_______________________________^000000";
    mes "^FF0000"+getarg(1)+"^000000 x ^0000FF"+getitemname( getarg(0) )+"^000000";
    mes "^0000FF_______________________________^000000";
    getitem getarg(0),getarg(1);
    close;
    }
	
OnTimer3600000:            // Every One Hour The NPC Will Re Shuffle What is needed.
npctalk "Re-Shuffled!";
set .TBox,.TBox[rand(getarraysize(.TBox))];
set .Zeny.Zeny[rand(getarraysize(.Zeny))];
set .Req,.Req[rand(getarraysize(.Req))];
set .Val,.Val[rand(getarraysize(.Val))];
set .Prize,.Prize[rand(getarraysize(.Prize))];

OnTimer3600100:
initnpctimer;
end;	
}
    prontera mapflag loadevent

If I got error then knows how to correct. Please tell me so, so that I would learn, im really new to scripting.

Here modified Chain Quest, Got new Arrays:

This is a very random chain quest.

The npc Reshuffle Random Stuff Every Hour. :D

    setarray .TBox[0],501,502,503,504;                        // Set TBOX
    setarray .Val[0],10,15,20,25;                             // Set Random Value of Requirements
    setarray .Zeny[0],2000000,2500000,3000000,3500000;        // Set Zeny Here
    setarray .Req[0],607,671,674,676,677;                     // Set Requirments Here
    setarray .Prize[0],1,2,3;                                 // Set Prize Value Here
Edited by Lil Troll
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...