cashheadgear_dye.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //===== rAthena Script =======================================
  2. //= Headgear Dyer (Cash)
  3. //===== By: ==================================================
  4. //= Xantara
  5. //= Maud_Dib
  6. //===== Current Version: =====================================
  7. //= 1.0
  8. //===== Compatible With: =====================================
  9. //= rAthena Project
  10. //===== Description: =========================================
  11. //= [Official Conversion]
  12. //= Change headgear's color. Cost is a Mysterious Dyestuff
  13. //===== Additional Comments: =================================
  14. //= 1.0 First / Optimized Version
  15. //============================================================
  16. prt_in,253,168,4 script Alora 862,{
  17. // Mysterious Dyestuff
  18. set .@dyeID, 6220;
  19. // Headgear Choices
  20. setarray .@hgn$[1], "Mage Hat","Beanie","Drooping Cat","Deviruchi Hat","Wig","Ribbon","Magestic Goat";
  21. // Mage Hats - Normal, Yellow, Blue, Brown, Gray, Red
  22. setarray .@hg_1[1], 5027, 5242, 5241, 5240, 5239, 5238;
  23. // Beanies - Normal, Pink, Blue, Brown
  24. setarray .@hg_2[1], 5076, 5237, 5236, 5235;
  25. // Drooping Cats - Normal, Blue, Brown, Gray, Pink, Yellow
  26. setarray .@hg_3[1], 5058, 5233, 5231, 5230, 5232, 5234;
  27. // Deviruchi Hats - Normal, Red, Gray, Brown
  28. setarray .@hg_4[1], 5038, 5227, 5228, 5229;
  29. // Wigs - Happy, Shiny, Marvelous, Fantastic
  30. setarray .@hg_5[1], 5273, 5274, 5275, 5276;
  31. // Ribbons - Normal, Black, Yellow, Green, Pink, Red, Orange, White
  32. setarray .@hg_6[1], 2208, 5191, 5192, 5193, 5194, 5195, 5196, 5197;
  33. // Magestic Goats - Normal, Evolved
  34. setarray .@hg_7[1], 2256, 5217;
  35. mes "[Alora]";
  36. mes "Hello, I can change your headgear's color if you bring me a Mysterious Dyestuff.";
  37. next;
  38. mes "[Alora]";
  39. mes "Do you have a headgear that you would like to dye?";
  40. next;
  41. for(set .@i,1; .@i < getarraysize(.@hgn$); set .@i,.@i+1) {
  42. if(.@i == 1) set .@menu$, .@hgn$[.@i];
  43. else set .@menu$, .@menu$ +":"+ .@hgn$[.@i];
  44. }
  45. set .@menu$, .@menu$ +":Cancel";
  46. set .@t, select(.@menu$);
  47. if(.@t == getarraysize(.@hgn$)) {
  48. mes "[Alora]";
  49. mes "Have a good journey adventurer!";
  50. mes "If you ever are curious to try a new color on your Kafra headgear or the ones you found on your adventures please come to me!";
  51. close;
  52. }
  53. mes "[Alora]";
  54. mes "Okay, what color do you want to change it to?";
  55. next;
  56. for(set .@i,1; .@i < getarraysize(getd(".@hg_"+.@t+"")); set .@i,.@i+1) {
  57. if(.@i == 1 && .@t != 5)
  58. set .@menu$, "Normal";
  59. else if(.@i == 1 && .@t == 5)
  60. set .@menu$, getitemname(getd(".@hg_"+.@t+"["+.@i+"]"));
  61. else {
  62. sscanf(getitemname(getd(".@hg_"+.@t+"["+.@i+"]")),"%s "+ .@hgn$[.@t],.@colour$);
  63. set .@menu$, .@menu$ +":"+ .@colour$;
  64. }
  65. }
  66. set .@menu$, .@menu$ +":Cancel";
  67. set .@c, select(.@menu$);
  68. if(.@c == getarraysize(getd(".@hg_"+.@t+""))) {
  69. mes "[Alora]";
  70. mes "Oh, okay no problem!";
  71. close;
  72. }
  73. set .@dyHG, getd(".@hg_"+.@t+"["+.@c+"]");
  74. mes "[Alora]";
  75. mes "Oh I'm so excited aren't you?";
  76. mes "And just to be sure, what color is the "+ .@hgn$[.@t] +" you want me to use?";
  77. next;
  78. mes "[Alora]";
  79. mes "Please understand that I'm going to use the ^FF00001st "+ .@hgn$[.@t] +" of that color in your inventory!^000000";
  80. next;
  81. mes "[Alora]";
  82. mes "Any upgrades and cards will be dissolved by the mysterious dye, so be sure you are ok with having a ^0000FF+0 "+ getitemname(.@dyHG) +" without any cards.^000000";
  83. next;
  84. mes "["+ strcharinfo(0) +"]";
  85. mes "Ok, thanks for the warning, I think I'll give you my";
  86. next;
  87. set .@menu$, "Nevermind";
  88. for(set .@i,1; .@i < getarraysize(getd(".@hg_"+.@t+"")); set .@i,.@i+1) {
  89. if(.@i == 1) set .@menu$, .@menu$ +":Normal "+ getitemname(getd(".@hg_"+.@t+"["+.@i+"]"));
  90. else set .@menu$, .@menu$ +":"+ getitemname(getd(".@hg_"+.@t+"["+.@i+"]"));
  91. }
  92. set .@mine, select(.@menu$) - 1;
  93. if(!.@mine) {
  94. mes "[Alora]";
  95. mes "It's best to be very sure, have a safe journey.";
  96. close;
  97. }
  98. set .@myHG, getd(".@hg_"+.@t+"["+.@mine+"]");
  99. if(.@dyHG == .@myHG) {
  100. mes "[Alora]";
  101. mes "Woah what happened?";
  102. close;
  103. }
  104. if(!countitem(.@dyeID) || !countitem(.@myHG)) {
  105. mes "[Alora]";
  106. mes "Oh my, you seem to be missing something.";
  107. close;
  108. }
  109. mes "[Alora]";
  110. mes "Looks great doesn't it?!";
  111. mes "I hope you'll come back to dye more pretty headgears!";
  112. delitem .@dyeID,1; // Dyestuff
  113. delitem .@myHG,1; // Your headgear
  114. getitem .@dyHG,1; // Dyed headgear
  115. close;
  116. }