Lil Troll Posted August 11, 2013 Posted August 11, 2013 (edited) [spoiler=Old topic name = Utility: Simple Enchant Crafting Tool]- script Armor Enchanting Tool -1,{OnInit:npctalk "Powerful Enchanting Tool is Opened";//OnInit: is needed for the script to work!}function script EnchMenu {getitem 17514,1;switch(select("[Enchant]:[Nothing]")) {Case 1:callfunc "ArmorEnchant";next;Case 2:dispbottom "Nothing";end;}}function script ArmorEnchant {setarray .@blacklist,2307,2308,2309,2310; // Input items you wanted to bansetarray .rate, 40,30,20,10; // rate of getting +1 is 40%, +2 is 30%, +3 is 20%, +4 is 10%.item_id = 7227; // item ID requirement use to enchantsetarray .item_req, 3,5,7; // require 3 items to make 1st enchant, 5 items to make 2nd enchant ...while ( .rate[.@i] ) {.totalchance = .totalchance + .rate[.@i];.@i++;}mes "[^0000FFArmor Enchant^000000]";mes "Do you want to Enchat your ^0000FFArmor^000000?";next;if ( select ( "Yes", "No" ) == 2 ) close;mes "[^0000FFArmor Enchant^000000]";if ( !getequipisequiped( EQI_ARMOR ) ) {mes "You dont have any ^0000FFArmor^000000 that is being equipped.";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 );set .@b,getarraysize(.@blacklist);for ( .@c = 0; .@c < .@b; .@c++ ) {if (isequipped(.@blacklist[.@c])) {mes "Its forbidden to enchant "+getitemname(.@blacklist[.@c])+".";close;}}if ( .@card1 == 255 || .@card1 == 254 ) {mes "I can't enchant a signed equipment.";close;}if ( !.@card4 ).@enchant = 0;else if ( !.@card3 ).@enchant = 1;else if ( !.@card2 ).@enchant = 2;else {mes "Sorry, this ^0000FFArmor^000000 has already been enchanted 3 times.";close;}if(countitem(.item_id)< .item_req[.@enchant]) {mes "Sorry, you need "+ .item_req[ .@enchant ] +" "+ getitemname( .item_id ) +" to enchant this armor.";close;}.@rand = rand(.totalchance);while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++;.@o = rand(0,5); // orb of str/int/dex ...delitem .item_id, .item_req[ .@enchant ];delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;if ( !.@card4 )getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r;else if ( !.@card3 )getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, 4700 + .@o * 10 + .@r, .@card4;elsegetitem2 .@id, 1,1, .@ref, 0, .@card1, 4700 + .@o * 10 + .@r, .@card3, .@card4;equip .@id;mes "Armor Enchancement successful !";close;return;} ///////////////////////////////////////////////////////////////////////// //---------------------------------------------------------------------// // COSTUMIZE ME - ENCHANTER // // AUTHOR: LIL TROLL//COLDFIRE // //---------------------------------------------------------------------// // RATHENA SCRIPT // //---------------------------------------------------------------------// // Version alpha v.1 // //---------------------------------------------------------------------// // REFERENCE: // // http://rathena.org/board/topic/61734-custom-enchantment-system // // Credits to: Kenedos(Copied some Features and Scripts) // // - Karazu for requesting the script. // // CORE SCRIPT: // // - Done // // - MODE: // // - Normal Mode - Done // // - VIP - Work in Progress // // - Special - Work in Progress // // FEATURES: // // - Can add blacklist of items. // // - Enable/Disable/Change npc zeny cost of enchanting. // // - Pick between 1 or 3 slot of enchanting. // // - Enable/Disable enchant overiding. // // - Customizable ItemID/Amount of requirements. // // - Customizable per slot success rate. // // - Progressbar(DONE) VS Cutin(WIP) effect when enchanting. // // - Selectable enchanting modes. // // - Equipment restriction toggle. // // - Customizable Stones/Orbs to be inserted in armor. // //---------------------------------------------------------------------// ///////////////////////////////////////////////////////////////////////// [spoiler=To do:]- Adding one orb/stone type per armor enchant toggle. (Prevent imbalance usage of enchant.)- Adding Special/Donator/Vip Mode- Adding more stuffs per suggestions, I really would like to make it very customizable. Its because it was taking too much time making this script(not yet have enough time to finish the script, lots of work to do and other stuff.) I release alpha version of the script, so at the meantime atleast anyone can help me find error and bugs for faster development while i can only do scripting in little time, or everyone can help me modify and update the script(that would be great!). Please do suggest for room of improvement or new features. Thanks! enchantment.txt Edited September 29, 2013 by Lil Troll 1 Quote
sotf Posted August 21, 2013 Posted August 21, 2013 Cool script! Altho I have donate armor rentals on my server, which would make them permanent once you use this(am I right?) Can you make another version of this but instead of armor, it will enchant accessories(or headgears maybe?) Quote
Mad Walker Posted August 21, 2013 Posted August 21, 2013 orochimakoto, I have a modified version wherein you can enchant on any part of the alt q(armor, headgear, access... etc). Lil Troll: this line if(countitem(.item_id)<= .item_req[.@enchant]) { should be if(countitem(.item_id)< .item_req[.@enchant]) { like this if I'm not mistaken... Quote
sotf Posted August 21, 2013 Posted August 21, 2013 ^Is it possible to enchant accessories only, or headgears and accessories only? Like I said, this script will make rental armors into permanent ones, which is not good Quote
Lil Troll Posted August 21, 2013 Author Posted August 21, 2013 (edited) For the mean time just add your blacklisted items here.. Including rental items. setarray .blacklist,2307,2308,2309,2310; // Input items you wanted to ban. - script Armor Enchanting Tool -1,{ OnInit: npctalk "Powerful Enchanting Tool is Opened"; //OnInit: is needed for the script to work! } function script EnchMenu { getitem 17514,1; switch(select("[Enchant]:[Nothing]")) { Case 1: callfunc "ArmorEnchant"; next; Case 2: dispbottom "Nothing"; end; } } function script ArmorEnchant { setarray .@blacklist,2307,2308,2309,2310; // Input items you wanted to ban setarray .rate, 40,30,20,10; // rate of getting +1 is 40%, +2 is 30%, +3 is 20%, +4 is 10% .item_id = 7227; // item ID requirement use to enchant setarray .item_req, 3,5,7; // require 3 items to make 1st enchant, 5 items to make 2nd enchant ... while ( .rate[.@i] ) { .totalchance = .totalchance + .rate[.@i]; .@i++; } mes "[^0000FFArmor Enchant^000000]"; mes "Do you want to Enchat your ^0000FFArmor^000000?"; next; if ( select ( "Yes", "No" ) == 2 ) close; mes "[^0000FFArmor Enchant^000000]"; if ( !getequipisequiped( EQI_ARMOR ) ) { mes "You dont have any ^0000FFArmor^000000 that is being equipped."; 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 ); set .@b,getarraysize(.@blacklist); for ( .@c = 0; .@c < .@b; .@c++ ) { //set .@e,.@blacklist[.@c]; if (isequipped(.@blacklist[.@c])) { mes "Its forbidden to enchant "+getitemname(.@blacklist[.@c])+"."; close; } } if ( .@card1 == 255 || .@card1 == 254 ) { mes "I can't enchant a signed equipment."; close; } if ( !.@card4 ) .@enchant = 0; else if ( !.@card3 ) .@enchant = 1; else if ( !.@card2 ) .@enchant = 2; else { mes "Sorry, this ^0000FFArmor^000000 has already been enchanted 3 times."; close; } if(countitem(.item_id)< .item_req[.@enchant]) { mes "Sorry, you need "+ .item_req[ .@enchant ] +" "+ getitemname( .item_id ) +" to enchant this armor."; close; } .@rand = rand(.totalchance); while ( ( .@rand = .@rand - .rate[.@r] ) >= 0 ) .@r++; .@o = rand(0,5); // orb of str/int/dex ... delitem .item_id, .item_req[ .@enchant ]; delitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, .@card4; if ( !.@card4 ) getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, .@card3, 4700 + .@o * 10 + .@r; else if ( !.@card3 ) getitem2 .@id, 1,1, .@ref, 0, .@card1, .@card2, 4700 + .@o * 10 + .@r, .@card4; else getitem2 .@id, 1,1, .@ref, 0, .@card1, 4700 + .@o * 10 + .@r, .@card3, .@card4; equip .@id; mes "Armor Enchancement successful !"; close; return; } If you wanted to modify it and get the expiretick of the rental item, you can modify your src click this link. If you wanted to modify this and change them to what ever placement you would like just modify this part.EQI_ARMOR : EQI_HEAD_TOP 1 EQI_ARMOR 2 EQI_HAND_L 3 EQI_HAND_R 4 EQI_GARMENT 5 EQI_SHOES 6 EQI_ACC_L 7 EQI_ACC_R 8 EQI_HEAD_MID 9 EQI_HEAD_LOW 10 EQI_COSTUME_HEAD_LOW 11 EQI_COSTUME_HEAD_MID 12 EQI_COSTUME_HEAD_TOP 13 EQI_COSTUME_GARMENT 14 Edited August 21, 2013 by Lil Troll Quote
Mad Walker Posted August 21, 2013 Posted August 21, 2013 setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2"; set .@menu$,""; for(set .@i,1; .@i<=10; set .@i,.@i+1) { if(getequipisequiped(.@i)) set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]"; set .@menu$, .@menu$ + ":"; } Quote
Lil Troll Posted August 21, 2013 Author Posted August 21, 2013 Thanks for correcting me @Mad Walker. I edited the top post script already. @orochi just follow @Mad walker, guide. Quote
Lil Troll Posted September 13, 2013 Author Posted September 13, 2013 Bump, updated the topic, anyone can suggest, feel free to drop replies or anything. Quote
panducakep Posted September 26, 2013 Posted September 26, 2013 Thanks for the script... +1 Sorry I dont give some inputs for you Quote
Lil Troll Posted September 26, 2013 Author Posted September 26, 2013 Thanks for the script... +1 Sorry I dont give some inputs for you Thanks probably this weekend ima try finish the script got a bomb of free time then. Feel free to suggest. Quote
panducakep Posted September 27, 2013 Posted September 27, 2013 Thanks for the script... +1 Sorry I dont give some inputs for you Thanks probably this weekend ima try finish the script got a bomb of free time then. Feel free to suggest. Thanks Lil Trol... I'm waiting for your next release script and hopefully I can give some fresh injection ideas Quote
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.