Hola
//===== rAthena Script =======================================
//= https://rathena.org/board/topic/142082-pedido-npc-refinador-agregar-bonus/
//============================================================
prontera,170,181,4 script Refinador 4_4JOB_MAURA,{
.@max = 10; //max refino
disable_items;
cutin "4job_maura_01.PNG",2;
mes "[Refinador]";
mes "Hola. Puedo refinar tus equipos ^0000FFsin que se rompan^000000, que ^0000FFno cobre nada^000000 y te deje ^0000FFelegir a qué nivel sube (+1 ~ +" + .@max + ")^000000!";
mes "Por favor elige el equipo.";
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;
for ( .@i = 1; .@i <= 10; ++.@i )
.@menu$ += .@position$[.@i] + " [" + (getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : .@position$[.@i] + "- Nada") + "]:";
.@part = .@indices[ select(.@menu$) ];
clear;
if (!getequipisequiped(.@part)) {
mes "[Refinador]";
mes "Tienes que equipar el equipo que quieres refinar.";
close3;
}
if (!getequipisenableref(.@part)) {
emotion ET_OTL;
mes "[Refinador]";
mes "Oh lo siento.";
mes "Este artículo es imposible de refinar.";
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);
mes "[Refinador]";
mes "A qué nivel quieres refinar tu " + .@position$[@menu] + "?";
input .@r;
clear;
if (.@r < 1) {
mes "[Refinador]";
mes "Sólo puedo refinar de +1 a +" + .@max + ".";
close3;
}
if (.@r > .@max) {
mes "[Refinador]";
mes "Solo puedo refinar desde hasta +" + .@max + ".";
if (select("Refinar a +" + .@max + ".", "No importa.") == 2)
close3;
.@r = .@max;
}
if (getequiprefinerycnt(.@part) == .@r) {
emotion ET_PROFUSELY_SWEAT;
mes "[Refinador]";
mes "^8B4513Este artículo ya está refinado al nivel que deseas...^000000";
close3;
}
// 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])) {
next;
emotion ET_FRET;
mes "[Refinador]";
mes "Espera un segundo...";
mes "¡¿Crees que soy estúpido?!";
mes "¡Cambiaste el objeto mientras yo no miraba! ¡Fuera de aquí!";
close3;
}
if (getequiprefinerycnt(.@part) > .@r)
downrefitem .@part, getequiprefinerycnt(.@part) - .@r;
else
successrefitem .@part, .@r - getequiprefinerycnt(.@part);
emotion ET_DELIGHT;
specialeffect EF_SUI_EXPLOSION;
mes "[Refinador]";
mes "Muy bien, aquí está ~";
close3;
}
Puedes usar el sistema de Random Options.