Advertisement
Sehrentos

rAthena npc script moving healer (todo)

Apr 15th, 2015
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. //===== NPC Script ===========================================
  2. // Healer Roel
  3. //===== By: ==================================================
  4. // Sehrentos
  5. //===== Current Version: =====================================
  6. // 1.0
  7. //===== Compatible With: =====================================
  8. // rAthena
  9. //===== Description: =========================================
  10. // Healer with cooldown and npcwalkto event.
  11. //===== Additional Comments: =================================
  12. // Feel free to edit.
  13. //
  14. // Heals & Cleanse on Click
  15. //
  16. // Todo: Add npc location calculations the for duplicate use
  17. //============================================================
  18. prontera,145,172,5 script Healer Roel::roHeal 10040,{//4_M_ROEL
  19. set .@buffs,0; // Buff players? (1: yes / 0: no)
  20.  
  21. // Check delay.
  22. if ( gettimetick(2) < @heal_delay ) {
  23. message strcharinfo(0),"Please wait for the "+ (@heal_delay - gettimetick(2)) +" seconds left Cooldown.";
  24. end;
  25. }
  26.  
  27. // Get player location
  28. getmapxy(.@map$, .@x, .@y, 0);
  29.  
  30. // Get npc location
  31. //getmapxy(.@npc_map$, .@npc_x, .@npc_y, 1);
  32.  
  33. npcstop;
  34. npcspeed 150;
  35. // x, 148 min
  36. // y, 160 min
  37. // x, 160 max
  38. // y, 184 max
  39. if ( (.@x > 148 && .@x < 160) && (.@y > 160 && .@y < 184) ) {
  40.  
  41. if ( checkcell(.@map$, (.@x - 1), (.@y + 1), cell_chkpass) ) {
  42. //movenpc strnpcinfo(1),145,172,3;
  43. npcwalkto (.@x + 1), (.@y + 1);
  44. callsub OnHeal, .@buffs;
  45. }
  46.  
  47. } else {
  48. //npctalk "Bye! I can't come there :)";
  49. switch( rand(4) ) {
  50. case 0: emotion e_hlp; break;
  51. case 1: emotion e_swt; break;
  52. case 2: emotion e_wah; break;
  53. case 3: emotion e_sry; break;
  54. case 4: emotion e_hmm; break;
  55. }
  56. }
  57. // Do some random fun at % change.
  58. if (rand(100) < 30) {
  59. callsub OnChange;
  60. }
  61. end;
  62.  
  63. OnHeal:
  64. //skilleffect 28,9999;
  65. specialeffect2 EF_HEAL2;
  66. percentheal 100,100;
  67. sc_end SC_Poison;
  68. sc_end SC_Silence;
  69. sc_end SC_Blind;
  70. sc_end SC_Confusion;
  71. sc_end SC_Curse;
  72. sc_end SC_Hallucination;
  73. //emotion rand(25);
  74. set @heal_delay, gettimetick(2) + 5;
  75. message strcharinfo(0),"Heal: 5 second Cooldown.";
  76. npctalk "I have healed your wounds buddy!";
  77. switch( rand(9) ) {
  78. case 0: emotion e_ho; break;
  79. case 1: emotion e_lv; break;
  80. case 2: emotion e_lv2; break;
  81. case 3: emotion e_heh; break;
  82. case 4: emotion e_no1; break;
  83. case 5: emotion e_kis; break;
  84. case 6: emotion e_kis2; break;
  85. case 7: emotion e_kis2; break;
  86. case 8: emotion e_hp; break;
  87. }
  88. if ( getarg(0,0) ) {
  89. specialeffect2 EF_INCAGILITY;
  90. sc_start SC_INCREASEAGI,240000,10;
  91. specialeffect2 EF_BLESSING;
  92. sc_start SC_BLESSING,240000,10;
  93. message strcharinfo(0),"Heal: You have been buffed.";
  94. }
  95. return;
  96.  
  97. //TODO & tests:
  98. OnChange:
  99. //set .@name$, strnpcinfo(1);
  100. //setnpcdisplay( .@name$, .@name$, 4066, rand(0,2)); //0 = normal 1 = small 2 = big.
  101. //npcskill "AB_CHEAL",3,99,99;
  102. skilleffect 28,9999;
  103. //setlook 4,131;
  104. //changelook 4,131; //Temp.
  105. return;
  106.  
  107. }
  108.  
  109. //Duplicates of the NPC
  110. //prontera,145,172,5 duplicate(eHeal) Healer Roel#1 4_M_ROEL//10040
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement