Can anyone teach me how to remove fail rate in this script, I have tried many ways, but not working.
Thanks in advance
L_CardRemoval:
UPGRADEROOT:
mes "Card Removal it is.";
next;
mes "[" + getarg(0) + "]";
mes "I see you desire some cards taken from your equipment,or does this sound like what your looking for?";
next;
menu "Yes, it does.",REMOVEMENU,"What do you charge?",REMOVEPRICE,"No thanks.",CLOSEOUT;
REMOVEPRICE:
mes "[" + getarg(0) + "]";
mes "I charge a flat fee of 5000 zeny, plus 5000 zeny for each card I remove from the item.";
next;
menu "Alright. Let's do it.",REMOVEMENU,"No thanks.",CLOSEOUT;
REMOVEMENU:
mes "[" + getarg(0) + "]";
mes "Very well. Which item shall I examine for you?";
next;
menu "I changed my mind.",CLOSEOUT,
getequipname(1),SLOT1,
getequipname(2),SLOT2,
getequipname(3),SLOT3,
getequipname(4),SLOT4,
getequipname(5),SLOT5,
getequipname(6),SLOT6,
getequipname(7),SLOT7,
getequipname(8),SLOT8,
getequipname(9),SLOT9,
getequipname(10),SLOT10;
SLOT1:
set @part,1;
goto CARDNUMCHECK;
SLOT2:
set @part,2;
goto CARDNUMCHECK;
SLOT3:
set @part,3;
goto CARDNUMCHECK;
SLOT4:
set @part,4;
goto CARDNUMCHECK;
SLOT5:
set @part,5;
goto CARDNUMCHECK;
SLOT6:
set @part,6;
goto CARDNUMCHECK;
SLOT7:
set @part,7;
goto CARDNUMCHECK;
SLOT8:
set @part,8;
goto CARDNUMCHECK;
SLOT9:
set @part,9;
goto CARDNUMCHECK;
SLOT10:
set @part,10;
goto CARDNUMCHECK;
CARDNUMCHECK:
if(getequipcardcnt(@part) == 0) goto DENYCARDCOUNT;
set @cardcount,getequipcardcnt(@part);
if(@cardcount > 1) goto CARDNUMMULTIMSG;
mes "[" + getarg(0) + "]";
mes "This item has " + @cardcount + " card compounded on it. To perform my magic, I will need 5000 zeny.";
goto CARDNUMPOSTMSG;
CARDNUMMULTIMSG:
mes "[" + getarg(0) + "]";
mes "This item has " + @cardcount + " cards compounded on it. To perform my magic, I will need " + (5000+(@cardcount * 5000)) + " zeny.";
CARDNUMPOSTMSG:
next;
menu "Very well. Do it.",REMOVECARDWARNING,"Never mind.",CLOSEOUT;
REMOVECARDWARNING:
mes "[" + getarg(0) + "]";
mes "Before I begin, I must warn you--I may fail. If I do, you will only lose what you have invested?";
menu "Go Ahead",PRIORITYITEM,"I changed my mind about this.",CLOSEOUT;
PRIORITYITEM:
set @failtype,0;
goto REMOVECARD;
REMOVECARD:
mes "[" + getarg(0) + "]";
mes "Very well. I shall begin.";
next;
if((zeny < (5000+(@cardcount * 5000)))) goto DENYMATERIAL;
set zeny,zeny - (5000+(@cardcount * 5000));
// 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 @failchance,rand(100);
if(@failchance < 2) goto FAILREMOVECARD0;
if((@failchance < 8) && (@failtype == 1)) goto FAILREMOVECARD0;
if((@failchance < 8) && (@failtype == 2)) goto FAILREMOVECARD0;
if(@failchance < 1) goto FAILREMOVECARD0;
successremovecards @part;
mes "[" + getarg(0) + "]";
mes "The process was a success. Here are your cards and your item. Farewell.";
close;
FAILREMOVECARD0:
mes "[" + getarg(0) + "]";
mes "The process was a total failure. I am afraid the item and the cards were destroyed.";
failedremovecards @part,0;
close;
FAILREMOVECARD1:
mes "[" + getarg(0) + "]";
mes "While I have managed to remove the cards from the item, they were destroyed in the process. The item, however, is okay.";
failedremovecards @part,1;
close;
FAILREMOVECARD2:
mes "[" + getarg(0) + "]";
mes "Most unfortunate. I succeeded at removing the cards, but the item itself was destroyed in the process.";
failedremovecards @part,2;
close;
FAILREMOVECARD3:
mes "[" + getarg(0) + "]";
mes "I have failed to remove the cards. Better luck next time.";
failedremovecards @part,3;
close;
DENYCARDCOUNT:
mes "[" + getarg(0) + "]";
mes "There are no cards compounded on this item. Quit wasting my time.";
close;
DENYMATERIAL:
mes "[" + getarg(0) + "]";
mes "You do not have enough zeny, go get some cash. My work isn't for free.";
close;
CLOSEOUT:
mes "[" + getarg(0) + "]";
mes "Very well. Return at once if you seek my services.";
close;
Question
casteryee
Can anyone teach me how to remove fail rate in this script, I have tried many ways, but not working.
Thanks in advance
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.