Jump to content
  • 0

Script Combining HELP ME!


nasagnilac

Question


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

Hi I just want to know how can I combine this scripts?

//===== eAthena Script =======================================
//= Euphy's Quest Shop
//===== By: ==================================================
//= Euphy
//===== Current Version: =====================================
//= 1.4a - eAthena
//===== Description: =========================================
//= A dynamic quest shop based on Lunar's, with easier config.
//= Includes support for multiple shops & cashpoints.
//= Item Preview script by ToastOfDoom.
//============================================================
                    
mellina,63,62,6    script    Quest Board    857,{
function Add; function Chk; function Slot; function A_An;

    if(.Shops$ != "") set .@i,1;
    else {
        set .@menu$,"";
        for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1)
            set .@menu$, .@menu$+.Shops$[.@i]+":";
        set .@i, select(.@menu$); }
    dispbottom "Select one item at a time.";
    callshop "qshop"+.@i,1;
    npcshopattach "qshop"+.@i;
    end;

function Add {
    if (getitemname(getarg(1))=="null") {
        debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; }
    for(set .@n,5; .@n<127; set .@n,.@n+2) {
        if (!getarg(.@n,0)) break;
        if (getitemname(getarg(.@n))=="null") {
            debugmes "Quest requirement #"+getarg(.@n)+" invalid (skipped)."; return; } }
    for(set .@i,2; .@i<.@n; set .@i,.@i+1)
        set getd(".q_"+getarg(1)+"["+(.@i-2)+"]"), getarg(.@i);
    npcshopadditem "qshop"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0);
    sleep 1;
    return; }
function Chk {
    if (getarg(0)<getarg(1)) { set @qe0,1; return "^FF0000"; }
    else return "^00FF00"; }
function Slot {
    set .@s$,getitemname(getarg(0));
    switch(.ShowSlot){
        case 1: if (!getitemslots(getarg(0))) return .@s$;
        case 2: if (getiteminfo(getarg(0),11)>0) return .@s$+" ["+getitemslots(getarg(0))+"]";
        default: return .@s$; } }
function A_An {
    setarray .@A$[0],"a","e","i","o","u";
    set .@B$, "_"+getarg(0);
    for(set .@i,0; .@i<5; set .@i,.@i+1)
        if (compare(.@B$,"_"+.@A$[.@i])) return "an "+getarg(0);
    return "a "+getarg(0); }

OnBuyItem:
    set .@q[0],@bought_nameid;
    copyarray .@q[1],getd(".q_"+@bought_nameid+"[0]"),getarraysize(getd(".q_"+@bought_nameid+"[0]"));
    if (!.@q[1]) { message strcharinfo(0),"An error has occurred."; end; }
    mes "[Quest Board]";
    mes "Reward: ^0055FF"+((.@q[1]>1)?.@q[1]+"x ":"")+Slot(.@q[0])+"^000000";
    mes "Requirements:";
    if (.@q[2]) mes " > "+Chk(Zeny,.@q[2])+.@q[2]+" Zeny^000000";
    if (.@q[3]) mes " > "+Chk(getd(.Points$[0]),.@q[3])+.@q[3]+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+.@q[3]+")^000000";
    if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2)
        mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1])+((.DisplayID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+.@q[.@i+1]+")^000000";
    next;
    set @qe1, getiteminfo(.@q[0],5); set @qe2, getiteminfo(.@q[0],11);
    addtimer 1000, strnpcinfo(1)+"::OnEnd";
    while(1){
        switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((((@qe1&1) || (@qe1&256) || (@qe1&512)) && @qe2>0 && !@qe6)?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) {
            case 1:
                if (@qe0) {
                    mes "[Quest Board]";
                    mes "You're missing one or more quest requirements.";
                    close; }
                if (!checkweight(.@q[0],.@q[1])) {
                    mes "[Quest Board]";
                    mes "^FF0000You need "+(((.@q[1]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000";
                    close; }
                if (.@q[2]) set Zeny, Zeny-.@q[2];
                if (.@q[3]) setd .Points$[0], getd(.Points$[0])-.@q[3];
                if (.@q[4]) for(set .@i,4; .@i<getarraysize(.@q); set .@i,.@i+2)
                    delitem .@q[.@i],.@q[.@i+1];
                getitem .@q[0],.@q[1];
                if (.Announce) announce strcharinfo(0)+" has created "+A_An(getitemname(.@q[0]))+"!",0;
                specialeffect2 699;
                close;
            case 2:
                set @qe3, getlook(3); set @qe4, getlook(4); set @qe5, getlook(5);
                if (@qe1&1) atcommand "@changelook 3 "+@qe2;
                if (@qe1&256) atcommand "@changelook 1 "+@qe2;
                if (@qe1&512) atcommand "@changelook 2 "+@qe2;
                set @qe6,1;
                break;
            case 3:
                close; } }
OnEnd:
    if (@qe6) { atcommand "@changelook 3 "+@qe3; atcommand "@changelook 1 "+@qe4; atcommand "@changelook 2 "+@qe5; }
    for(set .@i,0; .@i<7; set .@i,.@i+1) setd "@qe"+.@i,0;
    end;
OnInit:
// --------------------- Config ---------------------
// Custom points, if needed: "<variable>","<name to display>"
    setarray .Points$[0],"#CASHPOINTS","Cash Points";

    set .Announce,1;    // Announce quest completion? (1: yes / 0: no)
    set .ShowSlot,2;    // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never)
    set .DisplayID,0;    // Show item IDs? (1: yes / 0: no)
    set .ShowZeny,0;    // Show Zeny cost, if any? (1: yes / 0: no)

// Shop categories, if needed: "<Shop 1>","<Shop 2>"{,...};
// Duplicate dummy data for any additional shops (bottom of script).
// If no categories, use the second line instead (remove //).

    setarray .Shops$[1],"Headgear's [Set A]","Headgear's [Set B]";
    //set .Shops$,"n/a";

// Add(<shop number>,<reward ID>,<reward amount>,<Zeny cost>,<point cost>,
//     <required item ID>,<required item amount>{,...});
// Shop number corresponds with order above (default is 1).
// Note: Do NOT use a reward item more than once!

//A         
    Add(1,5137,1,1000000,0,4253,1,5141,1,661,10,25001,3);
    Add(1,5766,1,4000000,0,7107,250,7106,250,25001,3);
    Add(1,5132,1,7500000,0,5035,1,5074,1,25001,3);
    Add(1,5490,1,7500000,0,1045,200,1009,25,724,25,7442,25,25001,3);
    Add(1,5513,1,7500000,0,2235,1,995,200,7446,200,25001,3);
    Add(1,5512,1,7500000,0,5124,1,995,200,7446,200,25001,3);
    Add(1,5319,1,3000000,0,5035,1,978,2,2254,1,25001,3);
    Add(1,5546,1,7500000,0,2235,1,994,200,730,100,25001,3);
    Add(1,5545,1,7500000,0,5124,1,994,200,730,100,25001,3);
    Add(1,5505,1,3000000,0,7568,200,982,2,1022,100,1038,50,25001,3);
    Add(1,5312,1,7500000,0,7567,300,983,1,1005,50);
//B
    Add(1,5491,1,4500000,0,2221,1,2336,1,724,50,25001,3);
    Add(1,5147,1,3000000,0,2227,1,978,1,1057,300,25001,3);
    Add(1,5382,1,7500000,0,969,10,10016,1,5083,1,25001,3);
    Add(1,5129,1,3000000,0,604,100,916,200,25001,3);
    Add(1,5183,1,3000000,0,604,100,916,200,25001,3);
    Add(1,5427,1,3000000,0,6021,200,7567,200,2221,1,983,1,981,1,4127,1,25001,3);
    Add(1,5102,1,3000000,0,7263,100,2276,1,2239,2,982,5,25001,3);
    Add(1,5773,1,6000000,0,5172,1,978,5,25001,3);
    Add(1,5404,1,7500000,0,5085,1,978,3,981,3,25001,3);
    Add(1,5800,1,20000000,0,5040,1,924,300,739,50,25001,3);
    Add(1,5398,1,4500000,0,1035,100,1036,100,7451,5,25001,3);
    Add(1,5378,1,7500000,0,2241,1,5045,1,975,1,740,200,25001,3);
//C
    Add(1,5414,1,3000000,0,7098,50,604,50,1019,50,994,20,25001,3);
    Add(1,5582,1,7500000,0,2235,1,991,200,7446,200,25001,3);
    Add(1,5581,1,7500000,0,5124,1,991,200,7446,200,25001,3);
    Add(1,5744,1,7500000,0,2235,1,993,200,7445,200,25001,3);
    Add(1,5745,1,7500000,0,5124,1,993,200,7445,200,25001,3);
    Add(1,5184,1,4500000,0,5120,5,995,100,983,1,25001,3);
    Add(1,5283,1,4500000,0,916,300,7063,100,4117,1,25001,3);
    Add(1,5478,1,3000000,0,980,5,2221,1,25001,3);
    Add(1,5131,1,7500000,0,7095,100,6090,100,999,100,2228,1,25001,3);
    Add(1,5260,1,3000000,0,975,5,2221,1,4235,1,25001,3);
    Add(1,5142,1,4500000,0,5172,1,1234,1,25001,3);
    Add(1,5135,1,3000000,0,5104,1,969,1,975,1,980,5,999,250,25001,3);
//D
    Add(1,5655,1,7500000,0,5347,1,975,1,981,1,983,1,7169,3,25001,3);
    Add(1,5254,1,4500000,0,2221,1,981,3,983,1,2255,1,1039,50,25001,3);
    Add(1,5298,1,2000000,0,1021,300,7268,1,25001,3);
    Add(1,5258,1,3000000,0,1021,100,978,1,976,1,975,1,10003,1,25001,3);
    Add(1,5296,1,4500000,0,976,1,1022,200,754,5,25001,3);
    Add(1,5211,1,1050000,0,10007,1,5045,1,25001,3);
//E
    Add(1,5304,1,7500000,0,7017,5,2288,1,981,1,983,1,25001,3);
    Add(1,5470,1,7500000,0,2295,1,981,1,982,1,25001,3);
//F
    Add(1,5276,1,4500000,0,982,1,981,1,975,1,4044,1,25001,3);
    Add(1,5380,1,4500000,0,1054,20,1023,100,579,200,25001,3);
    Add(1,5403,1,4500000,0,579,200,1023,100,624,50,25001,3);
    Add(1,5317,1,6000000,0,5120,2,976,5,1059,100,25001,3);
    Add(1,5447,1,4500000,0,918,300,1061,100,25001,3);
    Add(1,5390,1,3000000,0,2236,2,978,1,1034,100,998,30,25001,3);
//G
    Add(1,5361,1,7500000,0,7216,1000,10019,1,25001,3);
    Add(1,5377,1,20000000,0,2268,1,7035,20,25001,3);
    Add(1,5570,1,7500000,0,2235,1,996,100,7445,100,25001,3);
    Add(1,5569,1,7500000,0,5124,1,996,100,7445,100,25001,3);
    Add(1,5476,1,7500000,0,7101,300,2210,1,25001,3);
    Add(1,5660,1,9000000,0,7048,30,25001,3);
    Add(1,5544,1,3000000,0,6021,100,7567,100,2221,1,979,1,25001,3);
//H
    Add(1,5273,1,4500000,0,979,1,975,1,982,1,25001,3);
    Add(1,5181,1,6000000,0,7754,1,25001,3);
    Add(1,5467,1,9000000,0,1036,100,7123,100,1037,100,7451,5,25001,3);
    Add(1,5139,1,3000000,0,748,100,5061,1,25001,3);
    Add(1,5225,1,1200000,0,2261,1,978,1,7063,50,983,1,25001,3);
    Add(1,5383,1,7500000,0,979,1,7445,150,1059,100,25001,3);
//I
    Add(1,5610,1,7500000,0,5074,1,995,50,25001,3);
    Add(1,5500,1,15000000,0,536,500,25001,3);
//J
    Add(1,5371,1,2000000,0,7445,7,7446,7,7447,7,7448,7,945,100,983,1,733,5,25001,3);
//K
    Add(1,5143,1,7500000,0,1034,500,982,1,25001,3);
    Add(1,5426,1,3000000,0,6021,100,7567,100,2221,1,980,5,975,5,25001,3);
    Add(1,5291,1,4500000,0,7323,500,25001,3);
//L
    Add(1,5555,1,4500000,0,521,200,7298,100,4195,1,25001,3);
    Add(1,5418,1,7500000,0,5016,1,1098,200,975,5,1004,10,25001,3);
    Add(1,5588,1,7500000,0,2235,1,994,100,7446,100,25001,3);
    Add(1,5589,1,7500000,0,5124,1,994,100,7446,100,25001,3);
    Add(1,5662,1,7500000,0,2235,1,6075,100,7445,200,25001,3);
    Add(1,5663,1,7500000,0,5124,1,6075,100,7445,200,25001,3);
    Add(1,5422,1,3000000,0,1550,2,1006,5,25001,3);
    Add(1,5130,1,3000000,0,1048,100,7564,150,517,50,25001,3);
    Add(1,5489,1,4500000,0,994,100,976,1,5016,1,25001,3);
    Add(1,5562,1,7500000,0,2206,1,1059,200,7751,200,25001,3);
//M
    Add(2,5365,1,2250000,0,574,150,7031,150,25001,3);
    Add(1,5503,1,7500000,0,5045,1,2214,1,25001,3);
    Add(2,5275,1,4500000,0,975,1,982,2,981,1,25001,3);
    Add(2,5402,1,6000000,0,2286,1,6395,25,25001,3);
    Add(2,5214,1,7500000,0,1022,500,2221,1,25001,3);

//N
    Add(2,5442,1,7500000,0,7166,100,978,2,25001,3);
    Add(2,5502,1,4500000,0,2532,1,7752,100,25001,3);
    Add(2,5099,1,7500000,0,7197,300,7171,300,949,100,25001,3);
    Add(2,5362,1,7500000,0,4230,1,618,1000,25001,3);

    Add(2,5469,1,4500000,0,2221,1,975,1,976,1,7063,50,25001,3);
    Add(2,5151,1,7500000,0,5001,1,978,1,991,200,25001,3);
//O
    Add(2,5315,1,6000000,0,2239,1,25001,3);
    Add(2,5554,1,4500000,0,962,100,1024,100,25001,3);
//P
    Add(2,5468,1,7500000,0,1059,300,5172,2,2244,1,25001,3);
    Add(2,5519,1,2000000,0,7115,200,2229,1,7441,25,7440,25,25001,3);
    Add(2,5358,1,2000000,0,7101,150,5074,1,25001,3);
    Add(2,5305,1,7500000,0,2287,1,5096,1,2265,1,6091,1,982,5,7063,100,25001,3);
    Add(2,5515,1,7500000,0,2235,1,1023,200,991,100,25001,3);
    Add(2,5514,1,7500000,0,5124,1,1023,200,991,100,25001,3);
    Add(2,5413,1,4500000,0,1026,200,4098,1,25001,3);
    Add(2,5352,1,2000000,0,5035,1,979,1,938,100,25001,3);
    Add(2,5495,1,6000000,0,7063,50,5074,1,25001,3);
    Add(2,5182,1,7500000,0,5008,1,5118,1,1060,100,25001,3);
    Add(2,5409,1,7500000,0,981,1,5075,1,25001,3);
//R
    Add(2,5795,1,4500000,0,5045,1,975,1,982,1,25001,3);
    Add(2,5435,1,4500000,0,6021,100,7567,100,2221,1,975,5,4127,1,25001,3);
    Add(2,5690,1,6000000,0,5172,1,2254,1,975,1,7166,120,25001,3);
    Add(2,5208,1,3000000,0,1550,1,1556,1,4185,1,25001,3);
    Add(2,5206,1,4500000,0,2269,1,982,1,2207,10,25001,3);
//S
    Add(2,5739,1,7500000,0,2235,1,994,50,969,3,25001,3);
    Add(2,5740,1,7500000,0,5124,1,994,50,969,3,25001,3);
    Add(2,5524,1,7500000,0,2227,1,7567,100,25001,3);
    Add(2,5523,1,9500000,0,710,50,5123,1,2614,1,25001,3);
    Add(2,5381,1,7500000,0,741,1,9001,1,2236,1,25001,3);
    Add(2,5212,1,4500000,0,5011,1,2210,1,25001,3);
    Add(2,5548,1,3000000,0,2269,5,25001,3);
    Add(2,5676,1,7500000,0,2235,1,993,100,7448,100,904,100,25001,3);
    Add(2,5677,1,7500000,0,5124,1,993,100,7448,100,904,100,25001,3);
    Add(2,5397,1,7500000,0,7325,5,2205,1,7355,1,25001,3);
    Add(2,5355,1,2000000,0,1059,200,978,1,25001,3);
    Add(2,5665,1,2000000,0,2255,1,975,1,5045,1,25001,3);
    Add(2,5508,1,4500000,0,991,150,2221,1,963,50,25001,3);
    Add(2,5274,1,3000000,0,976,3,980,3,25001,3);
    Add(2,5592,1,9000000,0,7441,100,5085,1,25001,3);
    Add(2,5667,1,9500000,0,2502,1,983,1,7005,100,25001,3);
    Add(2,5465,1,2000000,0,2221,1,978,1,7441,1,7440,1,7063,1,25001,3);
    Add(2,5761,1,7500000,0,754,200,2213,1,919,1,25001,3);
    Add(2,5354,1,4500000,0,2217,1,983,1,25001,3);
    Add(2,5257,1,7500000,0,2254,1,2282,1,7064,100,969,5,25001,3);
    Add(2,5509,1,7500000,0,4226,1,2244,5,25001,3);
    Add(2,5456,1,9000000,0,2221,1,976,1,980,1,2209,1,25001,3);
//T
    Add(2,5550,1,7500000,0,2235,1,997,50,7106,100,7448,200,5066,1,25001,3);
    Add(2,5549,1,7500000,0,5124,1,997,50,7106,100,7448,200,5066,1,25001,3);    
    Add(2,5098,1,4500000,0,1029,100,2297,1,7267,50,25001,3);
    Add(2,5395,1,7500000,0,983,2,978,2,5045,1,981,2,25001,3);
    Add(2,5611,1,3000000,0,967,300,25001,3);
    Add(2,5384,1,3000000,0,5390,1,975,1,25001,3);
    Add(2,5187,1,9500000,0,5085,1,7166,250,25001,3);
//U
    Add(2,5256,1,7500000,0,7510,1,2210,1,7063,50,25001,3);
    Add(2,5289,1,3000000,0,7142,50,25001,3);
    Add(2,5598,1,7500000,0,2235,1,997,50,726,50,1049,200,25001,3);
    Add(2,5599,1,7500000,0,5124,1,997,50,726,50,1049,200,25001,3);
//W
    Add(2,5579,1,13500000,0,7446,100,6089,100,2280,1,25001,3);
    Add(2,5557,1,7500000,0,4257,1,7206,100,25001,3);
    Add(2,5498,1,13500000,0,7030,400,626,5,5075,1,25001,3);

//X
//Y
    Add(2,5385,1,3000000,0,753,1,4044,1,25001,3);
//Z
// --------------------------------------------------
    for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1)
        npcshopdelitem "qshop"+.@i,909;
    end;
}

// -------- Dummy data (duplicate as needed) --------
-    shop    qshop1    -1,909:-1
-    shop    qshop2    -1,909:-1
-    shop    qshop3    -1,909:-1
-    shop    qshop4    -1,909:-1

Its not realy combine I just want this script below will reward the player a ramdom headgear from that quest board.

-	script	AutoFunEvent	-1,{

OnClock2100:

while(1)
{
  query_sql "select account_id from `char` where online = 1 order by rand() limit 1", .@aid;
  attachrid .@aid;
  if(CheckVending())
  {
   DetachRID();
   continue;
  }
  announce strcharinfo(0) +" won a [10x Poring Coin] in the Lucky Pick Event every 3 hours.", 0;
  getitem 7539,10;
  break;
}
end;
}



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