Jump to content
  • 0

Quest Board Reward Change


Sallycantdance

Question


  • Group:  Members
  • Topic Count:  232
  • Topics Per Day:  0.14
  • Content Count:  812
  • Reputation:   12
  • Joined:  12/04/20
  • Last Seen:  

hello everyone i would like to ask for help in this script i want to change the reward instead of item and zeny i would like to make the reward to into both  items or more items instead

here is the script:

 

prontera,129,215,5        script          Questboard          821, {

    if(c_run==true){
        mes "[^FF7700Questboard^000000]";
        mes "^0000FF"+getd("." + currentquest$ + "_collectionname$")+"^000000";
        mes "--------------------------------";
        set .@size, getarraysize(getd("."+ currentquest$ + "_collectionitem"));
        for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
            mes "^FF0000"+getitemname(getd("."+currentquest$+"_collectionitem["+.@j+"]"))+" - "+countitem(getd("."+currentquest$+"_collectionitem["+.@j+"]"))+"/"+getd("."+currentquest$+"_collectionitem["+(.@j+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, false;
            close;
        }
        goto L_checkitems;
    }

    if(h_run==true){
        mes "[^FF7700Questboard^000000]";
        mes "^0000FF"+getd("." + currentquest$ + "_huntingname$")+"^000000";
        mes "--------------------------------";
        set .@size, getarraysize(getd("."+ currentquest$ + "_huntingmob"));
        for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
            set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@j)+"]");
            mes "^FF0000"+strmobinfo(1,getd("."+currentquest$+"_huntingmob["+.@j+"]"))+" - "+getd(currentquest$+"_"+.@currentmob+"_"+(.@j+1)+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+(.@j+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 .@x, 1; .@x < .@size; set .@x,.@x+2){
                set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@x-1)+"]");
                setd(currentquest$+"_"+.@currentmob+"_"+.@x+"_killcount", 0);
            }
            set currentquest$, "";
            set h_run, false;
            close;
        }
        goto L_checkmobs;
    }

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

    switch(select((.collection)?"Collection Quests":"",
                  (.hunting)?"Hunting Quests":"",
                  "Exit")) {

    case 1:
        set .@collectmenu$, "";
        for( set .@i,0; .@i < .collectionquestcount; set .@i,.@i+1){
            if (.@i) set .@collectmenu$,.@collectmenu$+":";
            set .@collectmenu$, .@collectmenu$ + "[" + getd("." +(.@i+1)+"_collectionmin") + " - " + getd("." +(.@i+1)+"_collectionmax") + "] " + getd("." + (.@i+1) + "_collectionname$");
        }
        set .@selection,select(.@collectmenu$);
        if(.quest_repeat == true){
            if(gettimetick(2) < getd(.@selection + "_collection_delay")){
                mes "[^FF7700Questboard^000000]";
                mes "You have to wait ^0000FF"+Time2Str(getd(.@selection + "_collection_delay"))+"^000000 to do this quest again.";
                close;
            }
        }
        else{
            if(getd(.@selection + "_collection_repeat") == true){
                mes "[^FF7700Questboard^000000]";
                mes "You already did this quest.";
                mes "Please choose another one.";
                close;
            }
        }
        mes "[^FF7700Questboard^000000]";
        mes "^0000FF"+getd("." + .@selection + "_collectionname$")+"^000000";
        mes "--------------------------------";
        set .@size, getarraysize(getd("."+ .@selection + "_collectionitem"));
        for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
            mes "^FF0000"+getitemname(getd("."+.@selection+"_collectionitem["+.@j+"]"))+" - "+getd("."+.@selection+"_collectionitem["+(.@j+1)+"]")+" ea.^000000";
        }
        mes "--------------------------------";
        mes "[Reward]";
        mes "Item: ^0000FF"+((getd("." +.@selection+"_collectionprize"))?getitemname(getd("." +.@selection+"_collectionprize"))+" - "+getd("." +.@selection+"_collectionamount")+" ea.^000000":"Nothing^000000");
        mes "Zeny: ^0000FF"+getd("." +.@selection+"_collectionzeny")+"^000000";
        mes "Base EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+0+"]")+"^000000";
        mes "Job EXP: ^0000FF"+getd("." +.@selection+"_collectionexp["+1+"]")+"^000000";
        next;
        if(select("Accept:Decline") == 2){
            close;
        }
        if(BaseLevel >= getd("." +.@selection+"_collectionmin") && BaseLevel <= getd("." +.@selection+"_collectionmax")){
            mes "[^FF7700Questboard^000000]";
            mes "Quest accepted.";
            set c_run, true;
            set currentquest$, .@selection;
            close;
        }
        else{
            mes "[^FF7700Questboard^000000]";
            mes "You don't have the required";
            mes "level to do this quest.";
            close;
        }

    case 2:
        set .@huntmenu$, "";
        for( set .@i,0; .@i < .huntingquestcount; set .@i,.@i+1){
            if (.@i) set .@huntmenu$,.@huntmenu$+":";
            set .@huntmenu$, .@huntmenu$ + "[" + getd("." +(.@i+1)+"_huntingmin") + " - " + getd("." +(.@i+1)+"_huntingmax") + "] " + getd("." + (.@i+1) + "_huntingname$");
        }
        set .@selection,select(.@huntmenu$);
        if(.quest_repeat == true){
            if(gettimetick(2) < getd(.@selection + "_hunting_delay")){
                mes "[^FF7700Questboard^000000]";
                mes "You have to wait ^0000FF"+Time2Str(getd(.@selection + "_hunting_delay"))+"^000000 to do this quest again.";
                close;
            }
        }
        else{
            if(getd(.@selection + "_hunting_repeat") == true){
                mes "[^FF7700Questboard^000000]";
                mes "You already did this quest.";
                mes "Please choose another one.";
                close;
            }
        }
        mes "[^FF7700Questboard^000000]";
        mes "^0000FF"+getd("." + .@selection + "_huntingname$")+"^000000";
        mes "--------------------------------";
        set .@size, getarraysize(getd("."+ .@selection + "_huntingmob"));
        for( set .@j, 0; .@j < .@size; set .@j,.@j+2){
            mes "^FF0000"+strmobinfo(1,getd("."+.@selection+"_huntingmob["+.@j+"]"))+" - "+getd("."+.@selection+"_huntingmob["+(.@j+1)+"]")+" ea.^000000";
        }
        mes "--------------------------------";
        mes "[Reward]";
        mes "Item: ^0000FF"+((getd("." +.@selection+"_huntingprize"))?getitemname(getd("." +.@selection+"_huntingprize"))+" - "+getd("." +.@selection+"_huntingamount")+" ea.^000000":"Nothing^000000");
        mes "Zeny: ^0000FF"+getd("." +.@selection+"_huntingzeny")+"^000000";
        mes "Base EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+0+"]")+"^000000";
        mes "Job EXP: ^0000FF"+getd("." +.@selection+"_huntingexp["+1+"]")+"^000000";
        next;
        if(select("Accept:Decline") == 2){
            close;
        }
        if(BaseLevel >= getd("." +.@selection+"_huntingmin") && BaseLevel <= getd("." +.@selection+"_huntingmax")){
            mes "[^FF7700Questboard^000000]";
            mes "Quest accepted.";
            set h_run, true;
            set currentquest$, .@selection;
            close;
        }
        else{
            mes "[^FF7700Questboard^000000]";
            mes "You don't have the required";
            mes "level to do this quest.";
            close;
        }

    case 3:
        close;
    }

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

L_checkmobs:
    set .@size, getarraysize(getd("."+currentquest$+"_huntingmob"));
    set .@goal, .@size/2;
    for(set .@i, 1; .@i < .@size; set .@i,.@i+2){
        set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]");
        if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")==getd("."+currentquest$+"_huntingmob["+.@i+"]")){
            set .@checkmonster, .@checkmonster+1;
            if(.@checkmonster==.@goal){
                goto L_checkmobs2;
            }
            continue;
        }
        goto L_checkmobs2;
    }

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

OnNPCKillEvent:
    if(h_run!=true) end;
    set .@size, getarraysize(getd("."+currentquest$+"_huntingmob"));
    for(set .@i, 1; .@i < .@size; set .@i,.@i+2){
        if(killedrid==getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]")){
            set .@currentmob, getd("."+currentquest$+"_huntingmob["+(.@i-1)+"]");
            if(getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")<getd("."+currentquest$+"_huntingmob["+.@i+"]")){
                setd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+1);
                dispbottom getd("."+currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+ getd(currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount")+"/"+getd("."+currentquest$+"_huntingmob["+.@i+"]")+")";
            }
            if(getcharid(1) != 0 && .party_support == true){
                getmapxy(.@map1$,.@x1,.@y1);
                set .@killerid, getcharid(3);
                set .@currentquest$, currentquest$;
                getpartymember getcharid(1),1;
                getpartymember getcharid(1),2;
                for(set .@j, 0; .@j < $@partymembercount; .@j++){
                    if(isloggedin($@partymemberaid[.@j], $@partymembercid[.@j])){
                        if(h_run==true && $@partymemberaid[.@j] != .@killerid && .@currentquest$ == getvar(currentquest$, $@partymembercid[.@j]) && readparam(HP, $@partymembercid[.@j]) > 0){
                            getmapxy(.@map2$,.@x2,.@y2,BL_PC,rid2name($@partymemberaid[.@j]));
                            if(.@map1$ == .@map2$ && distance(.@x1,.@y1,.@x2,.@y2) < .party_range){
                                set .@kill_amt,getvar(getd(.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount"), $@partymembercid[.@j]);
                                set .@kill_goal,getd("."+.@currentquest$+"_huntingmob["+.@i+"]");
                                if(.@kill_amt<.@kill_goal)
                                {
                                    setd(.@currentquest$+"_"+.@currentmob+"_"+.@i+"_killcount", .@kill_amt+1, $@partymembercid[.@j]);
                                    dispbottom getd("."+.@currentquest$+"_huntingname$")+": ["+strmobinfo(1,.@currentmob)+"] ("+(.@kill_amt+1)+"/"+.@kill_goal+")", 0xB6FF00, $@partymembercid[.@j];
                                }
                            }
                        }
                    }
                }
            }
            break;
        }
    }
    end;

OnInit:

    function AddCollection;
    function AddHunting;

    //Activate/Deactivate quest categories (true/1 - activated, false/0 - deactivated)
    set .collection, true;
    set .hunting, true;

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

    //Activate/Deactivate repeatable quests (true/1 - activated, false/0 - deactivated)
    set .quest_repeat, true;

    //Activate/Deactivate party support (true/1 - activated, false/0 - deactivated)
    set .party_support, true;

    //Max range for party support (+- x & y coordinations)
    set .party_range, 25;

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

    //Add Collection Quests here (You can add as many required items as you want)
    //AddCollection("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Item ID>,<Item Amount>,...);

    AddCollection "Resin & Mushroom Spore",1,98,0,0,0,2000000,1000000,907,100,921,100;
    AddCollection "Bill of Bird & Desert Wolf Claw",1,98,0,0,0,2000000,1000000,925,100,920,100;
    AddCollection "Anolian Skin & Brigan",1,98,0,0,0,2000000,1000000,7003,100,7054,100;

    //Add Hunting Quests here (You can add as many required mobs as you want)
    //AddHunting("<Quest Name>",<Min Lvl>,<Max Lvl>,<Reward|Item ID>,<Reward|Item Amount>,<Zeny Reward>,<Base EXP>,<Job EXP>,<Monster ID>,<Monster Amount>,...);

    AddHunting "Prontera Hunting",1,98,0,0,0,2000000,1000000,1051,20,1608,20,1053,20,1020,20,1118,20;
    AddHunting "Payon Hunting",1,98,0,0,0,2000000,1000000,1013,20,1025,20,1277,20,1110,20,1116,20;
    AddHunting "Morocc Hunting",1,98,0,0,0,2000000,1000000,1005,20,1097,20,1165,20,1111,20,1040,20;
    AddHunting "Alberta Hunting",1,98,0,0,0,2000000,1000000,1070,20,1066,20,1068,20,1144,20,1067,20;
    AddHunting "Izlude Hunting",1,98,0,0,0,2000000,1000000,1019,20,1106,20,1095,20,1050,20,1047,20;
    AddHunting "Geffen Hunting",1,98,0,0,0,2000000,1000000,1008,20,1018,20,1133,20,1128,20,1077,20;
    AddHunting "Alde Baran Hunting",1,98,0,0,0,2000000,1000000,1114,20,1215,20,1199,30;
    AddHunting "Juno Hunting",1,98,0,0,0,2000000,1000000,8237,20,1372,30,1378,20;
    AddHunting "Comodo Hunting",1,98,0,0,0,2000000,1000000,1166,20,1317,20,1064,10;
    AddHunting "Lutie Hunting",1,98,0,0,0,2000000,1000000,1246,20,1242,20,1243,10;
    AddHunting "Ayothaya Hunting",1,98,0,0,0,2000000,1000000,1494,20,1499,20,1586,10;
    AddHunting "Amatsu Hunting",1,98,0,0,0,2000000,1000000,1400,20,1406,20,1404,10;
    AddHunting "Kunlun Hunting",1,98,0,0,0,2000000,1000000,1417,20,1410,20,1415,10;
    AddHunting "Lou Yang Hunting",1,98,0,0,0,2000000,1000000,1517,20,1381,20,1512,10;
    AddHunting "Umbala Hunting",1,98,0,0,0,2000000,1000000,1498,20,1495,20,1497,10;
    AddHunting "Niflheim Hunting",1,98,0,0,0,2000000,1000000,1506,20,1503,20,1504,10,1505,10,1507,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 .@argcount, 6;
        set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionexp"));
        setd ("." +.collectionquestcount+"_collectionexp["+.@size+"]",getarg(.@argcount)); 
        setd ("." +.collectionquestcount+"_collectionexp["+(.@size+1)+"]",getarg(.@argcount+1)); 
        set .@argcount, .@argcount+2;
        set .@size, getarraysize(getd("."+ .collectionquestcount + "_collectionitem"));
        while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){
            setd ("."+.collectionquestcount+"_collectionitem["+.@size+"]",getarg(.@argcount)); 
            setd ("."+.collectionquestcount+"_collectionitem["+(.@size+1)+"]",getarg(.@argcount+1));
            set .@argcount,.@argcount+2;
            set .@size, .@size+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 .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingexp"));
        set .@argcount, 6;
        setd ("." +.huntingquestcount+"_huntingexp["+.@size+"]",getarg(.@argcount));
        setd ("." +.huntingquestcount+"_huntingexp["+(.@size+1)+"]",getarg(.@argcount+1)); 
        set .@argcount, .@argcount+2;
        set .@size, getarraysize(getd("."+ .huntingquestcount + "_huntingmob"));
        while(getarg(.@argcount,-1)!=-1 && getarg(.@argcount+1,-1)!=-1){
            setd ("."+.huntingquestcount+"_huntingmob["+.@size+"]",getarg(.@argcount)); 
            setd ("."+.huntingquestcount+"_huntingmob["+(.@size+1)+"]",getarg(.@argcount+1));
            set .@argcount, .@argcount+2;
            set .@size, .@size+2;
        }
        return;
    }
}

 

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...