Jump to content

Dark Theme was set as default for all members. Please report any issues here.

  • 0
Sign in to follow this  
hadiesyafiq

[NEED HELP] tr0n's Questboard SETUP GUIDE

Question

I got error when i setup..can someone teach me how to exactly setup this script

here link original https://raw.githubusercontent.com/HerculesWS/Hercules/stable/npc/custom/quests/questboard.txt

here i try to setup 

Quote

//===== Hercules Script ======================================
//= tr0n's Questboard
//===== By: ==================================================
//= tr0n
//===== Current Version: =====================================
//= 1.4.4
//===== Description: =========================================
//= Easily add collection and hunting quests.
//===== Additional Comments: =================================
// 1.0.0 Release
// 1.1.0 Added zeny reward
// 1.2.0 Rewrote checkmob and killcounter
// 1.3.1 Added level restriction
// 1.3.4 Added Reward Item Amount
// 1.4.4 Added Quest delay
//============================================================

prontera,129,215,5    script    Questboard    4_BOARD3,{
    if(c_run==1){
        mes "[^FF7700Questboard^000000]";
        mes "^0000FF"+getd("." + currentquest$ + "_collectionname$")+"^000000";
        mes "--------------------------------";
        for( set [email protected], 0; [email protected] < getarraysize(getd("."+ currentquest$ + "_collectionitem")); set [email protected],[email protected]+2) {
            mes "^FF0000"+getitemname(getd("."+currentquest$+"_collectionitem["[email protected]+"]"))+" - "+countitem(getd("."+currentquest$+"_collectionitem["[email protected]+"]"))+"/"+getd("."+currentquest$+"_collectionitem["+([email protected]+1)+"]")+" ea.^000000";
        }
        mes "--------------------------------";
        mes "[Reward]";
        mes "Item: ^0000FF"+((getd("." +currentquest$+"_collectionprize"))?getitemname(getd("." +currentquest$+"_collectionprize"))+" - "+getd("." +currentquest$+"_collectionamount")+" ea.^000000":"Nothing^000000");
        mes "Zeny: ^0000FF"+getd("." +currentquest$+"_collectionzeny")+"^000000";
        mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+0+"]")+"^000000";
        mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_collectionexp["+1+"]")+"^000000";
        next;
        if(select("Finish", "Abort") == 2){
            mes "[^FF7700Questboard^000000]";
            mes "Quest aborted.";
            set currentquest$, "";
            set c_run, 0;
            close;
        }
        goto L_checkitems;
    }

    if(h_run==1){
        mes "[^FF7700Questboard^000000]";
        mes "^0000FF"+getd("." + currentquest$ + "_huntingname$")+"^000000";
        mes "--------------------------------";
        for( set [email protected], 0; [email protected] < getarraysize(getd("."+ currentquest$ + "_huntingmob")); set [email protected],[email protected]+2) {
            set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]");
            mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["[email protected]+"]"))+" - "+getd(currentquest$+"_"[email protected]+"_"+([email protected]+1)+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+([email protected]+1)+"]")+" ea.^000000";
        }
        mes "--------------------------------";
        mes "[Reward]";
        mes "Item: ^0000FF"+((getd("." +currentquest$+"_huntingprize"))?getitemname(getd("." +currentquest$+"_huntingprize"))+" - "+getd("." +currentquest$+"_huntingamount")+" ea.^000000":"Nothing^000000");
        mes "Zeny: ^0000FF"+getd("." +currentquest$+"_huntingzeny")+"^000000";
        mes "Base EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+0+"]")+"^000000";
        mes "Job EXP: ^0000FF"+getd("." +currentquest$+"_huntingexp["+1+"]")+"^000000";
        next;
        if(select("Finish", "Abort") == 2){
            mes "[^FF7700Questboard^000000]";
            mes "Quest aborted.";
            for(set [email protected], 1; [email protected] < getarraysize(getd("."+currentquest$+"_huntingmob")); set [email protected],[email protected]+2){
                set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]");
                setd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount", 0);
            }
            set currentquest$, "";
            set h_run, 0;
            close;
        }
        goto L_checkmobs;
    }

L_questmenu:
    mes "[^FF7700Questboard^000000]";
    mes "Select category:";
    next;

    switch(select((.collection)?"Collection Quests":"",
                (.hunting)?"Hunting Quests":"",
                "Exit")) {
    case 1:
        set [email protected]$, "";
        for( set [email protected],0; [email protected] < .collectionquestcount; set [email protected],[email protected]+1) {
            if ([email protected]) set [email protected]$,[email protected]$+":";
            set [email protected]$, [email protected]$ + "[" + getd("." +([email protected]+1)+"_collectionmin") + " - " + getd("." +([email protected]+1)+"_collectionmax") + "] " + getd("." + ([email protected]+1) + "_collectionname$");
        }
        set [email protected],select([email protected]$);
        if(gettimetick(2) < getd([email protected] + "_collection_delay")){
            set [email protected]_left, getd([email protected] + "_collection_delay")-gettimetick(2);
            mes "[^FF7700Questboard^000000]";
            if([email protected]_left < 60) mes "You have to wait ^0000FF"[email protected]_left+" seconds^000000 to do this quest again.";
            if([email protected]_left < 3600) mes "You have to wait ^0000FF"[email protected]_left/60+" minutes^000000 to do this quest again.";
            mes "You have to wait ^0000FF"[email protected]_left/60/60+" hours^000000 to do this quest again.";
            close;
        }
        mes "[^FF7700Questboard^000000]";
        mes "^0000FF"+getd("." + [email protected] + "_collectionname$")+"^000000";
        mes "--------------------------------";
        for( set [email protected], 0; [email protected] < getarraysize(getd("."+ [email protected] + "_collectionitem")); set [email protected],[email protected]+2) {
            mes "^FF0000"+getitemname(getd("."[email protected]+"_collectionitem["[email protected]+"]"))+" - "+getd("."[email protected]+"_collectionitem["+([email protected]+1)+"]")+" ea.^000000";
        }
        mes "--------------------------------";
        mes "[Reward]";
        mes "Item: ^0000FF"+((getd("." [email protected]+"_collectionprize"))?getitemname(getd("." [email protected]+"_collectionprize"))+" - "+getd("." [email protected]+"_collectionamount")+" ea.^000000":"Nothing^000000");
        mes "Zeny: ^0000FF"+getd("." [email protected]+"_collectionzeny")+"^000000";
        mes "Base EXP: ^0000FF"+getd("." [email protected]+"_collectionexp["+0+"]")+"^000000";
        mes "Job EXP: ^0000FF"+getd("." [email protected]+"_collectionexp["+1+"]")+"^000000";
        next;
        if(select("Accept", "Decline") == 2){
            close;
        }
        if(BaseLevel >= getd("." [email protected]+"_collectionmin") && BaseLevel <= getd("." [email protected]+"_collectionmax"))
        {
            mes "[^FF7700Questboard^000000]";
            mes "Quest accepted.";
            set c_run, 1;
            set currentquest$, [email protected];
            close;
        }
        else
        {
            mes "[^FF7700Questboard^000000]";
            mes "You don't have the required";
            mes "level to do this quest.";
            close;
        }

    case 2:
        set [email protected]$, "";
        for( set [email protected],0; [email protected] < .huntingquestcount; set [email protected],[email protected]+1) {
            if ([email protected]) set [email protected]$,[email protected]$+":";
            set [email protected]$, [email protected]$ + "[" + getd("." +([email protected]+1)+"_huntingmin") + " - " + getd("." +([email protected]+1)+"_huntingmax") + "] " + getd("." + ([email protected]+1) + "_huntingname$");
        }
        set [email protected],select([email protected]$);
        if(gettimetick(2) < getd([email protected] + "_hunting_delay")){
            set [email protected]_left, getd([email protected] + "_hunting_delay")-gettimetick(2);
            mes "[^FF7700Questboard^000000]";
            if([email protected]_left < 60) mes "You have to wait ^0000FF"[email protected]_left+" seconds^000000 to do this quest again.";
            if([email protected]_left < 3600) mes "You have to wait ^0000FF"[email protected]_left/60+" minutes^000000 to do this quest again.";
            mes "You have to wait ^0000FF"[email protected]_left/60/60+" hours^000000 to do this quest again.";
            close;
        }
        mes "[^FF7700Questboard^000000]";
        mes "^0000FF"+getd("." + [email protected] + "_huntingname$")+"^000000";
        mes "--------------------------------";
        for( set [email protected], 0; [email protected] < getarraysize(getd("."+ [email protected] + "_huntingmob")); set [email protected],[email protected]+2) {
            mes "^FF0000"+strmobinfo(1,getd("."[email protected]+"_huntingmob["[email protected]+"]"))+" - "+getd("."[email protected]+"_huntingmob["+([email protected]+1)+"]")+" ea.^000000";
        }
        mes "--------------------------------";
        mes "[Reward]";
        mes "Item: ^0000FF"+((getd("." [email protected]+"_huntingprize"))?getitemname(getd("." [email protected]+"_huntingprize"))+" - "+getd("." [email protected]+"_huntingamount")+" ea.^000000":"Nothing^000000");
        mes "Zeny: ^0000FF"+getd("." [email protected]+"_huntingzeny")+"^000000";
        mes "Base EXP: ^0000FF"+getd("." [email protected]+"_huntingexp["+0+"]")+"^000000";
        mes "Job EXP: ^0000FF"+getd("." [email protected]+"_huntingexp["+1+"]")+"^000000";
        next;
        if(select("Accept", "Decline") == 2){
            close;
        }
        if(BaseLevel >= getd("." [email protected]+"_huntingmin") && BaseLevel <= getd("." [email protected]+"_huntingmax"))
        {
            mes "[^FF7700Questboard^000000]";
            mes "Quest accepted.";
            set h_run, 1;
            set currentquest$, [email protected];
            close;
        }
        else
        {
            mes "[^FF7700Questboard^000000]";
            mes "You don't have the required";
            mes "level to do this quest.";
            close;
        }
    case 3:
        close;
    }

L_checkitems:
    for( set [email protected],0; [email protected] < getarraysize(getd("."+currentquest$+"_collectionitem")); set [email protected],[email protected]+2) {
        if(countitem(getd("."+currentquest$+"_collectionitem["[email protected]+"]"))>=getd("."+currentquest$+"_collectionitem["+([email protected]+1)+"]")){
            set [email protected],[email protected]+2;
        }
    }
    if([email protected]<getarraysize(getd("."+currentquest$+"_collectionitem"))){
        mes "[^FF7700Questboard^000000]";
        mes "You don't have everything.";
        close;
    }
    for( set [email protected],0; [email protected] < getarraysize(getd("."+currentquest$+"_collectionitem")); set [email protected],[email protected]+2) {
        delitem getd("."+currentquest$+"_collectionitem["[email protected]+"]"),getd("."+currentquest$+"_collectionitem["+([email protected]+1)+"]");
    }
    mes "[^FF7700Questboard^000000]";
    mes "Congratulation! Here is your Reward.";
    if(getd("." +currentquest$+"_collectionprize")!=0) getitem(getd("." +currentquest$+"_collectionprize"),getd("." +currentquest$+"_collectionamount"));
    Zeny += getd("." +currentquest$+"_collectionzeny");
    getexp getd("." +currentquest$+"_collectionexp["+0+"]"),getd("." +currentquest$+"_collectionexp["+1+"]");
    setd(currentquest$ + "_collection_delay"),gettimetick(2)+.quest_delay;
    set currentquest$, "";
    set c_run, 0;
    close;

L_checkmobs:
    set [email protected], (getarraysize(getd("."+currentquest$+"_huntingmob"))/2);
    for(set [email protected], 1; [email protected] < getarraysize(getd("."+currentquest$+"_huntingmob")); set [email protected],[email protected]+2){
        set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]");
        if(getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")==getd("."+currentquest$+"_huntingmob["[email protected]+"]")){
            set [email protected], [email protected]+1;
            if([email protected][email protected]){
                goto L_checkmobs2;
            }
            continue;
        }
        goto L_checkmobs2;
    }

L_checkmobs2:
    if([email protected]<[email protected]){
        mes "[^FF7700Questboard^000000]";
        mes "You didn't kill everything.";
        close;
    }
    mes "[^FF7700Questboard^000000]";
    mes "Congratulation! Here is your Reward.";
    for(set [email protected], 1; [email protected] < getarraysize(getd("."+currentquest$+"_huntingmob")); set [email protected],[email protected]+2){
        set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]");
        setd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount", 0);
    }
    if(getd("." +currentquest$+"_huntingprize")!=0) getitem(getd("." +currentquest$+"_huntingprize"),getd("." +currentquest$+"_huntingamount"));
    Zeny += getd("." +currentquest$+"_huntingzeny");
    getexp getd("." +currentquest$+"_huntingexp["+0+"]"),getd("." +currentquest$+"_huntingexp["+1+"]");
    setd(currentquest$ + "_hunting_delay"),gettimetick(2)+.quest_delay;
    set currentquest$, "";
    set h_run, 0;
    close;

OnNPCKillEvent:
    if(h_run!=1) end;
    for(set [email protected], 1; [email protected] < getarraysize(getd("."+currentquest$+"_huntingmob")); set [email protected],[email protected]+2){
        if(killedrid==getd("."+currentquest$+"_huntingmob["+([email protected])+"]")){
            set [email protected], getd("."+currentquest$+"_huntingmob["+([email protected])+"]");
            if(getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")>=getd("."+currentquest$+"_huntingmob["[email protected]+"]")) end;
            setd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount", getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")+1);
            dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo(1,[email protected])+"] ("+ getd(currentquest$+"_"[email protected]+"_"[email protected]+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["[email protected]+"]")+")";
            end;
        }
        continue;
    }
    end;

OnInit:
    function AddCollection;
    function AddHunting;

    //Activate/Deactive quest categories here
    set .collection, 1;
    set .hunting, 1;

    //Quest Delay (seconds)
    //24 hours = 86400 seconds
    set .quest_delay, 0;

    //Checks if quests are loaded (prevents out of index)
    if(.questsloaded==1) end;
    set .questsloaded, 1;

    //Add Collection Quests here
    ("Test Collect",1,99,501,10,0,0,0,501,10,...);

    //Add Hunting Quests here
    ("Test Hunting",1,99,501,10,0,0,0,1002,10,...);

    end;

function AddCollection {
    set .collectionquestcount,.collectionquestcount+1;
    setd ("." +.collectionquestcount+"_collectionname$", getarg(0));
    setd ("." +.collectionquestcount+"_collectionmin", getarg(1));
    setd ("." +.collectionquestcount+"_collectionmax", getarg(2));
    setd ("." +.collectionquestcount+"_collectionprize", getarg(3));
    setd ("." +.collectionquestcount+"_collectionamount", getarg(4));
    setd ("." +.collectionquestcount+"_collectionzeny", getarg(5));
    set [email protected], 6;
    set [email protected], getarraysize(getd("."+ .collectionquestcount + "_collectionexp"));
    setd ("." +.collectionquestcount+"_collectionexp["[email protected]+"]",getarg([email protected]));
    setd ("." +.collectionquestcount+"_collectionexp["+([email protected]+1)+"]",getarg([email protected]+1));
    set [email protected], [email protected]+2;
    while(getarg([email protected],-1)!=-1 && getarg([email protected]+1,-1)!=-1) {
        set [email protected], getarraysize(getd("."+ .collectionquestcount + "_collectionitem"));
        setd ("."+.collectionquestcount+"_collectionitem["[email protected]+"]",getarg([email protected]));
        setd ("."+.collectionquestcount+"_collectionitem["+([email protected]+1)+"]",getarg([email protected]+1));
        set [email protected],[email protected]+2;
    }
    return;
}

function AddHunting {
    set .huntingquestcount,.huntingquestcount+1;
    setd ("." +.huntingquestcount+"_huntingname$", getarg(0));
    setd ("." +.huntingquestcount+"_huntingmin", getarg(1));
    setd ("." +.huntingquestcount+"_huntingmax", getarg(2));
    setd ("." +.huntingquestcount+"_huntingprize", getarg(3));
    setd ("." +.huntingquestcount+"_huntingamount", getarg(4));
    setd ("." +.huntingquestcount+"_huntingzeny", getarg(5));
    set [email protected], getarraysize(getd("."+ .huntingquestcount + "_huntingexp"));
    set [email protected], 6;
    setd ("." +.huntingquestcount+"_huntingexp["[email protected]+"]",getarg([email protected]));
    setd ("." +.huntingquestcount+"_huntingexp["+([email protected]+1)+"]",getarg([email protected]+1));
    set [email protected], [email protected]+2;
    while(getarg([email protected],-1)!=-1 && getarg([email protected]+1,-1)!=-1) {
        set [email protected], getarraysize(getd("."+ .huntingquestcount + "_huntingmob"));
        setd ("."+.huntingquestcount+"_huntingmob["[email protected]+"]",getarg([email protected]));
        setd ("."+.huntingquestcount+"_huntingmob["+([email protected]+1)+"]",getarg([email protected]+1));
        set [email protected], [email protected]+2;
    }
    return;
}
}

here my error

 

error.png

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 1

you're using the function wrong. Here 2 examples

AddCollection("<Test Collect>",1,99,501,10,0,0,0,501,10);
AddHunting("<Test Hunting>",1,99,501,10,0,0,0,1002,10);

 

Share this post


Link to post
Share on other sites
  • 0
7 hours ago, Ridley said:

you're using the function wrong. Here 2 examples

AddCollection("<Test Collect>",1,99,501,10,0,0,0,501,10);
AddHunting("<Test Hunting>",1,99,501,10,0,0,0,1002,10);

 

Its work thank you sir

Share this post


Link to post
Share on other sites
  • 0
8 hours ago, Ridley said:

you're using the function wrong. Here 2 examples

AddCollection("<Test Collect>",1,99,501,10,0,0,0,501,10);
AddHunting("<Test Hunting>",1,99,501,10,0,0,0,1002,10);

 

sir but how if i want add more required item like

red potion 10ea

yellow potion 10ea

blue potion 10ea

Share this post


Link to post
Share on other sites
  • 0

It's all explained inside the script

 

//AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...);

AddCollection("<Test Collect>",1,99,501,10,0,0,0,501,10);

you just add more items at the end

AddCollection("<Test Collect>",1,99,501,10,0,0,0,501,10,502,15,503,20);

 

Share this post


Link to post
Share on other sites
  • 0
35 minutes ago, Ridley said:

It's all explained inside the script

 

//AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...);

AddCollection("<Test Collect>",1,99,501,10,0,0,0,501,10);

you just add more items at the end

AddCollection("<Test Collect>",1,99,501,10,0,0,0,501,10,502,15,503,20);

 

thank you very much sir

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.