Advertisement
hendra814

Identification with Quest new

May 1st, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 8.20 KB | None | 0 0
  1. //MAGNIFIER by Ishizu-Chan
  2. //Modified by Anarkial
  3.  
  4. prontera.gat,159,190,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.         atcommand "@identifyall";
  129.     set @identified, @identified + 1;
  130.     }
  131.     }
  132.     goto L_Identified;
  133.    
  134. //Paid identification after quest
  135. L_PIdent2:
  136.     for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
  137.     if (@inventorylist_identify[@i] == 0) {
  138.         if ((countitem(611) > 0) && (@magspostq == 1)) delitem 611,1;
  139.             else if (Zeny < @price2) goto L_NoZeny;
  140.             else set Zeny, Zeny - @price2;
  141.         //delitem2 @inventorylist_id[@i],1,0,0,0,0,0,0,0;
  142.         //getitem @inventorylist_id[@i],1;
  143.         atcommand "@identifyall";
  144.     set @identified, @identified + 1;
  145.     }
  146.     }
  147.     goto L_Identified;
  148.    
  149. //Free identification
  150. L_FIdent:
  151.     for(set @i, 0; @i < @inventorylist_count; set @i, @i + 1) {
  152.     if (@inventorylist_identify[@i] == 0) {
  153.         //delitem2 @inventorylist_id[@i],1,0,0,0,0,0,0,0;
  154.         //getitem @inventorylist_id[@i],1;
  155.         atcommand "@identifyall";
  156.     set @identified, @identified + 1;
  157.     }
  158.     }
  159.  
  160. L_Identified:
  161.     mes "^FF0000[Deckard Cain]^000000";
  162.     mes "Well, I identified everything!";
  163.     mes "I've identified a total of "+@identified+" items for you.";
  164.     mes "Bye~";
  165.     close;
  166.  
  167. L_Nothing:
  168.     mes "^FF0000[Deckard Cain]^000000";
  169.     mes "You don't have any unidentified Items.";
  170.     close;
  171.  
  172. L_NoZeny:
  173.     mes "^FF0000[Deckard Cain]^000000";
  174.     mes "You don't have enough Zeny.";
  175.     close;
  176.  
  177. L_Bye:
  178.     mes "^FF0000[Deckard Cain]^000000";
  179.     mes "...";
  180.     close;
  181.  
  182. }
  183.  
  184.  
  185. //The Quest
  186. prontera.gat,186,210,3  script  Kashya  728,{
  187.  
  188. set @prize1, 100;
  189. set @prize2, 100;
  190. set @prize3, 100;
  191.  
  192. if (ident_Q == 0) goto L_NoQuest; //Char did not start quest yet.
  193. if (ident_Q == 1) goto L_ident_Q_1; //Char accepted quest 1.
  194. goto L_Finish; //Char finished all quests from npc.
  195.  
  196. L_ident_Q_1:
  197.     mes "^FF0000[Kashya]^000000";
  198.     mes "Please bring:";
  199.     mes @prize1 + " Red Potion,";
  200.     mes @prize2 + " Orange Potion, and";
  201.     mes @prize3 + " Green Potion quickly!";
  202.     mes "Time is running out!";
  203.     next;
  204.     menu "I have them!",L_ident_Q_1_c,"Ok, ok, I will!",L_Hurry;
  205.    
  206. L_ident_Q_1_c:
  207.     if(countitem(501)<@prize1) goto L_Error1;
  208.     if(countitem(502)<@prize2) goto L_Error2;
  209.     if(countitem(506)<@prize3) goto L_Error3;
  210.     delitem 501,@prize1;
  211.     delitem 502,@prize2;
  212.     delitem 506,@prize3;
  213.     mes "^FF0000[Kashya]^000000";
  214.     mes "With these items, the healer, Deckard Cain, will surely discover the cause of the illness.";
  215.     mes "Deckard Cain and I are truly grateful for your help, and as I understand it, he is offering a service for his thanks.";
  216.     next;
  217.     mes "You should go see him.";
  218.     mes "And thank you very much,";
  219.     mes "we will always be in your debt.";
  220.     set ident_Q,2; //We're putting quest up by 1  
  221.     close;
  222.  
  223. L_NoQuest:
  224.     mes "^FF0000[Kashya]^000000";
  225.     mes "A little kid of mine has fallen very ill, and nobody here knows the cure.";
  226.     mes "We are researching the illness right now, and we really need your help.";
  227.     mes "Can you help us?";
  228.     next;
  229.     menu "Of course!",-,"Sorry, no.", L_Outrage;
  230.     mes "^FF0000[Kashya]^000000";
  231.     mes "Thank you! To research this deadly thing,";
  232.     mes "I'll need:";
  233.     mes @prize1 + " Red Potion,";
  234.     mes @prize2 + " Orange Potion, and";
  235.     mes @prize3 + " Green Potion.";
  236.     mes "...";
  237.     mes "Are you still willing to do this?";
  238.     next;
  239.     menu "Yes",-,"No", L_Outrage;
  240.     mes "^FF0000[Kashya]^000000";
  241.     mes "Thank you, thank you, thank you!";
  242.     emotion e_kiss;
  243.     mes "Well, I hope to see you back very soon, because we are quite desperate at this point,";
  244.     mes "And you are our only hope...";
  245.     set ident_Q,1;
  246.     close;
  247.    
  248. L_Outrage:
  249.     mes "^FF0000[Kashya]^000000";
  250.     mes "But, but, how COULD you?";
  251.     mes "You're killing my only child...";
  252.     mes "We'll just have to wait for someone else then.";
  253.     close;
  254.    
  255. L_Error1:
  256.     mes "^FF0000[Kashya]^000000";
  257.     mes "No, no, you need " + @prize1 + " Red Potion.";
  258.     close;
  259.  
  260. L_Error2:
  261.     mes "^FF0000[Kashya]^000000";
  262.     mes "No, no, you need " + @prize2 + " Orange Potion.";
  263.     close;
  264.    
  265. L_Error3:
  266.     mes "^FF0000[Kashya]^000000";
  267.     mes "No, no, you need " + @prize3 + " Green Potion.";
  268.     close;
  269.  
  270. L_Finish:
  271.     mes "^FF0000[Kashya]^000000";
  272.     mes "Go see ^FF0000[Deckard Cain]^000000, he has something special for you.";
  273.     close;
  274.    
  275. L_Hurry:
  276.     mes "^FF0000[Kashya]^000000";
  277.     mes "Ok then, please hurry.";
  278.     close;
  279.  
  280. OnTouch:
  281.     if (q_intro == 0) emotion ET_SURPRISE;
  282.     if ((ident_Q > 0) && (ident_Q <= 1)) emotion ET_QUESTION;
  283.     end;
  284. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement