AinsLord Posted July 6, 2021 Group: Members Topic Count: 261 Topics Per Day: 0.08 Content Count: 758 Reputation: 20 Joined: 11/21/15 Last Seen: April 6 Share Posted July 6, 2021 (edited) just a quick question if i want the stone to be placed on 3slot /* item_db.txt // replace with your own custom id. 501,Red_Potion,Red Potion,11,50,,70,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc( "F_DiabloEnchant",501,909 ); },{},{} // Example Bonus 909,Jellopy,Jellopy,3,6,,10,,,,,,,,,,,,,{ .@eqp = getequippedon(); if (.@eqp & 16) { bonus bVit,100; } if (.@eqp & 256) { bonus bInt,100; } if (.@eqp & 64) { bonus bAgi,100; } },{},{} */ // usage: // callfunc( "F_DiabloEnchant",<delete item id>,<bonus item id> ); function script F_DiabloEnchant { .@itemid = getarg( 0,0 ); .@enchant = getarg( 1,0 ); if ( .@itemid && .@enchant ) { for ( .@i = EQI_HEAD_TOP; .@i < EQI_ACC_R; .@i++ ) { .@equip_itemid = getequipid( .@i ); .@menu$ = .@menu$ + ( .@equip_itemid == -1 ? "": getitemname( .@equip_itemid ) ) + ":"; } .@i = select( .@menu$ ); .@equip_itemid = getequipid( .@i ); .@equip_refine = getequiprefinerycnt( .@i ); for ( .@c = 0; .@c < 4; .@c++ ) .@card[.@c] = getequipcardid( .@i,.@c ); if ( .@card[0] && .@card[0] < 4001 ) { mes "Signed Item can't be enchanted."; } // else if ( .@card[3] ) { // mes "This item has been enchanted. Cant enchant twice."; // } else { delequip .@i; delitem .@itemid,1; .@card[3] = .@enchant; getitem2 .@equip_itemid,1,1,.@equip_refine,0,.@card[0],.@card[1],.@card[2],.@card[3]; // equip2 .@equip_itemid,.@equip_refine,0,.@card[0],.@card[1],.@card[2],.@card[3]; specialeffect2 154; message strcharinfo(0),"Enchant Success!"; } close; } return; } is this the part i need to edit? .@card[3] = .@enchant; this one is like once you put stone it cannot be enchant again correct? // else if ( .@card[3] ) { // mes "This item has been enchanted. Cant enchant twice."; // } this part may i know whats the use? // equip2 .@equip_itemid,.@equip_refine,0,.@card[0],.@card[1],.@card[2],.@card[3]; thanks in advance PS: Got error on custom script Edited July 6, 2021 by AinsLord Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 29, 2021 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 01:10 PM Author Share Posted August 29, 2021 On 7/6/2021 at 3:46 PM, AinsLord said: i want the stone to be placed on 3slot .@card[2] = .@enchant; index 2 is 3rd card slot. Quote Link to comment Share on other sites More sharing options...
system9 Posted January 9, 2023 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 9 Reputation: 0 Joined: 08/29/14 Last Seen: February 6 Share Posted January 9, 2023 (edited) how to enchant shadow equipment ? i change > for (.@i = EQI_ACC_L; .@i < EQI_MAX; .@i++) not working , item is random enchant. Edited January 10, 2023 by system9 Quote Link to comment Share on other sites More sharing options...
playniks Posted May 22, 2023 Group: Members Topic Count: 14 Topics Per Day: 0.02 Content Count: 52 Reputation: 2 Joined: 02/23/23 Last Seen: 23 hours ago Share Posted May 22, 2023 Bump! Hello @Emistry. May I know how to make your creation possible for only Headgear costumes (upper, mid and low) only? Thank you! Been finding any enchantment script but yours is the only one closer to my target and goal. Hope you could help me. Bless you! Quote Link to comment Share on other sites More sharing options...
Westin Posted February 9, 2024 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 11 Reputation: 2 Joined: 10/25/12 Last Seen: April 23, 2024 Share Posted February 9, 2024 (edited) It's possible rent a enchat on item? Like this: function script F_UsableEnchantItem { .@itemid = 30378; .@enchant = 30379; .@card_slot = getarg(2, 3); .@rental_duration = 3600; if (.@itemid && .@enchant) { setarray .@equip_positions[0], EQI_ACC_L, EQI_ACC_R, EQI_SHOES, EQI_GARMENT, EQI_HEAD_LOW, EQI_HEAD_MID, EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R; .@menu_index = 0; for (.@i = 0; .@i < getarraysize(.@equip_positions); .@i++) { .@pos = .@equip_positions[.@i]; .@equip_itemid = getequipid(.@pos); if (.@equip_itemid != -1) { .@menu$ = .@menu$ + getitemname(.@equip_itemid) + " [" + getitemslots(.@equip_itemid) + "]" + ":"; .@menu_map[.@menu_index] = .@pos; .@menu_index++; } } if (.@menu$ == "") { mes "You don't have any items equipped that can be enchanted."; close; } mes "Which item would you like to enchant?"; .@selected = select(.@menu$); if (.@selected == 0) { mes "Alright, thanks anyways!"; close; } .@eqi = .@menu_map[.@selected - 1]; .@equip_itemid = getequipid(.@eqi); if (.@equip_itemid == -1) { mes "No item equipped in the selected slot."; close; } .@equip_refine = getequiprefinerycnt(.@eqi); for (.@c = 0; .@c < 4; .@c++) .@card[.@c] = getequipcardid(.@eqi, .@c); if (.@card[0] && .@card[0] == 255) { message strcharinfo(0), "Fail. " + getitemname(.@equip_itemid) + " is a signed item."; } else if (.@card[.@card_slot]) { message strcharinfo(0), "Fail. " + getitemname(.@equip_itemid) + " already has an enchant."; } else { next; mes "Enchanting item.."; next; progressbar "ffff00",2; delitem .@itemid, 1; delequip .@eqi; .@equip_refine = getequiprefinerycnt(.@eqi); for (.@c = 0; .@c < 4; .@c++) .@card[.@c] = getequipcardid(.@eqi, .@c); .@card[.@card_slot] = .@enchant; // Aplica a runa ao slot desejado rentitem2 .@equip_itemid, .@rental_duration, 1, .@equip_refine, 0, .@card[0], .@card[1], .@card[2], .@card[3]; specialeffect2 EF_REFINEOK; message strcharinfo(0), getitemname(.@equip_itemid) + " foi encantado com " + getitemname(.@enchant) + " por um período limitado!"; next; mes "Success!"; } end; } return; } I tried to do it like this but it rents the item and not the rune. Edited February 9, 2024 by Westin Quote Link to comment Share on other sites More sharing options...
Emistry Posted February 19, 2024 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 01:10 PM Author Share Posted February 19, 2024 On 1/10/2023 at 7:42 AM, system9 said: EQI_MAX ensure your server have exported this constant to be allowed to use by script engine On 5/22/2023 at 8:42 PM, playniks said: how to make your creation possible for only Headgear costumes (upper, mid and low) only? may try configure the card/enchant equip location On 2/10/2024 at 1:09 AM, Westin said: It's possible rent a enchat on item? rental item are only meant for item itself, not compounding items like enchant/card Quote Link to comment Share on other sites More sharing options...
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.