How to make this Enchanted Expert NPC able to enchant all equip including mid headgears and accessories, or can anyone customize the script to be able to configure the equipment option which one to enable.
Thank much, any pro scripter please help me about this.
prontera,165,164,4 script Enchant Expert 626,{
mes "[Enchant Expert]";
mes "Hey, today might be your lucky day !!";
mes "Do you want to enchant your equipped armor ?";
next;
mes "[Enchant Expert]";
mes "The enchant system give you a random stats from +1 to +10.";
mes "Of course, the higher the stats, the lower the percentage.";
next;
if ( select ( "yes", "no" ) == 2 ) close;
if ( !getequipisequiped( EQI_ARMOR ) ) {
mes "you did not equip an armor at the moment";
close;
}
.@id = getequipid( EQI_ARMOR );
.@ref = getequiprefinerycnt( EQI_ARMOR );
.@card1 = getequipcardid( EQI_ARMOR, 0 );
.@card2 = getequipcardid( EQI_ARMOR, 1 );
.@card3 = getequipcardid( EQI_ARMOR, 2 );
.@card4 = getequipcardid( EQI_ARMOR, 3 );
if ( .@card1 == 255 || .@card1 == 254 ) {
mes "I can't enchant a signed equipment";
close;
}
if ( .@card4 ) {
mes "this armor has already enchanted";
close;
}
.@rand = rand(.totalchance);
while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;
.@o = rand(0,5); // orb of str/int/dex ....
delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 0;
getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;
equip .@id;
close;
OnInit:
setarray .rate, 55,50,45,25,20,5,4,3,2,1; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ...
while ( .@i < 10 ) {
.totalchance = .totalchance + .rate[.@i];
.@i++;
}
end;
}
Question
fallen0519
How to make this Enchanted Expert NPC able to enchant all equip including mid headgears and accessories, or can anyone customize the script to be able to configure the equipment option which one to enable.
Thank much, any pro scripter please help me about this.
Edited by fallen0519Link to comment
Share on other sites
1 answer 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.