Heartfelt Posted August 29, 2023 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 40 Reputation: 0 Joined: 01/09/16 Last Seen: April 10 Share Posted August 29, 2023 prontera,156,178,5 script ldfhsdfkljs 100,{ mes "do you want to enchant your equipment ?"; next; .@s = select( .menu$ ) -1; if ( !getequipisequiped( .const_equip[.@s] ) || .const_equip[.@s] == EQI_HAND_L && getiteminfo( getequipid( EQI_HAND_L ),2 ) != 5 ) { mes "you did not equip an "+ .menu_name$[.@s] +" at the moment"; close; } .@id = getequipid( .const_equip[.@s] ); .@ref = getequiprefinerycnt( .const_equip[.@s] ); .@card1 = getequipcardid( .const_equip[.@s], 0 ); .@card2 = getequipcardid( .const_equip[.@s], 1 ); .@card3 = getequipcardid( .const_equip[.@s], 2 ); .@card4 = getequipcardid( .const_equip[.@s], 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,40,35; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ... setarray .const_equip, EQI_ARMOR, EQI_HAND_L, EQI_GARMENT, EQI_SHOES; setarray .menu_name$, "Armor", "Shield", "Garment", "Shoes"; .menu$ = implode( .menu_name$,":" ); while ( .@i < 10 ) { .totalchance = .totalchance + .rate[.@i]; .@i++; } end; } as the title says, i want to make this script only for enchanting upper costume headgear also i want to make it only maximum to +3 Attribute thanks Quote Link to comment Share on other sites More sharing options...
0 Winterfox Posted August 31, 2023 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 245 Reputation: 93 Joined: 06/30/18 Last Seen: November 27, 2024 Share Posted August 31, 2023 (edited) I didn't test it, but this should do what you want. prontera,156,178,5 script Enchanter 100,{ disable_items; mes "What do you want to enchant?"; next; .@s = select( .menu$ ) -1; .@part = .const_equip[.@s]; .@part_name = .menu_name$[.@s]; if (!getequipisequiped(.@part)) { mes "You did not equip an " + .@part_name + " at the moment"; close; } .@id = getequipid(.@part); .@ref = getequiprefinerycnt(.@part); setarray(.@card[0], getequipcardid(.@part, 0), getequipcardid(.@part, 1), getequipcardid(.@part, 2), getequipcardid(.@part, 3)); if (.@card[0] == 255 || .@card[0] == 254) { mes "I can't enchant a signed equipment"; close; } if (.@card[3]) { mes "This " + .@part_name + " is already enchanted"; close; } .@rand = rand(1, .totalchance); while ((.@rand -= .rate[.@orb_level]) > 0) .@orb_level++; .@orb = 4700 + rand(0, 5) * 10 + .@orb_level; // orb of str/int/dex .... if (callfunc("F_IsEquipIDHack", .@part, .@id) || callfunc("F_IsEquipRefineHack", .@part, .@ref) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3])) { emotion ET_FRET; 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; } delitem2(.@id, 1, 1, .@ref, 0, .@card[0], .@card[1], .@card[2], 0); getitem2(.@id, 1, 1, .@ref, 0, .@card[0], .@card[1], .@card[2], .@orb); equip(.@id); end; OnInit: setarray(.rate, 55, 50, 45); //, 40, 35); // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ... setarray(.const_equip, EQP_COSTUME_HEAD_TOP); setarray(.menu_name$, "Upper Costume Headgear"); .menu$ = implode(.menu_name$, ":"); for(.@i = 0; .@i < getarraysize(.rate); .@i++) .totalchance += .rate[.@i]; } Edited August 31, 2023 by Winterfox Quote Link to comment Share on other sites More sharing options...
0 kristian Posted October 21, 2024 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 1 Reputation: 0 Joined: 09/29/19 Last Seen: December 3, 2024 Share Posted October 21, 2024 On 8/31/2023 at 8:02 PM, Winterfox said: I didn't test it, but this should do what you want. prontera,156,178,5 script Enchanter 100,{ disable_items; mes "What do you want to enchant?"; next; .@s = select( .menu$ ) -1; .@part = .const_equip[.@s]; .@part_name = .menu_name$[.@s]; if (!getequipisequiped(.@part)) { mes "You did not equip an " + .@part_name + " at the moment"; close; } .@id = getequipid(.@part); .@ref = getequiprefinerycnt(.@part); setarray(.@card[0], getequipcardid(.@part, 0), getequipcardid(.@part, 1), getequipcardid(.@part, 2), getequipcardid(.@part, 3)); if (.@card[0] == 255 || .@card[0] == 254) { mes "I can't enchant a signed equipment"; close; } if (.@card[3]) { mes "This " + .@part_name + " is already enchanted"; close; } .@rand = rand(1, .totalchance); while ((.@rand -= .rate[.@orb_level]) > 0) .@orb_level++; .@orb = 4700 + rand(0, 5) * 10 + .@orb_level; // orb of str/int/dex .... if (callfunc("F_IsEquipIDHack", .@part, .@id) || callfunc("F_IsEquipRefineHack", .@part, .@ref) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3])) { emotion ET_FRET; 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; } delitem2(.@id, 1, 1, .@ref, 0, .@card[0], .@card[1], .@card[2], 0); getitem2(.@id, 1, 1, .@ref, 0, .@card[0], .@card[1], .@card[2], .@orb); equip(.@id); end; OnInit: setarray(.rate, 55, 50, 45); //, 40, 35); // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ... setarray(.const_equip, EQP_COSTUME_HEAD_TOP); setarray(.menu_name$, "Upper Costume Headgear"); .menu$ = implode(.menu_name$, ":"); for(.@i = 0; .@i < getarraysize(.rate); .@i++) .totalchance += .rate[.@i]; } how to make this enable to trying to enchant agin? i mean ist not only 1 time enchant Quote Link to comment Share on other sites More sharing options...
Question
Heartfelt
prontera,156,178,5 script ldfhsdfkljs 100,{ mes "do you want to enchant your equipment ?"; next; .@s = select( .menu$ ) -1; if ( !getequipisequiped( .const_equip[.@s] ) || .const_equip[.@s] == EQI_HAND_L && getiteminfo( getequipid( EQI_HAND_L ),2 ) != 5 ) { mes "you did not equip an "+ .menu_name$[.@s] +" at the moment"; close; } .@id = getequipid( .const_equip[.@s] ); .@ref = getequiprefinerycnt( .const_equip[.@s] ); .@card1 = getequipcardid( .const_equip[.@s], 0 ); .@card2 = getequipcardid( .const_equip[.@s], 1 ); .@card3 = getequipcardid( .const_equip[.@s], 2 ); .@card4 = getequipcardid( .const_equip[.@s], 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,40,35; // rate of getting +1 is 55%, +2 is 50% .... +10 is 10% ... setarray .const_equip, EQI_ARMOR, EQI_HAND_L, EQI_GARMENT, EQI_SHOES; setarray .menu_name$, "Armor", "Shield", "Garment", "Shoes"; .menu$ = implode( .menu_name$,":" ); while ( .@i < 10 ) { .totalchance = .totalchance + .rate[.@i]; .@i++; } end; }
as the title says, i want to make this script only for enchanting upper costume headgear
also i want to make it only maximum to +3 Attribute
thanks
Link to comment
Share on other sites
2 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.