Advertisement
Guest User

NPC Recolour Headgear

a guest
Apr 28th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. //===== Hercules Script ========================================
  2. //=== Hat Recolour =============================================
  3. //===== By True Zeal ===========================================
  4. //=== Description===============================================
  5. //= Recolors hats ==============================================
  6. //=== Comments =================================================
  7. //= I'm pretty new to scripting, you may encounter problems.
  8. //= Missing semicolons is a normal occurrence.
  9. //==============================================================
  10.  
  11. prontera,150,150,3 script Recolour 4_F_TELEPORTER,{
  12.  
  13. //--- Configuration --------------------------------------------
  14. .@name$ = "[Recolor Headgears]"; // Names your NPC's dialogue screens.
  15. .@Hat1$ = "getitemname(Hat1 ID#)"; // I don't know if this works, never used this command before. Fiddle round with it.
  16. .@Hat2$ = "getitemname(Hat2 ID#)"; // Same as above.
  17. set .@price,1000; // Set to whatever you want
  18.  
  19. //--- Script ---------------------------------------------------
  20. mes .@name$;
  21. mes "I can recolour headgears. These are the options I give.";
  22. next;
  23. .@menu = select(".@Hat1$:.@Hat2$:.@Cancel");
  24. switch(.@menu) {
  25. case 1:
  26. mes .@name$;
  27. if (countitem (Hat1 ID) < 1) {
  28. mes "You don't have .@Hat1$ on hand. Please place it in your inventory.";
  29. close;
  30. }
  31. else {
  32. mes "What colour would you like to dye your hat?";
  33. mes "It will cost you " + .@price + "z.";
  34. next;
  35. .@hat1color = select("Red:Green:Blue");
  36. switch(.@hat1color) {
  37. case 1:
  38. mes .@name$;
  39. mes "Colour .@Hat1$ red?";
  40. mes "This will cost " + .@price + ".";
  41. next;
  42. menu "Yes",-,"No",End_Conversation;
  43. if (Zeny < .@price) { goto Need_Zeny; }
  44. else {
  45. delitem <hat1id>,1;
  46. getitem <hat1's red version id>,1;
  47. mes .@name$;
  48. mes "I have recoloured your .@Hat1$ red.";
  49. close;
  50. }
  51. break;
  52.  
  53. case 2:
  54. // Do the same as case 1, just for green
  55. break;
  56.  
  57. case 3:
  58. // Do the same as case 1, but for blue.
  59. break;
  60. }
  61. break;
  62.  
  63. case 2:
  64. // Just repeat what was in case 1 (but obviously change hat1 for hat, etc.)
  65. close;
  66. break;
  67.  
  68. case 3:
  69. close;
  70. break;
  71. }
  72. End_Conversation:
  73. mes .@name$;
  74. mes "See you later.";
  75. close;
  76.  
  77. Need_Zeny:
  78. mes .@name$;
  79. mes "You don't have enough zeny!":
  80. close;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement