Hi
//===== rAthena Script =======================================
//= https://rathena.org/board/topic/141811-npc-refiner-vip-and-non-vip/
//============================================================
prontera,170,181,4 script Refiner VIP 4_4JOB_MAURA,{
disable_items;
cutin "4job_maura_01.PNG",2;
mes "[Refiner VIP]";
mes "Greetings!";
mes "I can refine an item up to the ^006400+10^000000 to ^0000FFVIP adventurers^000000...";
mes "You don't have to worry! There's no chance of breaking your item.";
if (vip_status(VIP_STATUS_ACTIVE))
.@r = 10;
else {
next;
mes "[Refiner VIP]";
mes "Since you're not a VIP, I can refine your items to ^006400+7^000000.";
.@r = 7;
}
next;
setarray .@position$[1],"Head upper","Armor","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head middle","Head lower";
setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW;
switch(select("Refine everything", "Choose equipment", "Remove refine", "Cancel")) {
mes "[Refiner VIP]";
case 1:
mes "I'm going to refine every refinable item you have equipped up to the +" + .@r + " level^000000.";
mes "May I proceed?";
next;
if(select("No.", "Yes.") == 1) {
emotion ET_THINK;
mes "[Refiner VIP]";
mes "Oh, you changed your mind.";
mes "Ok.";
mes "You can come back later.";
close3;
}
for (.@i = 1; .@i < getarraysize(.@indices); .@i++) {
if (getequipisequiped(.@indices[.@i]) &&
getequipisenableref(.@indices[.@i]) &&
getequiprefinerycnt(.@indices[.@i]) < .@r) {
successrefitem .@indices[.@i], .@r - getequiprefinerycnt(.@indices[.@i]);
.@refined++;
}
}
mes "[Refiner VIP]";
if (.@refined) {
specialeffect EF_SUI_EXPLOSION;
mes "Alright, it is done~";
mes "I refined " + F_InsertPlural(.@refined, "item") + "!";
}
else
mes "There is nothing to refine...";
close3;
case 2:
break;
case 3:
.@remove = true;
mes "This is rare. But sure...";
break;
case 4:
mes "Okay. You can come again later.";
close3;
}
mes "Please choose the equipment.";
for ( .@i = 1; .@i <= 10; ++.@i )
.@menu$ += (getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : .@position$[.@i] + "- [Empty]") + ":";
.@part = .@indices[ select(.@menu$) ];
clear;
if (!getequipisequiped(.@part)) {
mes "[Refiner VIP]";
mes "You have to equip the item you want to refine.";
close3;
}
if (!getequipisenableref(.@part)) {
emotion ET_OTL;
mes "[Refiner VIP]";
mes "Oh, I'm sorry.";
mes "This item is impossible to refine.";
close3;
}
.@refineitemid = getequipid(.@part); // save id of the item
.@refinerycnt = getequiprefinerycnt(.@part); //save refinery count
setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
if (.@remove) {
if (!getequiprefinerycnt(.@part)) {
mes "[Refiner VIP]";
mes "^8B4513This item has no refine.^000000";
mes "I can't proceed.";
close3;
}
}
else if (getequiprefinerycnt(.@part) >= .@r) {
emotion ET_PROFUSELY_SWEAT;
mes "[Refiner VIP]";
mes "^8B4513This item is already refined as much as your deed.^000000";
if (getequiprefinerycnt(.@part) < 10 && !vip_status(VIP_STATUS_ACTIVE)) {
mes "You can become a ^0000FFVIP adventurer^000000 to continue using my services.";
}
else
mes "Please come along with an item refined less than +" + .@r + ".";
close3;
}
mes "[Refiner VIP]";
if (.@remove)
mes "I'm going to ^8B4513remove the refine^000000 of ^006400" + getequipname(.@part) + ".";
else
mes "I'm going to refine ^006400"+getequipname(.@part)+"^8B4513 up to the +"+.@r+" level^000000.";
mes "May I proceed?";
next;
if(select("No.:Yes.") == 1) {
emotion ET_THINK;
mes "[Refiner VIP]";
mes "Oh, you changed your mind.";
mes "Ok.";
mes "You can come back later.";
close3;
}
mes "[Refiner VIP]";
mes "Great.";
mes "As you wish!";
mes "I have my own special way to refine...";
mes ".......ka boom!";
specialeffect EF_SUI_EXPLOSION;
// anti-hack
if (callfunc("F_IsEquipIDHack", .@part, .@refineitemid) ||
callfunc("F_IsEquipRefineHack", .@part, .@refinerycnt) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3])) {
mes "[Refiner VIP]";
emotion ET_FRET;
mes "Wait a second...";
mes "Do you think I'm stupid?!";
mes "You switched the item while I wasn't looking! Get out of here!";
close3;
}
if (.@remove)
downrefitem .@part, getequiprefinerycnt(.@part);
else
successrefitem .@part, .@r - getequiprefinerycnt(.@part);
next;
emotion ET_DELIGHT;
mes "[Refiner VIP]";
mes "Alright, here it is~";
mes "Well, ^0000FF"+strcharinfo(0)+"^000000!";
mes "Congratulations. You look GREAT!";
close3;
}