hello have a problem with the script:
//===== rAthena Script =======================================
//= Card Removal NPC
//===== By: ==================================================
//= TyrNemesis^
//===== Current Version: =====================================
//= 1.2a
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Removes cards from equipped items.
//===== Additional Comments: =================================
//= 1.0 First version. [TyrNemesis^]
//= 1.2 Optimized and fixed getequipname menu. [Kisuka]
//= 1.2a Added 'disable_items' command. [Euphy]
//============================================================
malaya,289,364,4 script Mustafa#eAcustom 813,{
set .zenycost,200000; // base cost of the card remover services (in Zeny)
set .percardcost,25000; // cost per card of the card remover services (in Zeny)
set .faildestroy,0; // should the card remover have a chance of failure that destroys items? (1=yes, 0=no)
disable_items;
mes "[Mustafa]";
mes "Do you wanna refine your equipment ?"
menu "Yes!",x_refine,"No",-;
close;
x_card:
mes "[Mustafa]";
mes "Good day, young one. I have the power to remove cards that you have compounded onto your equipment. Does this idea please you?";
next;
switch(select("Yes, it does.:What do you charge?:No thanks.")) {
case 1:
mes "[Mustafa]";
mes "Very well. Which item shall I examine for you?";
next;
setarray
[email protected]$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
set
[email protected]$,"";
for( set
[email protected],1;
[email protected] <= 10; set
[email protected],
[email protected]+1 )
{
if( getequipisequiped(
[email protected]) )
set
[email protected]$,
[email protected]$ +
[email protected]$[
[email protected]] + "-" + "[" + getequipname(
[email protected]) + "]";
set
[email protected]$,
[email protected]$ + ":";
}
set
[email protected],select(
[email protected]$);
if(!getequipisequiped(
[email protected])) {
mes "[Mustafa]";
mes "Young one... Your not wearing anything there that I can remove cards from.";
close;
}
if(getequipcardcnt(
[email protected]) == 0) {
mes "[Mustafa]";
mes "Young one... There are no cards compounded on this item. I can do nothing with it, I'm afraid.";
close;
}
set
[email protected],getequipcardcnt(
[email protected]);
if (!checkweight(1202,(
[email protected]+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 "[Mustafa]";
mes "This item has " +
[email protected] + " cards compounded on it. To perform my magic, I will need " + (.zenycost+(
[email protected] * .percardcost)) + " zeny, a ^0000FFStar Crumb^000000, and a ^0000FFYellow Gemstone^000000.";
next;
if(select("Very well. Do it.:Nevermind.") == 2) {
mes "[Mustafa]";
mes "Very well. Return at once if you seek my services.";
close;
}
if((zeny < (.zenycost+(
[email protected] * .percardcost))) || (countitem(1000) < 1) || (countitem(715) < 1)) {
mes "[Mustafa]";
mes "You do not have all the items I require to work my magic, child. Come again when you do.";
close;
}
mes "[Mustafa]";
mes "Before I begin, I must warn you--I may fail. If I do, I may destroy the cards, the item, or both. I do not give refunds. That being said, which is more important to you: The cards, or the item?";
next;
switch(select("I changed my mind about this.:The item.:The cards.")) {
case 1:
mes "[Mustafa]";
mes "Very well. Return at once if you seek my services.";
close;
case 2:
set
[email protected],1;
break;
case 3:
set
[email protected],2;
}
mes "[Mustafa]";
mes "Very well. I shall begin.";
set Zeny, Zeny - (.zenycost+(
[email protected] * .percardcost));
delitem 1000,1; //Star_Crumb
delitem 715,1; //Yellow_Gemstone
// Replace the constants in the next 3 lines with failure chance values defined in refine_db.txt
// First value = Total failure chance (item and cards destroyed)
// Second value = Partial failure chance (one or the other is destroyed, player decides which one is safe)
// Third value = Harmless failure chance (all that's lost is your investment)
set
[email protected],rand(100);
if (.faildestroy==1) {
if(
[email protected] < 2) {
next;
failedremovecards
[email protected],0;
mes "[Mustafa]";
mes "The process was a total failure. I am afraid the item and the cards were destroyed.";
close;
}
if(
[email protected] < 8) {
if (
[email protected] == 1) {
next;
failedremovecards
[email protected],1;
mes "[Mustafa]";
mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay.";
close;
}
if (
[email protected] == 2) {
next;
failedremovecards
[email protected],2;
mes "[Mustafa]";
mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process.";
close;
}
}
}
if(
[email protected] < 10) {
next;
failedremovecards
[email protected],3;
mes "[Mustafa]";
mes "I have failed to remove the cards. Luckily, however, both the item and the cards are still okay.";
close;
}
next;
successremovecards
[email protected];
mes "[Mustafa]";
mes "The process was a success. Here are your cards and your item. Farewell.";
close;
case 2:
mes "[Mustafa]";
mes "I charge a flat fee of "+callfunc("F_InsertComma",.zenycost)+" zeny, plus "+callfunc("F_InsertComma",.percardcost)+" zeny for each card I remove from the item. In addition, I need a star crumb and a yellow gemstone to work my magic.";
close;
case 3:
mes "[Mustafa]";
mes "Very well. Return at once if you seek my services.";
close;
}
x_refine:
{
set
[email protected],getarg(1);
mes "[" + getarg(0) + "]";
mes "I'm the Mustafa.";
mes "I can refine all kinds of weapons, armor and equipment, so let me";
mes "know what you want me to refine.";
next;
setarray
[email protected]$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";
set
[email protected]$,"";
for( set
[email protected],1;
[email protected] <= 10; set
[email protected],
[email protected]+1 )
{
if( getequipisequiped(
[email protected]) )
set
[email protected]$,
[email protected]$ +
[email protected]$[
[email protected]] + "-" + "[" + getequipname(
[email protected]) + "]";
set
[email protected]$,
[email protected]$ + ":";
}
set
[email protected],select(
[email protected]$);
if(!getequipisequiped(
[email protected])) {
mes "[" + getarg(0) + "]";
mes "You're not wearing";
mes "anything there that";
mes "I can refine.";
emotion 6;
close;
}
//Check if the item is refinable...
if(!getequipisenableref(
[email protected])) {
mes "[" + getarg(0) + "]";
mes "I don't think I can";
mes "refine this item at all...";
close;
}
//Check if the item is identified... (Don't know why this is in here... but kept it anyway)
if(!getequipisidentify(
[email protected])) {
mes "[" + getarg(0) + "]";
mes "You can't refine this";
mes "if you haven't appraised";
mes "it first. Make sure your";
mes "stuff is identified before";
mes "I can refine it.";
close;
}
//Check to see if the items is already +10
if(getequiprefinerycnt(
[email protected]) >= 10) {
mes "[" + getarg(0) + "]";
mes "I can't refine this";
mes "any more. This is as";
mes "refined as it gets!";
close;
}
set
[email protected], getequipid(
[email protected]); // save id of the item
set
[email protected], getequiprefinerycnt(
[email protected]); //save refinery count
switch(getequipweaponlv(
[email protected])){
case 0: //Refine Armor
set
[email protected],2000;
set
[email protected],985;
set
[email protected],4;
break;
case 1: //Refine Level 1 Weapon
set
[email protected],50;
set
[email protected],1010;
set
[email protected],7;
break;
case 2: //Refine Level 2 Weapon
set
[email protected],200;
set
[email protected],1011;
set
[email protected],6;
break;
case 3: //Refine Level 3 Weapon
set
[email protected],5000;
set
[email protected],984;
set
[email protected],5;
break;
case 4: //Refine Level 4 Weapon
set
[email protected],20000;
set
[email protected],984;
set
[email protected],4;
break;
case 5: //Refine other stuff?
set
[email protected],2000;
set
[email protected],985;
set
[email protected],4;
break;
}
if(
[email protected] != 1) {
mes "[" + getarg(0) + "]";
mes "To refine this I need";
mes "one ^003366"+getitemname(
[email protected])+"^000000 and";
mes "a service fee of " +
[email protected] + " Zeny.";
mes "Do you really wish to continue?";
next;
if(select("Yes:No") == 2){
mes "[" + getarg(0) + "]";
mes "Yeah...";
mes "There's no need to";
mes "rush. Take your time.";
close;
}
if(getequippercentrefinery(
[email protected]) < 100) {
mes "[" + getarg(0) + "]";
mes "Oh no! If I continue to";
mes "refine this, there's a risk it could";
switch(
[email protected]) {
case 985:
mes "be destroyed! That means that ^FF0000this equipment^000000, and ^FF0000any cards^000000 or special properties added to this armor, ^FF0000will be gone^000000.";
break;
default:
mes "be destroyed, and you'd ^FF0000lose the weapon^000000, any ^FF0000cards in the weapon^000000,";
mes "or any added special properties.";
break;
}
next;
mes "["+getarg(0)+"]";
mes "I can't make it any clearer.";
mes "Once a weapon is destroyed,";
mes "there's no getting it back.";
mes "You really have a chance to";
mes "^FF0000lose this weapon^000000 forever.";
mes "Do you still want to refine?";
next;
if(select("Yes:No") == 2){
mes "[" + getarg(0) + "]";
mes "I completely agree...";
mes "I might be a great refiner, but sometimes even I make mistakes.";
close;
}
}
if((countitem(
[email protected]) < 1) || (Zeny <
[email protected])) {
mes "[" + getarg(0) + "]";
mes "You don't seem to have";
mes "enough Zeny or "+getitemname(
[email protected])+"...";
mes "Go get some more. I'll be";
mes "here all day if you need me.";
close;
}
set Zeny,
[email protected];
delitem
[email protected],1;
if(getequipisequiped(
[email protected]) == 0) { // hacker has removed the item (not changed, why?)
mes "[" + getarg(0) + "]";
mes "Look here... you don't have any Items on...";
close;
}
if(getequiprefinerycnt(
[email protected]) !=
[email protected] || getequipid(
[email protected]) !=
[email protected]) { // hacker has changed the item
mes "[" + getarg(0) + "]";
Emotion e_an;
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!";
close;
}
if(getequippercentrefinery(
[email protected]) <= rand(100)) {
failedrefitem
[email protected];
mes "[" + getarg(0) + "]";
set
[email protected],rand(1,5);
if (
[email protected] == 1) {
Emotion e_cash;
} else {
Emotion e_swt;
}
set
[email protected],rand(1,3);
if (
[email protected] == 1) {
mes "OH! MY GOD!";
mes "Damn it! Not again!";
mes "I'm terribly sorry, but you know practice does make perfect.";
mes "Um, right? Heh heh...";
} else if(
[email protected] == 2) {
mes "Nooooooo!";
mes "It broke!";
mes "I-I'm sorry!";
} else {
mes "Crap!";
mes "It couldn't take";
mes "much more tempering!";
mes "Sorry about this...";
}
close;
}
mes "["+getarg(0)+"]";
successrefitem
[email protected];
Emotion e_heh;
set
[email protected],rand(1,3);
if (
[email protected] == 1) {
mes "Perfect!";
mes "Heh heh!";
mes "Once again,";
mes "flawless work";
mes "from the master~";
} else if(
[email protected] == 2) {
mes "Success...!";
mes "Yet again, my amazing";
mes "talent truly dazzles";
mes "and shines today.";
} else {
mes "Heh heh!";
mes "I'm all done.";
mes "No doubt, my work is";
mes "to your satisfaction.";
mes "Sheer, utter perfection~";
}
close;
}}}