// =============================
/* Fully Configurable Advance Healer: http://herc.ws/board/topic/13867-r-healer-magnifier-npc-in-one/
----------------------------
by: Legend
compatible w/: Hercules
----------------------------
special thanks to:
* Annieruru
----------------------------
Description:
* Fully configurable by GM level 99
* Cooldown can be enabled or disabled and value in second can be set.
* Payment can be enabled or disabled and amount can be set.
* You can use the following in this NPC:
- Heal w/ Debuff negative buffs
- Magnify or Identify items
- Gives you buffs (agi+bless)
- Soul link
NOTE: You can enable or disable them.
* You can reset the NPC values to default.
----------------------------
comments:
* Last request for this year 2016 :)
* Please report to me if bugs were found:
Contact: http://herc.ws/board/user/5387-legend/
*/
// =============================
prontera,152,170,4 script Request#6 4_F_JP_DARK_ADELAIDE,{
if (getgmlevel() >= 99 && !$heal_conf && !$identify_conf && !$agibless_conf && !$soullink_conf){
callsub M_Config;
end;
}
if (!$heal_conf && !$identify_conf && !$agibless_conf && !$soullink_conf){
message strcharinfo(0), "The NPC is currently unavailable.";
end;
}
mes .npc$;
mes "Good day "+strcharinfo(0)+"!";
mes "How may I be of help?";
next;
switch (select((getgmlevel() >= 99? "[ ^FF0000GM^000000 ] Modify Configuration":""),($heal_conf? "Purify my soul":""),($identify_conf? "Identify my items":""),($agibless_conf? "Buff please":""),($soullink_conf? "Soul Link":""))){
case 1:
callsub M_Config;
end;
case 2:
if ( dh > gettimetick(2) ){
message strcharinfo(0), "You must wait [ "+(dh - gettimetick(2))+" ] seconds before you can use NPC Heal again.";
close;
}
if ($pay_conf) {
if (Zeny < $pay) {
message strcharinfo(0), "You do not have enough zeny.";
close;
}
Zeny -= $pay;
}
specialeffect2 325,strcharinfo(0);
percentheal 100,100;
for (.@a = 0; .@a < getarraysize(.nstat); ++.@a){
sc_end .nstat[.@a];
}
if ($delay_conf) {
if ($delay)
dh = gettimetick(2) + $delay;
}
message strcharinfo(0), "Your soul was purified!";
close;
case 3:
if ( di > gettimetick(2) ){
message strcharinfo(0), "You must wait [ "+(di - gettimetick(2))+" ] seconds before you can use NPC Identify again.";
close;
}
if ($pay_conf && Zeny < $pay){
message strcharinfo(0), "You do not have enough zeny.";
close;
}
getinventorylist;
for (.@i = 0; .@i < @inventorylist_count; ++.@i){
if (@inventorylist_identify[.@i]) continue;
delitem2 @inventorylist_id[.@i],1,0,0,0,0,0,0,0;
getitem @inventorylist_id[.@i],1;
++.@iid;
}
if (!.@iid){
message strcharinfo(0),"There are no items to be identified.";
close;
}
if ($pay_conf){
Zeny -= $pay;
}
if ($delay_conf) {
if ($delay)
di = gettimetick(2) + $delay;
}
message strcharinfo(0),"Your ("+.@iid+") item"+(.@iid > 1? "s were":" was")+" identified!";
specialeffect2 101,strcharinfo(0);
close;
case 4:
if ( da > gettimetick(2) ){
message strcharinfo(0), "You must wait [ "+(da - gettimetick(2))+" ] seconds before you can use NPC Buff again.";
close;
}
.@ablvl = $ablv;
.@abtime = 1000 * $abt;
if ($pay_conf){
if (Zeny < $pay) {
message strcharinfo(0), "You do not have enough zeny.";
close;
}
Zeny -= $pay;
}
sc_start SC_BLESSING,.@abtime,.@ablvl;
sc_start SC_INC_AGI,.@abtime,.@ablvl;
specialeffect2 42,strcharinfo(0);
specialeffect2 37,strcharinfo(0);
if ($delay_conf) {
if ($delay)
da = gettimetick(2) + $delay;
}
message strcharinfo(0), "You were blessed with dexterity, intelligence, strength, and agility!";
close;
case 5:
if ( dl > gettimetick(2) ){
message strcharinfo(0), "You must wait [ "+(dl - gettimetick(2))+" ] seconds before you can use NPC Link again.";
close;
}
.@sllv = $sllvl;
.@slt = 1000*$sltime;
if (.@slink = .sl[BaseJob]);
else if (Upper == 1) {
.@slink = SL_HIGH;
}
if (.@slink){
if ($pay_conf) {
if (Zeny < $pay) {
message strcharinfo(0), "You do not have enough zeny.";
close;
}
Zeny -= $pay;
}
sc_start2 SC_SOULLINK, .@slt, .@sllv, .@slink;
skilleffect .@slink, 1;
if ($delay_conf) {
if ($delay)
dl = gettimetick(2) + $delay;
}
close;
}
message strcharinfo(0),"Your job is not suitable for Soul Link.";
close;
}
M_Config:
mes .npc$;
mes "Please configure the following.";
next;
switch(select(($delay_conf? "[^FF0000CONFIG^000000] NPC Cooldown":"^777777[CONFIG] NPC Cooldown^000000"),($pay_conf? "[^FF0000CONFIG^000000] Payment":"^777777[CONFIG] Payment^000000"),($heal_conf? "Purify my soul":"^777777Purify my soul^000000"),($identify_conf? "Identify my items":"^777777Identify my items^000000"),($agibless_conf? "Buff please":"^777777Buff please^000000"),($soullink_conf? "Soul Link":"^777777Soul Link^000000"),"[ ^0000ffReset NPC^000000 ]")){
case 1:
mes .npc$;
mes "Status: "+($delay_conf? "^28bf00Enabled^000000":"^777777Disabled^000000");
mes ($delay_conf? "Cooldown: ^FF0000"+$delay+"^000000":"");
mes "What would you like to do?";
next;
switch(select(($delay_conf? "Disable":"Enable"),($delay_conf? "Set NPC Cooldown":""),"Back")){
case 1:
$delay_conf = ($delay_conf? "0":"1");
if (!$delay){
$delay = 60;
message strcharinfo(0), "Default NPC Cooldown was set!";
}
message strcharinfo(0), "NPC Cooldown was "+($delay_conf? "enabled":"disabled")+"!";
close;
case 2:
D_Conf:
mes .npc$;
mes "Well then, please set the NPC cooldown value in ^FF0000seconds^000000 carefully.";
input .@ncd;
next;
mes .npc$;
if (.@ncd < 1){
mes "You entered an invalid value, please enter the value again that is higher than 0.";
message strcharinfo(0), "Invalid Value!";
next;
callsub D_Conf;
end;
}
mes "Cooldown: ^FF0000"+.@ncd+"^000000 second"+(.@ncd > 1? "s":"");
mes "Is this correct?";
mes "Please do confirm.";
next;
if (select("Yes","No") != 2) {
close2;
$delay = .@ncd;
message strcharinfo(0), "Value was set!";
end;
}
callsub D_Conf;
end;
case 3:
callsub M_Config;
end;
}
case 2:
mes .npc$;
mes "Status: "+($pay_conf? "^28bf00Enabled^000000":"^777777Disabled^000000");
mes ($pay_conf? "Payment: ^FF0000"+$pay+"^000000 z":"");
mes "What would you like to do?";
next;
switch(select(($pay_conf? "Disable":"Enable"),($pay_conf? "Set Payment":""),"Back")){
case 1:
$pay_conf = ($pay_conf? "0":"1");
if (!$pay){
$pay = 100000;
message strcharinfo(0), "Default payment was set!";
}
message strcharinfo(0), "Payment was "+($pay_conf? "enabled":"disabled")+"!";
close;
case 2:
P_Conf:
mes .npc$;
mes "Well then, please set the amount carefully.";
input .@p;
next;
mes .npc$;
if (.@p < 1){
mes "You entered an invalid amount, please enter the amount again that is higher than 0.";
message strcharinfo(0), "Invalid Amount!";
next;
callsub P_Conf;
end;
}
mes "Amount: ^FF0000"+.@p+"^000000 z";
mes "Is this correct?";
mes "Please do confirm.";
next;
if (select("Yes","Back") != 2 ){
close2;
$pay = .@p;
message strcharinfo(0), "Amount was set!";
end;
}
callsub P_Conf;
end;
case 3:
callsub M_Config;
end;
}
case 3:
mes .npc$;
mes "Would you like to "+($heal_conf? "disable":"enable")+" Heal?";
next;
if (select("Yes","No") != 2 ){
$heal_conf = ($heal_conf? "0":"1");
message strcharinfo(0), "Heal & Debuff was "+($heal_conf? "enabled":"disabled")+"!";
close;
}
close;
case 4:
mes .npc$;
mes "Would you like to "+($identify_conf? "disable":"enable")+" Magnifier?";
next;
if (select("Yes","No") != 2 ){
$identify_conf = ($identify_conf? "0":"1");
message strcharinfo(0), "Magnifier was "+($identify_conf? "enabled":"disabled")+"!";
close;
}
close;
case 5:
mes .npc$;
mes "Status: "+($agibless_conf? "^28bf00Enabled^000000":"^777777Disabled^000000");
if ($agibless_conf){
mes "Skill Level: ^ff0000"+$ablv+"^000000";
mes "Skill Duration: ^ff0000"+$abt+"^000000";
}
mes "What would you like to do?";
next;
switch(select(($agibless_conf? "Disable":"Enable"),($agibless_conf? "Set Level & Duration":""),"Back")){
case 1:
$agibless_conf = ($agibless_conf? "0":"1");
if (!$abt){
message strcharinfo(0), "Default values for the skill duration was set!";
$abt = 60;
}
if (!$ablv){
message strcharinfo(0), "Default values for the skill level was set!";
$ablv = 10;
}
message strcharinfo(0), "Buff was "+($agibless_conf? "enabled":"disabled")+"!";
close;
case 2:
AB_Conf:
mes .npc$;
mes "Well then, please set";
mes "your desired value for the skill ^ff0000level^000000.";
input .@abl;
next;
mes .npc$;
if (.@abl > 10) || (.@abl < 1){
mes "You entered an invalid";
mes "level value, skill level must not more than 10 or less than 1.";
message strcharinfo(0), "Invalid level value!";
next;
callsub AB_Conf;
end;
}
mes "Please set the";
mes "skill ^FF0000duration^000000 value you desire and it must be in seconds!";
input .@abtm;
next;
mes .npc$;
if (.@abtm < 1) {
mes "You entered an invalid";
mes "duration value, it must not be less than 1.";
message strcharinfo(0), "Invalid duration value!";
next;
callsub AB_Conf;
end;
}
mes "Skill Level: ^FF0000"+.@abl+"^000000";
mes "Skill Duration: ^FF0000"+.@abtm+"^000000";
mes "Is this correct?";
mes "Please do confirm.";
next;
if (select("Yes","Back") != 2){
close2;
$ablv = .@abl;
$abt = .@abtm;
message strcharinfo(0), "Values were set!";
end;
}
callsub AB_Conf;
end;
case 3:
callsub M_Config;
end;
}
case 6:
mes .npc$;
mes "Status: "+($soullink_conf? "^28bf00Enabled^000000":"^777777Disabled^000000");
if ($soullink_conf){
mes "Skill Level: ^ff0000"+$sllvl+"^000000";
mes "Skill Duration: ^ff0000"+$sltime+"^000000";
}
mes "What would you like to do?";
next;
switch(select(($soullink_conf? "Disable":"Enable"),($soullink_conf? "Set Level & Duration":""),"Back")){
case 1:
$soullink_conf = ($soullink_conf? "0":"1");
if (!$sltime){
message strcharinfo(0), "Default values for the skill duration was set!";
$sltime = 60;
}
if (!$sllvl){
message strcharinfo(0), "Default values for the skill level was set!";
$sllvl = 5;
}
message strcharinfo(0), "Linker was "+($soullink_conf? "enabled":"disabled")+"!";
close;
case 2:
SL_Conf:
mes .npc$;
mes "Well then, please set";
mes "your desired value for the skill ^ff0000level^000000.";
input .@s;
next;
mes .npc$;
if (.@s > 5) || (.@s < 1){
mes "You entered an invalid";
mes "level value, skill level must not more than 5 or less than 1.";
message strcharinfo(0), "Invalid level value!";
next;
callsub SL_Conf;
end;
}
mes "Please set the";
mes "skill ^FF0000duration^000000 value you desire and it must be in seconds!";
input .@sd;
next;
mes .npc$;
if (.@sd < 1){
mes "You entered an invalid";
mes "duration value, it must not be less than 1.";
message strcharinfo(0), "Invalid duration value!";
next;
callsub SL_Conf;
end;
}
mes "Skill Level: ^FF0000"+.@s+"^000000";
mes "Skill Duration: ^FF0000"+.@sd+"^000000";
mes "Is this correct?";
mes "Please do confirm.";
next;
if (select("Yes","Back") != 2){
close2;
$sllvl = .@s;
$sltime = .@sd;
message strcharinfo(0), "Values were set!";
end;
}
callsub SL_Conf;
end;
case 3:
callsub M_Config;
end;
}
case 7:
callsub M_Admin;
end;
}
M_Admin:
mes .npc$;
mes "Are you sure you want to reset the NPC?";
next;
if (select("No","Yes") != 2){
mes .npc$;
mes "Okay then!";
close;
}
close2;
// -- configuration check reset
$delay_conf = 0; $pay_conf = 0; $heal_conf = 0;
$identify_conf = 0; $agibless_conf = 0; $soullink_conf = 0;
// -- value reset
$delay = 0; $sltime = 0; $sllvl = 0;
$ablv = 0; $abt = 0; $pay = 0;
message strcharinfo(0), .n$+" NPC was succesfully been reset!";
end;
OnInit:
// ----------------
// set npc name here.
.n$ = "Advance Healer";
// DO NOT TOUCH THIS ".npc$" :-)
.npc$ = "[ ^FF0000"+.n$+"^000000 ]";
// if HEAL is enabled, (this serves as the array of negative buffs to be removed) set this according to your liking.
setarray .nstat[0], SC_STONE, SC_FREEZE, SC_STUN, SC_SLEEP, SC_POISON,
SC_CURSE, SC_SILENCE, SC_CONFUSION, SC_BLIND, SC_BLOODING,
SC_DPOISON, SC_FEAR, SC_COLD, SC_BURNING, SC_DEEP_SLEEP, SC_DEC_AGI,
SC_BROKENARMOR, SC_BROKENWEAPON, SC_NOEQUIPWEAPON, SC_NOEQUIPSHIELD,
SC_NOEQUIPARMOR, SC_NOEQUIPHELM, SC__STRIPACCESSARY, SC_PROPERTYUNDEAD,
SC_ORCISH, SC_BERSERK, SC_SKE, SC_SWOO, SC_SKA;
// DO NOT TOUCH THIS LINE BELOW
.sl[Job_Crusader] = SL_CRUSADER; .sl[Job_Knight] = SL_KNIGHT; .sl[Job_Monk] = SL_MONK;
.sl[Job_Sage] = SL_SAGE; .sl[Job_Wizard] = SL_WIZARD; .sl[Job_Blacksmith] = SL_BLACKSMITH;
.sl[Job_Alchemist] = SL_ALCHEMIST; .sl[Job_Hunter] = SL_HUNTER; .sl[Job_Assassin] = SL_ASSASIN;
.sl[Job_Priest] = SL_PRIEST; .sl[Job_Rogue] = SL_ROGUE; .sl[Job_Bard] = .sl[Job_Dancer] = SL_BARDDANCER;
.sl[Job_Soul_Linker] = SL_SOULLINKER; .sl[Job_Star_Gladiator] = SL_STAR; .sl[Job_SuperNovice] = SL_SUPERNOVICE;
end;
}