//===== rAthena Script =======================================
// Enchanted Stones Remover
//===== By: ==================================================
//= Masao
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= Any rAthena SVN
//===== Description: =========================================
//= Entfernt Enchanted Stones aus Headgears.
//===== Additional Comments: =================================
//= 1.0 First Version. [Masao]
//============================================================
prontera,155,180,4 script Enchant Remover 123,{
set .zenycost,200000; // Set base cost in zeny of the enchant remover services
set .perenchantcost,25000; // set cost per enchant of the enchant remover services
set @enchantnmbr,0;
mes "[Enchant Remover]";
mes "Good day, young one. I have the power to remove enchantments that you have compounded onto your headgears. Doesn't that sound great?";
next;
switch(select("Yes, it does.:What do you charge?:No thanks.")) {
case 1:
mes "[Enchant Remover]";
mes "Very well. Which item shall I examine for you?";
next;
switch(select("[" + getequipname(1) + "]:[" + getequipname(9) + "]:[" + getequipname(10) + "]")){
case 1:
set @part,1;
set @eid,getequipid(@part);
break;
case 2:
set @part,9;
set @eid,getequipid(@part);
break;
case 3:
set @part,10;
set @eid,getequipid(@part);
break;
}
if((!getequipcardid(@part,1)) && (!getequipcardid(@part,2)) && (!getequipcardid(@part,3))) {
mes "[Enchant Remover]";
mes "Young one... There are no enchantments compounded on this item. I can do nothing with it, I'm afraid.";
close;
}
if(getequipcardid(@part,1)){
set @enchantnmbr,@enchantnmbr+1;
}
if(getequipcardid(@part,2)){
set @enchantnmbr,@enchantnmbr+1;
}
if(getequipcardid(@part,3)){
set @enchantnmbr,@enchantnmbr+1;
}
set @enchantcount,@enchantnmbr;
if (!checkweight(1202,(@enchantcount+1))) {
mes "^3355FFJust a minute!";
mes "I can't offer any of my";
mes "services to you because";
mes "you're carrying too much";
mes "stuff. Put your extra items in";
mes "Kafra Storage and come again~";
close;
}
mes "[Enchant Remover]";
mes "This item has " + @enchantcount + " enchantments compounded on it. To perform my magic, I will need " + (.zenycost+(@enchantcount * .perenchantcost)) + " zeny.";
next;
mes "[Enchant Remover]";
mes "^FF0000And be aware that there is an 30% chance of failure when removing the stones! Which means the zeny and the enchanted stones will be gone if I fail!^000000";
mes "So are you sure you want to proceed?";
next;
switch(select("Yes, remove all enchantments:Yes, remove specific enchantment:No, I want to cancel")) {
case 1:
mes "[Enchant Remover]";
mes "Very well. I shall begin.";
next;
if(zeny < (.zenycost+(@enchantcount * .perenchantcost))) {
mes "[Enchant Remover]";
mes "You do not have enough zeny which I require to work my magic, child. Come again when you do.";
close;
}
if(!getequipisequiped(@part)) {
mes "[Wise Old Woman]";
mes "Young one... Your not wearing anything there that I can remove cards from.";
close;
}
if(getequipid(@part) != @eid){
mes "[Enchant Remover]";
mes "Are you trying to make me laugh?!";
mes "I saw exactly how you tried to change your Equipment!";
close;
}
set @refine,getequiprefinerycnt(@part);
set @card,getequipcardid(@part,0);
set @enchant2,getequipcardid(@part,1);
set @enchant3,getequipcardid(@part,2);
set @enchant4,getequipcardid(@part,3);
set zeny,zeny - (.zenycost+(@enchantcount * .perenchantcost));
delitem2 @eid,1,1,@refine,0,@card,@enchant2,@enchant3,@enchant4;
if(rand(100) >= 30){
if(@enchant2){
getitem @enchant2,1;
}
if(@enchant3){
getitem @enchant3,1;
}
if(@enchant4){
getitem @enchant4,1;
}
}
getitem2 @eid,1,1,@refine,0,@card,0,0,0;
mes "[Enchant Remover]";
mes "The process was a success. Here are your enchantments and your item. Farewell.";
close;
case 2:
mes "[Enchant Remover]";
mes "Ok, which enchantment should I remove?";
next;
switch(select("1st:2nd:3rd:Cancel")){
case 1:
mes "[Enchant Remover]";
mes "Very well. I shall begin.";
next;
if(zeny < (.zenycost+.perenchantcost)) {
mes "[Enchant Remover]";
mes "You do not have enough zeny which I require to work my magic, child. Come again when you do.";
close;
}
if(!getequipisequiped(@part)) {
mes "[Wise Old Woman]";
mes "Young one... Your not wearing anything there that I can remove cards from.";
close;
}
if(getequipid(@part) != @eid){
mes "[Enchant Remover]";
mes "Are you trying to make me laugh?!";
mes "I saw exactly how you tried to change your Equipment!";
close;
}
set @refine,getequiprefinerycnt(@part);
set @card,getequipcardid(@part,0);
set @enchant2,getequipcardid(@part,1);
set zeny,zeny - (.zenycost+.perenchantcost);
delitem2 @eid,1,1,@refine,0,@card,@enchant2,@enchant3,@enchant4;
getitem2 @eid,1,1,@refine,0,@card,0,@enchant3,@enchant4;
if(rand(100) >= 30){
getitem @enchant2,1;
}
mes "[Enchant Remover]";
mes "The process was a success. Here are your enchantments and your item. Farewell.";
close;
case 2:
mes "[Enchant Remover]";
mes "Very well. I shall begin.";
next;
if(zeny < (.zenycost+.perenchantcost)) {
mes "[Enchant Remover]";
mes "You do not have enough zeny which I require to work my magic, child. Come again when you do.";
close;
}
if(!getequipisequiped(@part)) {
mes "[Wise Old Woman]";
mes "Young one... Your not wearing anything there that I can remove cards from.";
close;
}
if(getequipid(@part) != @eid){
mes "[Enchant Remover]";
mes "Are you trying to make me laugh?!";
mes "I saw exactly how you tried to change your Equipment!";
close;
}
set @refine,getequiprefinerycnt(@part);
set @card,getequipcardid(@part,0);
set @enchant3,getequipcardid(@part,2);
set zeny,zeny - (.zenycost+.perenchantcost);
delitem2 @eid,1,1,@refine,0,@card,@enchant2,@enchant3,@enchant4;
if(rand(100) >= 30){
getitem @enchant3,1;
}
getitem2 @eid,1,1,@refine,0,@card,@enchant2,0,@enchant4;
mes "[Enchant Remover]";
mes "The process was a success. Here are your enchantments and your item. Farewell.";
close;
case 3:
mes "[Enchant Remover]";
mes "Very well. I shall begin.";
next;
if(zeny < (.zenycost+.perenchantcost)) {
mes "[Enchant Remover]";
mes "You do not have enough zeny which I require to work my magic, child. Come again when you do.";
close;
}
if(!getequipisequiped(@part)) {
mes "[Wise Old Woman]";
mes "Young one... Your not wearing anything there that I can remove cards from.";
close;
}
if(getequipid(@part) != @eid){
mes "[Enchant Remover]";
mes "Are you trying to make me laugh?!";
mes "I saw exactly how you tried to change your Equipment!";
close;
}
set @refine,getequiprefinerycnt(@part);
set @card,getequipcardid(@part,0);
set @enchant4,getequipcardid(@part,3);
set zeny,zeny - (.zenycost+.perenchantcost);
delitem2 @eid,1,1,@refine,0,@card,@enchant2,@enchant3,@enchant4;
if(rand(100) >= 30){
getitem @enchant4,1;
}
getitem2 @eid,1,1,@refine,0,@card,@enchant2,@enchant3,0;
mes "[Enchant Remover]";
mes "The process was a success. Here are your enchantments and your item. Farewell.";
close;
case 4:
mes "[Enchant Remover]";
mes "Very well. Return at once if you seek my services.";
close;
}
case 3:
mes "[Enchant Remover]";
mes "Very well. Return at once if you seek my services.";
close;
}
case 2:
mes "[Enchant Remover]";
mes "I charge a flat fee of "+.zenycost+" zeny, plus "+.perenchantcost+" zeny for each card I remove from the item.";
mes "^FF0000And be aware that there is an 30% chance of failure when removing the stones! Which means the zeny and the enchanted stones will be gone if I fail!^000000";
close;
case 3:
mes "[Enchant Remover]";
mes "Very well. Return at once if you seek my services.";
close;
}
}