viewing paste [ Request ] Fully Configurable Adva | Athena

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
// =============================
/* 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;
}
Viewed 1558 times, submitted by Legend.