Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== NPC Script ===========================================
- // Healer Roel
- //===== By: ==================================================
- // Sehrentos
- //===== Current Version: =====================================
- // 1.0
- //===== Compatible With: =====================================
- // rAthena
- //===== Description: =========================================
- // Healer with cooldown and npcwalkto event.
- //===== Additional Comments: =================================
- // Feel free to edit.
- //
- // Heals & Cleanse on Click
- //
- // Todo: Add npc location calculations the for duplicate use
- //============================================================
- prontera,145,172,5 script Healer Roel::roHeal 10040,{//4_M_ROEL
- set .@buffs,0; // Buff players? (1: yes / 0: no)
- // Check delay.
- if ( gettimetick(2) < @heal_delay ) {
- message strcharinfo(0),"Please wait for the "+ (@heal_delay - gettimetick(2)) +" seconds left Cooldown.";
- end;
- }
- // Get player location
- getmapxy(.@map$, .@x, .@y, 0);
- // Get npc location
- //getmapxy(.@npc_map$, .@npc_x, .@npc_y, 1);
- npcstop;
- npcspeed 150;
- // x, 148 min
- // y, 160 min
- // x, 160 max
- // y, 184 max
- if ( (.@x > 148 && .@x < 160) && (.@y > 160 && .@y < 184) ) {
- if ( checkcell(.@map$, (.@x - 1), (.@y + 1), cell_chkpass) ) {
- //movenpc strnpcinfo(1),145,172,3;
- npcwalkto (.@x + 1), (.@y + 1);
- callsub OnHeal, .@buffs;
- }
- } else {
- //npctalk "Bye! I can't come there :)";
- switch( rand(4) ) {
- case 0: emotion e_hlp; break;
- case 1: emotion e_swt; break;
- case 2: emotion e_wah; break;
- case 3: emotion e_sry; break;
- case 4: emotion e_hmm; break;
- }
- }
- // Do some random fun at % change.
- if (rand(100) < 30) {
- callsub OnChange;
- }
- end;
- OnHeal:
- //skilleffect 28,9999;
- specialeffect2 EF_HEAL2;
- percentheal 100,100;
- sc_end SC_Poison;
- sc_end SC_Silence;
- sc_end SC_Blind;
- sc_end SC_Confusion;
- sc_end SC_Curse;
- sc_end SC_Hallucination;
- //emotion rand(25);
- set @heal_delay, gettimetick(2) + 5;
- message strcharinfo(0),"Heal: 5 second Cooldown.";
- npctalk "I have healed your wounds buddy!";
- switch( rand(9) ) {
- case 0: emotion e_ho; break;
- case 1: emotion e_lv; break;
- case 2: emotion e_lv2; break;
- case 3: emotion e_heh; break;
- case 4: emotion e_no1; break;
- case 5: emotion e_kis; break;
- case 6: emotion e_kis2; break;
- case 7: emotion e_kis2; break;
- case 8: emotion e_hp; break;
- }
- if ( getarg(0,0) ) {
- specialeffect2 EF_INCAGILITY;
- sc_start SC_INCREASEAGI,240000,10;
- specialeffect2 EF_BLESSING;
- sc_start SC_BLESSING,240000,10;
- message strcharinfo(0),"Heal: You have been buffed.";
- }
- return;
- //TODO & tests:
- OnChange:
- //set .@name$, strnpcinfo(1);
- //setnpcdisplay( .@name$, .@name$, 4066, rand(0,2)); //0 = normal 1 = small 2 = big.
- //npcskill "AB_CHEAL",3,99,99;
- skilleffect 28,9999;
- //setlook 4,131;
- //changelook 4,131; //Temp.
- return;
- }
- //Duplicates of the NPC
- //prontera,145,172,5 duplicate(eHeal) Healer Roel#1 4_M_ROEL//10040
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement