Advertisement
hendra814

identification

Oct 1st, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.04 KB | None | 0 0
  1. //MAGNIFIER by Ishizu-Chan
  2. //Modified by Anarkial
  3.  
  4. prontera.gat,158,191,4  script  Deckard Cain    57,{
  5.  
  6. // [Set these variables]
  7.  
  8. // Prices
  9. set @price, 50; // Price to identify one item, BEFORE finishing quest
  10. set @price2, 0; // Price to identify one item, AFTER quest
  11.  
  12.  // Are you going to use the quest? (1 for yes, 0 for no)
  13. set @usequest, 1; // I have it set to give NO discounts after the quest is complete.
  14.  
  15. // Will you use magnifiers after quest? (1 for yes, 0 for no)
  16. set @magspostq, 1; // This will only affect the script if your @price2 is GREATER than 0.
  17.                 //Also, if you use this, it's best not to set @price2 under 40.
  18.  
  19.  
  20.  
  21. // Price discounts
  22. if (@usequest == 0) {
  23.     if (getskilllv(224)) set @price, @price-(5+4*getskilllv(224)); //Price after Rogue's discount
  24.     if(getskilllv(37)) { set @price, @price-(7+2*getskilllv(37)); //Price after Merchant's discount
  25.     if (getskilllv(37) == 10) set @price, @price-(7+2*getskilllv(37)-1); //Price after Merchant's discount at max skill lvl.
  26.     }
  27. }
  28.  
  29. // Actual Script Begins Here
  30. // =========================
  31.    
  32. if (ident_Q == 2) goto L_Greetings;
  33. if ((ident_Q == 3) && (@price2 == 0)) goto L_FreeDeck;
  34. if ((ident_Q == 3) && (@price2 > 0)) goto L_PaidDeck;
  35. else goto L_AllDeck;
  36.  
  37. //What happens right after completion of quest
  38. L_Greetings:
  39.     mes "^FF0000[Deckard Cain]^000000";
  40.     mes "Thank you for helping me!";
  41.     mes "As a token of my gratitude,";
  42.     mes "I will identify all of your items";
  43.     if (@price2 == 0)
  44.         mes "for free from now on!";
  45.     else if (@price2 > 0)
  46.         mes "for only " + @price2 + " Zeny  from now on.";
  47.     next;
  48.     set ident_Q,3;
  49.     goto L_Invcheck;
  50.  
  51. // If identifying is free after quest
  52. L_FreeDeck:
  53.     mes "^FF0000[Deckard Cain]^000000";
  54.     mes "Hello again!";
  55.     mes "I will identify all your items for you.";
  56.     next;
  57.     goto L_InvCheck;
  58.  
  59. //If identifying costs Zeny after quest
  60. L_PaidDeck:
  61.     mes "^FF0000[Deckard Cain]^000000";
  62.     mes "Hello again!";
  63.     mes "I will identify all your items for";
  64.     mes "just " + @price2 + " Zeny each item.";
  65.     next;
  66.     menu "Sure.",L_InvCheck,"No thanks...",L_Bye;
  67.  
  68.  
  69. //What everybody gets before quest
  70. L_AllDeck:
  71.     mes "^FF0000[Deckard Cain]^000000";
  72.     mes "Hello there!";
  73.     mes "I can identify all your unidentified items.";
  74.     mes "It's " + @price + " Zeny each item.";
  75.     next;
  76.     menu "Sure.",-,"No thanks...",L_Bye;
  77.    
  78. L_InvCheck:
  79.     getinventorylist;
  80.     set @identify, 0;
  81.  
  82.     for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
  83.     if (@inventorylist_identify[@i] == 0) set @identify, @identify + 1;
  84.     }
  85.  
  86.     if (@identify == 0) goto L_Nothing;
  87.         else if ((ident_Q == 3) && (@price2 < 1))  goto L_Identifying;
  88.  
  89. // Paying to identify, quest script or not
  90.         mes "^FF0000[Deckard Cain]^000000";
  91.         if (@identify < 2) {
  92.             mes "You've got one unidentified item in your inventory.";
  93.             if (ident_Q == 3)
  94.                 mes "I'll identify it for " + @price2 + " Zeny.";
  95.             else
  96.                 mes "I'll identify it for " + @price + " Zeny.";
  97.         } else {
  98.             mes "You've got " + @identify + " unidentified items in your inventory.";
  99.             if (ident_Q == 3)
  100.                 mes "I'll identify them for " + (@identify * @price2) + " Zeny.";
  101.             else
  102.                 mes "I'll identify them for " + (@identify * @price) + " Zeny.";
  103.         }
  104.         if ((ident_Q == 3) && (@magspostq == 1))
  105.             mes "If you've got any ^00AA00Magnifiers^000000, I'll take those instead.";
  106.         else if (ident_Q < 3)
  107.             mes "If you've got any ^00AA00Magnifiers^000000, I'll take those instead.";    
  108.         mes "Shall I start now?";
  109.         next;
  110.         menu "Ok, let's go!",-,"What a ripoff...",L_Bye;
  111.  
  112. L_Identifying:
  113.     getinventorylist;
  114.     set @identified, 0;
  115.    
  116.     if ((ident_Q == 3) && (@price2 < 1)) goto L_FIdent;
  117.         else if ((ident_Q == 3) && (@price2 > 0)) goto L_PIdent2;
  118.  
  119. //Paid identification before quest
  120. L_PIdent1:
  121.     for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
  122.     if (@inventorylist_identify[@i] == 0) {
  123.         if (countitem(611) > 0) delitem 611,1;
  124.             else if (Zeny < @price) goto L_NoZeny;
  125.             else set Zeny, Zeny - @price;
  126.         delitem2 @inventorylist_id[@i],1,0,0,0,0,0,0,0;
  127.         getitem @inventorylist_id[@i],1;
  128.     set @identified, @identified + 1;
  129.     }
  130.     }
  131.     goto L_Identified;
  132.    
  133. //Paid identification after quest
  134. L_PIdent2:
  135.     for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
  136.     if (@inventorylist_identify[@i] == 0) {
  137.         if ((countitem(611) > 0) && (@magspostq == 1)) delitem 611,1;
  138.             else if (Zeny < @price2) goto L_NoZeny;
  139.             else set Zeny, Zeny - @price2;
  140.         delitem2 @inventorylist_id[@i],1,0,0,0,0,0,0,0;
  141.         getitem @inventorylist_id[@i],1;
  142.     set @identified, @identified + 1;
  143.     }
  144.     }
  145.     goto L_Identified;
  146.    
  147. //Free identification
  148. L_FIdent:
  149.     for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
  150.     if (@inventorylist_identify[@i] == 0) {
  151.         delitem2 @inventorylist_id[@i],1,0,0,0,0,0,0,0;
  152.         getitem @inventorylist_id[@i],1;
  153.     set @identified, @identified + 1;
  154.     }
  155.     }
  156.  
  157. L_Identified:
  158.     mes "^FF0000[Deckard Cain]^000000";
  159.     mes "Well, I identified everything!";
  160.     mes "I've identified a total of "+@identified+" items for you.";
  161.     mes "Bye~";
  162.     close;
  163.  
  164. L_Nothing:
  165.     mes "^FF0000[Deckard Cain]^000000";
  166.     mes "You don't have any unidentified Items.";
  167.     close;
  168.  
  169. L_NoZeny:
  170.     mes "^FF0000[Deckard Cain]^000000";
  171.     mes "You don't have enough Zeny.";
  172.     close;
  173.  
  174. L_Bye:
  175.     mes "^FF0000[Deckard Cain]^000000";
  176.     mes "...";
  177.     close;
  178.  
  179. }
  180.  
  181.  
  182. //The Quest
  183. prontera.gat,171,182,3  script  Kashya  728,{
  184.  
  185. set @prize1, 200;
  186. set @prize2, 200;
  187. set @prize3, 200;
  188.  
  189. if (ident_Q == 0) goto L_NoQuest; //Char did not start quest yet.
  190. if (ident_Q == 1) goto L_ident_Q_1; //Char accepted quest 1.
  191. goto L_Finish; //Char finished all quests from npc.
  192.  
  193. L_ident_Q_1:
  194.     mes "^FF0000[Kashya]^000000";
  195.     mes "Please bring:";
  196.     mes @prize1 + " Clover,";
  197.     mes @prize2 + " Red Herb, and";
  198.     mes @prize3 + " Fluff quickly!";
  199.     mes "Time is running out!";
  200.     next;
  201.     menu "I have them!",L_ident_Q_1_c,"Ok, ok, I will!",L_Hurry;
  202.    
  203. L_ident_Q_1_c:
  204.     if(countitem(705)<@prize1) goto L_Error1;
  205.     if(countitem(507)<@prize2) goto L_Error2;
  206.     if(countitem(914)<@prize3) goto L_Error3;
  207.     delitem 705,@prize1;
  208.     delitem 507,@prize2;
  209.     delitem 914,@prize3;
  210.     mes "^FF0000[Kashya]^000000";
  211.     mes "With these items, the healer, Deckard Cain, will surely discover the cause of the illness.";
  212.     mes "Deckard Cain and I are truly grateful for your help, and as I understand it, he is offering a service for his thanks.";
  213.     next;
  214.     mes "You should go see him.";
  215.     mes "And thank you very much,";
  216.     mes "we will always be in your debt.";
  217.     set ident_Q,2; //We're putting quest up by 1  
  218.     close;
  219.  
  220. L_NoQuest:
  221.     mes "^FF0000[Kashya]^000000";
  222.     mes "A little kid of mine has fallen very ill, and nobody here knows the cure.";
  223.     mes "We are researching the illness right now, and we really need your help.";
  224.     mes "Can you help us?";
  225.     next;
  226.     menu "Of course!",-,"Sorry, no.", L_Outrage;
  227.     mes "^FF0000[Kashya]^000000";
  228.     mes "Thank you! To research this deadly thing,";
  229.     mes "I'll need:";
  230.     mes @prize1 + " Clover,";
  231.     mes @prize2 + " Red Herb, and";
  232.     mes @prize3 + " Fluff.";
  233.     mes "...";
  234.     mes "Are you still willing to do this?";
  235.     next;
  236.     menu "Yes",-,"No", L_Outrage;
  237.     mes "^FF0000[Kashya]^000000";
  238.     mes "Thank you, thank you, thank you!";
  239.     emotion e_kiss;
  240.     mes "Well, I hope to see you back very soon, because we are quite desperate at this point,";
  241.     mes "And you are our only hope...";
  242.     set ident_Q,1;
  243.     close;
  244.    
  245. L_Outrage:
  246.     mes "^FF0000[Kashya]^000000";
  247.     mes "But, but, how COULD you?";
  248.     mes "You're killing my only child...";
  249.     mes "We'll just have to wait for someone else then.";
  250.     close;
  251.    
  252. L_Error1:
  253.     mes "^FF0000[Kashya]^000000";
  254.     mes "No, no, you need " + @prize1 + " Clover.";
  255.     close;
  256.  
  257. L_Error2:
  258.     mes "^FF0000[Kashya]^000000";
  259.     mes "No, no, you need " + @prize2 + " Red Herb.";
  260.     close;
  261.    
  262. L_Error3:
  263.     mes "^FF0000[Kashya]^000000";
  264.     mes "No, no, you need " + @prize3 + " Fluff.";
  265.     close;
  266.  
  267. L_Finish:
  268.     mes "^FF0000[Kashya]^000000";
  269.     mes "Go see ^FF0000[Deckard Cain]^000000, he has something special for you.";
  270.     close;
  271.    
  272. L_Hurry:
  273.     mes "^FF0000[Kashya]^000000";
  274.     mes "Ok then, please hurry.";
  275.     close;
  276.  
  277. OnTouch:
  278.     if (q_intro == 0) emotion e_gasp;
  279.     if ((ident_Q > 0) && (ident_Q <= 1)) emotion e_what;
  280.     end;
  281. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement