Jump to content

Virtue

Members
  • Posts

    354
  • Joined

  • Days Won

    6

Posts posted by Virtue

  1. Hi, if anyone could help me i just need to ask a little question.

    How do i check an SQL value in a script?

    i want to make use of harmony's features in SQL to make a Freebies NPC. tho i got an idea im still a beginer at sql scripts. :)

  2. Hi,

    I just want to clarify something about the SQL script if i want to insert something into the database.

    is the correct format like this

    INSERT `storage` VALUES (ID,accountid,nameid,amount,equip,identify,refine,atribute,card0,card1,card2,card3,expire_time,favorite,bound)

  3. @Vitrue: Here are the changes --

     case 5:
    set @s, select(implode(.Names$,":"));
    //...
    callshop "mission_shop"+@s,1;
    npcshopattach "mission_shop"+@s;
    end;

    OnBuyItem:
    for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
           for(set .@j,0; .@j<getarraysize(getd(".Shop"+@s)); set .@j,.@j+2)
               if (getd(".Shop"+@s+"["+.@j+"]") == @bought_nameid[.@i]) {
                   set @cost, @cost+(getd(".Shop"+@s+"["+(.@j+1)+"]")*@bought_quantity[.@i]);
                   break;
               }

    OnInit:
       // new shop arrays (be sure to rename the first one)
       setarray .Shop1[0],1202,5,1229,20;
       setarray .Shop2[0],5116,15;
       setarray .Names$[0],"Weapons","Headgears";
    
       for(set .@i,1; .@i<=getarraysize(.@Names$); set .@i,.@i+1) {
           npcshopdelitem "mission_shop"+.@i,512;
           for(set .@j,0; .@j<getarraysize(getd(".Shop"+.@i)); set .@j,.@j+2)
               npcshopadditem "mission_shop"+.@i, getd(".Shop"+.@i+"["+.@j+"]"), getd(".Shop"+.@i+"["+(.@j+1)+"]");
       }
       end;
    }
    // duplicate shops as necessary
    -    shop    mission_shop1    -1,512:-1
    -    shop    mission_shop2    -1,512:-1

    oh itworked but after reloading many times it just shows an apple. i didn't try it before thats why i am only telling this now

  4. well, i am a little lost at this part

    OnBuyItem:
       set @cost,0;
       for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1)
           for(set .@j,0; .@j<getarraysize(.Shop); set .@j,.@j+2)
               if (@bought_nameid[.@i] == .Shop[.@j]) {
                   set @cost, @cost+(.Shop[.@j+1]*@bought_quantity[.@i]);
                   break;
               }
       mes "[Hunting Missions]";
       if (@cost > #Mission_Points) mes "You don't have enough Mission Points.";
       else {
           for(set .@i,0; .@i<getarraysize(@bought_nameid); set .@i,.@i+1) {
               getitem @bought_nameid[.@i], @bought_quantity[.@i];
               dispbottom "Purchased "+@bought_quantity[.@i]+"x "+getitemname(@bought_nameid[.@i])+".";
           }
           set #Mission_Points, #Mission_Points-@cost;
           mes "Deal completed.";
           emotion e_cash;
       }
       set @cost,0;
       deletearray @bought_nameid[0], getarraysize(@bought_nameid);
       deletearray @bought_quantity[0], getarraysize(@bought_quantity);
       close;

    and this

        setarray .Shop[0],    // Reward items: <ID>,<point cost> (about 10~20 points per hunt).
           20205,145,20206,145,20207,145,20208,145;

    i have successfully removed the exp rewards tho. now do i need to make new arrays for the new shop if i am adding? or ?

  5. Hi @Emistry,

    How can i put multiple chain quests at your chain quest npc.. 'coz i've tried it with this

    // Quest Setup :
    // ChainedQuest( Reward,Amount , Required Zeny, {Item1,Amount1,Item2,Amount2,...} );
    switch(select("Bloody Angel Wings:Bloody Angel Ears")){
    case 1:
    switch( getd( "Quest"+strnpcinfo(2) ) ){
       Case 0: ChainedQuest( 6051,1, 50000, 7013,100,7021,100 );
       Case 1: ChainedQuest( 6151,1, 50000, 6418,20,7038,200,7031,150 );
       Case 2: ChainedQuest( 6242,1, 50000, 6419,30,7030,300,7041,200,7036,10 );
       Case 3: ChainedQuest( 6302,1, 50000, 6420,40,1033,130,1030,20,1018,210 );
       Case 4: ChainedQuest( 6308,1, 50000, 6421,50,962,230,938,150,916,80,928,160 );
       Case 5: ChainedQuest( 6306,1, 50000, 6422,50,706,130,913,250,1006,110,1028,210);
       Case 6: ChainedQuest( 6307,1, 50000, 6418,10,6419,10,6420,10,6421,10,6422,10 );
       Case 7: ChainedQuest( 6305,1, 50000, 6418,15,6419,15,6420,15,6421,15,6422,15,7023,30 );
       Case 8: ChainedQuest( 20240,1, 50000000, 6051,1,6151,1,6242,1,6302,1,6308,1,6306,1,6307,1,6305,1 );
    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;
    }
    case 2:
    switch( getd( "Quest"+strnpcinfo(2) ) ){
       Case 0: ChainedQuest( 7701,1, 50000, 7161,100,7166,100 );
       Case 1: ChainedQuest( 7907,1, 50000, 6418,20,7159,200,7115,50 );
       Case 2: ChainedQuest( 7894,1, 50000, 6419,30,7116,300,7006,200,7002,100 );
       Case 3: ChainedQuest( 7893,1, 50000, 6420,40,7004,130,7015,110,7012,90 );
       Case 4: ChainedQuest( 7885,1, 50000, 6418,10,6419,10,6420,10,6421,10,6422,10 );
       Case 5: ChainedQuest( 20241,1, 50000000, 7701,1,7907,1,7894,1,7893,1,7885,1 );
    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;
    }
    }

    you can't do the 2 chain quests at the same time, if you finish one step at the other, both quests go to the part 2.

×
×
  • Create New...