Advertisement
Guest User

Goddess_Blessing_V1.2

a guest
Feb 23rd, 2018
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.21 KB | None | 0 0
  1. //===== rAthena Script =======================================
  2. //= Goddess Offering
  3. //===== by: =============================
  4. //= pajodex
  5. //===== Current Version: =====================================
  6. //= 1.1
  7. //===== Compatible With: =====================================
  8. //= rAthena Project (pajodex)
  9. //===== Description: =========================================
  10. /*
  11. Goddess Offering
  12.  
  13. Goddess Patron collects a certain item from players which
  14. will serve as an offering. Once the goal is reached, Goddess
  15. Blessing will activate for a certain time which gives off buff
  16. to every players who clicks the Goddess Patron.
  17.  
  18. This script is mainly for fun or quest. All Players will farm
  19. for this certain item for offering to enable the goddess's blessing.
  20.  
  21. Enjoy!
  22.  
  23. */
  24. //=====******** Note ********=================================
  25. //= if you find bugs or problem, please do tell DM me at
  26. //= Discord (pajodex#1328) or rAthena (pajodex)
  27. //= open for suggestions
  28. //===== Additional Comments: =================================
  29. /* 1.0 - Initial release
  30. 1.1 - Fixed bug report by maken06
  31. - Limit players to get buffed only once per activation
  32. - Optimization
  33. 1.2 - Added @goddessreset command in-case your npc gets broken
  34. */
  35. //=============================================================
  36.  
  37. prontera,150,150,1 script Goddess Patron 79,{
  38. function pubroom ;
  39. function goddessblessing ;
  40. if($goddess_active) {
  41. if(getbuff == 0)
  42. {
  43. specialeffect2 338;
  44. specialeffect2 EF_HEAL2;
  45. message strcharinfo(0), rand(2) ? "Ah! I can feel the power from within!!" : "Yes! I feel blessed!!!";
  46. goddessblessing;
  47. getbuff = 1;
  48. end;
  49. }
  50. else
  51. {
  52. set .@Timer, $event_time + .delay_tick;
  53. mes "Goddess has heard your cries!!!";
  54. mes "Time left: " + callfunc("Time2Str",.@Timer);
  55. close;
  56. }
  57. }
  58. mes "Hi ^FF0000"+strcharinfo(0)+"^000000,";
  59. mes "If everybody offers a ^FF0000"+getitemname(.item_offering)+"^000000,";
  60. mes "the Goddess will be glad and bless everyone with powers!";
  61. callshop "goddess#shop",2;
  62. npcshopattach "goddess#shop";
  63. end;
  64.  
  65. OnSellItem:
  66. for (.@i = 0; .@i < getarraysize(@sold_nameid); .@i++) {
  67. if (countitem(@sold_nameid[.@i]) < @sold_quantity[.@i] || @sold_quantity[.@i] <= 0) {
  68. mes "omgh4x!";
  69. close;
  70. } else if (@sold_nameid[.@i] == .item_offering){
  71. delitem .item_offering, @sold_quantity[.@i];
  72. $donate = $donate + @sold_quantity[.@i];
  73. donator = donator + @sold_quantity[.@i];
  74. } else {
  75. mes "Sorry, I only accept '^FF0000"+getitemname(.item_offering)+"^000000' as offerings.";
  76. close;
  77. }
  78. }
  79. if($donate >= .goal) {
  80. mes "Complete";
  81. $goddess_active = 1;
  82. $event_time = gettimetick(2);
  83. pubroom;
  84. addtimer .delay_tick * 1000, strnpcinfo(3) + "::OnEventEnd";
  85. close;
  86. }
  87. mes "Thank you! May the Goddesses will hear your desires!";
  88. pubroom;
  89. close;
  90.  
  91. OnEventEnd:
  92. query_sql("UPDATE `char_reg_num` SET `value` = '0' WHERE `key` ='getbuff'");
  93. addrid(0);
  94. getbuff = 0;
  95. $donate = $donate - .goal;
  96. $event_time = 0;
  97. $goddess_active = 0;
  98. pubroom;
  99. end;
  100.  
  101. function goddessblessing {
  102. // ----- Add your desired SCs below! -----
  103. sc_start SC_FOOD_STR_CASH,8640000,10;
  104. sc_start SC_FOOD_AGI_CASH,8640000,10;
  105. sc_start SC_FOOD_DEX_CASH,8640000,10;
  106. sc_start SC_FOOD_LUK_CASH,8640000,10;
  107. sc_start SC_FOOD_INT_CASH,8640000,10;
  108. sc_start SC_FOOD_VIT_CASH,8640000,10;
  109. sc_start SC_ITEMBOOST,8640000,50;
  110. sc_start SC_EXPBOOST,8640000,50;
  111. // -------- end of adding SC ---------
  112. return;
  113. }
  114.  
  115. OnInit:
  116. // ---- Configuration starts ------
  117. .goal = 100000; // Goal to reach
  118. .delay_tick = 60 * 60 * 4; // Blessing time active : 4hrs (seconds * mins * hours)
  119. .item_offering = 501; // Item to offer
  120. //----- Configuration ends-----
  121.  
  122. //----- Don't touch below-----
  123. .@difftick = gettimetick(2) - $event_time;
  124. if(.@difftick < 0)
  125. addtimer .@difftick, strnpcinfo(3) + "::OnEventEnd";
  126. pubroom;
  127. bindatcmd "goddessreset",strnpcinfo(3) + "::OnEventEnd";
  128. end;
  129.  
  130. function pubroom {
  131. delwaitingroom;
  132. if($goddess_active)
  133. waitingroom "Goddess Blessing is activated!!",0;
  134. else
  135. waitingroom $donate +" / "+.goal+" more to go ",0;
  136. return;
  137. }
  138. }
  139. - shop goddess#shop -1,501:50.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement