Advertisement
Oxxy

Untitled

May 2nd, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.12 KB | None | 0 0
  1. You can use this function to create a very fast quests. Old script, can be optimized a bit I guess. Not completed, but working.
  2.  
  3. /*
  4.     Oxxy (C) 2013 ;)
  5. */
  6.  
  7. function    script    CustomQuest    {
  8.  
  9.     set .@npc$, "["+getarg(0)+"]";      // NPC Header
  10.     set .@text$, getarg(1);                // Quest's text
  11.     set .@yes_no_text$, getarg(2);        // Another text
  12.     set .@yes_no_menu$, getarg(3);        // Menu Yes or No text
  13.     set .@no_text$, getarg(4);            // Text if you pressed No            
  14.     //set .@items_menu$, getarg(5);        // Items menu (The last one should be Close or something like this) unused actually
  15.     set .@oneItemText$, getarg(6);        // Text that will be displayed when u chose item
  16.     set .@yes_no_text1$, getarg(7);        // Menu Yes or No(item creating)
  17.    
  18.     set .@item_id1, getarg(8);            // Item ID 1
  19.     set .@item_Amount1, getarg(9);        // Item Amount 1
  20.    
  21.     set .@item_id2, getarg(10);            // Item ID 2
  22.     set .@item_Amount2, getarg(11);        // Item Amount 2
  23.    
  24.     set .@item_id3, getarg(12);            // Item ID 3
  25.     set .@item_Amount3, getarg(13);        // Item Amount 3
  26.    
  27.     set .@item_id4, getarg(14);            // Item ID 4
  28.     set .@item_Amount4, getarg(15);        // Item Amount 4
  29.    
  30.     set .@item_id5, getarg(16);            // Item ID 5
  31.     set .@item_Amount5, getarg(17);        // Item Amount 5
  32.    
  33.     set .@item_id6, getarg(18);            // Item ID 6
  34.     set .@item_Amount6, getarg(19);        // Item Amount 6
  35.    
  36.     set .@Zeny, getarg(20);                // Zeny required for quest
  37.                                         // 0 - No zeny required
  38.                                        
  39.     set .@oneItemReward, getarg(21);    // Reward Item ID
  40.     set .@oneItemAmount, getarg(22);        // Reward Item Amount
  41.    
  42.     mes .@npc$;
  43.     mes .@text$;
  44.     mes .@yes_no_text$;
  45.     next;
  46.     if(select(.@yes_no_menu$) == 2)
  47.     {
  48.         next;
  49.         mes .@npc$;
  50.         mes .@no_text$;
  51.         close;
  52.     }
  53.    
  54.     mes .@npc$;
  55.     mes .@oneItemtext$;
  56.     mes "Вам понадобится: ";
  57.     if(.@item_id1 && .@item_Amount1)
  58.         mes ""+.@item_Amount1+" "+getitemname(.@item_id1)+"";
  59.        
  60.     if(.@item_id2 && .@item_Amount2)
  61.         mes ""+.@item_Amount2+" "+getitemname(.@item_id2)+"";
  62.        
  63.     if(.@item_id3 && .@item_Amount3)
  64.         mes ""+.@item_Amount3+" "+getitemname(.@item_id3)+"";
  65.        
  66.     if(.@item_id4 && .@item_Amount4)
  67.         mes ""+.@item_Amount4+" "+getitemname(.@item_id4)+"";
  68.        
  69.     if(.@item_id5 && .@item_Amount5)
  70.         mes ""+.@item_Amount5+" "+getitemname(.@item_id5)+"";
  71.        
  72.     if(.@item_id6 && .@item_Amount6)
  73.         mes ""+.@item_Amount6+" "+getitemname(.@item_id6)+"";
  74.        
  75.     mes .@yes_no_text1$;
  76.     if(select(.@yes_no_menu$) == 2)
  77.     {
  78.         mes .@no_text$;
  79.         close;
  80.     }
  81.     if(.@item_id1 && .@item_Amount1)
  82.     {
  83.         if(countitem(.@item_id1) < .@item_Amount1)
  84.         {
  85.             next;
  86.             mes .@npc$;
  87.             mes "You don't have enough "+getitemname(.@item_id1)+".";
  88.             close;
  89.         }
  90.        
  91.         delitem .@item_id1, .@item_Amount1;
  92.     }
  93.    
  94.     if(.@item_id2 && .@item_Amount2)
  95.     {
  96.         if(countitem(.@item_id2) < .@item_Amount2)
  97.         {
  98.             next;
  99.             mes .@npc$;
  100.             mes "You don't have enough "+getitemname(.@item_id2)+".";
  101.             close;
  102.         }
  103.        
  104.         delitem .@item_id2, .@item_Amount2;
  105.     }
  106.    
  107.     if(.@item_id3 && .@item_Amount3)
  108.     {
  109.         if(countitem(.@item_id3) < .@item_Amount3)
  110.         {
  111.             next;
  112.             mes .@npc$;
  113.             mes "You don't have enough "+getitemname(.@item_id3)+".";
  114.             close;
  115.         }
  116.        
  117.         delitem .@item_id3, .@item_Amount3;
  118.     }
  119.    
  120.     if(.@item_id4 && .@item_Amount4)
  121.     {
  122.         if(countitem(.@item_id4) < .@item_Amount4)
  123.         {
  124.             next;
  125.             mes .@npc$;
  126.             mes "You don't have enough "+getitemname(.@item_id4)+".";
  127.             close;
  128.         }
  129.        
  130.         delitem .@item_id4, .@item_Amount4;
  131.     }
  132.    
  133.     if(.@item_id5 && .@item_Amount5)
  134.     {
  135.         if(countitem(.@item_id5) < .@item_Amount5)
  136.         {
  137.             next;
  138.             mes .@npc$;
  139.             mes "You don't have enough "+getitemname(.@item_id5)+".";
  140.             close;
  141.         }
  142.        
  143.         delitem .@item_id5, .@item_Amount5;
  144.     }
  145.    
  146.     if(.@item_id6)
  147.     {
  148.         if(countitem(.@item_id6) < .@item_Amount6)
  149.         {
  150.             next;
  151.             mes .@npc$;
  152.             mes "You don't have enough "+getitemname(.@item_id6)+".";
  153.             close;
  154.         }
  155.        
  156.         delitem .@item_id6, .@item_Amount6;
  157.     }
  158.    
  159.     if(.@Zeny)
  160.     {
  161.         if(Zeny < .@Zeny)
  162.         {
  163.             next;
  164.             mes .@npc$;
  165.             mes "You don't have enough "+(.@Zeny - Zeny)+".";
  166.             close;
  167.         }
  168.        
  169.         set Zeny, Zeny - .@Zeny;
  170.     }
  171.     next;
  172.     mes .@npc$;
  173.     mes "Here's your item!";
  174.     getitem .@oneItemReward, .@oneItemAmount;
  175.     close;
  176.    
  177. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement