DrGruning
Members-
Posts
7 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by DrGruning
-
Great service, pretty diligent, i would reccomend this service to anyone! Was eager to help me through the whole process, skills is top notch!
-
I'll try and see if it's limited to my import folders being way too big or something related to memory hungry scripts, but i'm on a dedicated server which makes it weird, since resources shouldn't be problem
-
mm this is pretty weird to be honest.. and i've tried replacing item_db with a fresh one...
-
Everything works except from @reloaditemdb, no error shown in the console, it just freeze and map server hung with no crash error...
-
Enchant Script not working with random option, getitem3 issue?
DrGruning replied to DrGruning's question in Scripting Support
Thanks a lot for your input @sader1992. Aftter trying your fixes at first it didn't work but somehow after replacing [email protected]_loc to [email protected]_loc it worked! -
Enchant Script not working with random option, getitem3 issue?
DrGruning posted a question in Scripting Support
prt_in,86,73,5 script Bermund 654,{ function get_rune_id; function get_rune_equip; function get_rune_zeny; function get_rune_success_rate; disable_items; mes "You want to fuse the MvP Core with your equipments?"; mes "NOTE:"; mes "Please by all means just have equipped the item you will enchant and once at time,that is to avoid any item lost or bug, you are already warned"; mes "Enchanting an equipment will erase Item Options"; [email protected] = select( "Shoes","Armor","Shield","Accesories","Headgear" ); next; mes "I can transmute it depending on your budget and wiht it chances increases"; [email protected] = select( "Normal Services","Premiun Services","VIP Services" ); [email protected]_slot = 4; [email protected]_loc = get_rune_equip( [email protected] ); [email protected]_id = get_rune_id( [email protected],[email protected] ); [email protected]_cost = get_rune_zeny( [email protected] ); [email protected]_rate = get_rune_success_rate( [email protected] ); [email protected]_id = getequipid( [email protected]_loc ); next; mes "Equipment: "+getitemname( [email protected]_id ); mes "Rune: "+getitemname( [email protected]_id ); mes "Zeny: "+F_InsertComma( [email protected]_cost ); mes "Success Rate: "[email protected]_rate+"%"; mes " "; if ( Zeny >= [email protected]_cost ) if ( select( "Continue","Cancel" ) == 1 ) { if ( getitemslots( [email protected]_id ) >= [email protected]_slot ) { mes "This item slot cant be enchanted."; } else { Zeny -= [email protected]_cost; if ( rand(100) < [email protected]_rate ) { for ( [email protected] = 0; [email protected] < 4; [email protected]++ ) [email protected][[email protected]] = getequipcardid( [email protected]_loc,[email protected] ); setarray [email protected][0],0; setarray [email protected][1],0; setarray [email protected][2],0; setarray [email protected][3],0; setarray [email protected][4],0; setarray [email protected][0],0; setarray [email protected][1],0; setarray [email protected][2],0; setarray [email protected][3],0; setarray [email protected][4],0; setarray [email protected][0],0; setarray [email protected][1],0; setarray [email protected][2],0; setarray [email protected][3],0; setarray [email protected][4],0; for ([email protected] = 0; [email protected] < 5; [email protected]++) { setarray [email protected][[email protected]],getequiprandomoption([email protected]_loc,[email protected],ROA_ID); setarray [email protected][[email protected]],getequiprandomoption([email protected]_loc,[email protected],ROA_VALUE); setarray [email protected][[email protected]],getequiprandomoption([email protected]_loc,[email protected],ROA_PARAM); } [email protected] = getequiprefinerycnt( [email protected]_loc ); [email protected][[email protected]_slot-1] = [email protected]_id; mes "Enchant Success"; specialeffect2 EF_REFINEOK; delitem [email protected]_id,1; delitem3 [email protected]_id,1,1,[email protected],0,[email protected][0],[email protected][1],[email protected][2],[email protected][3],[email protected],[email protected],[email protected]; getitem3 [email protected]_id,1,1,[email protected],0,[email protected][0],[email protected][1],[email protected][2],[email protected][3],[email protected],[email protected],[email protected]; } else { mes "Enchant Failed."; specialeffect2 EF_REFINEFAIL; delitem [email protected]_id,1; } } } close; function get_rune_id { [email protected] = getarg(0,0); [email protected] = getarg(1,0); switch( [email protected] ) { case 1: // Blue switch( [email protected] ) { case 1: setarray [email protected]_list,15495,15539,15482; break; case 2: setarray [email protected]_list,15495,15539,15482; break; case 3: setarray [email protected]_list,15495,15539,15482; break; default: break; } break; case 2: // Green switch( [email protected] ) { case 1: setarray [email protected]_list,15485,15501,15493,15500,15542,15501; break; case 2: setarray [email protected]_list,15485,15501,15493,15500,15542,15501; break; case 3: setarray [email protected]_list,15485,15501,15493,15500,15542,15501; break; default: break; } break; case 3: // Yellow switch( [email protected] ) { case 1: setarray [email protected]_list,15496,15502,15497; break; case 2: setarray [email protected]_list,15496,15502,15497; break; case 3: setarray [email protected]_list,15496,15502,15497; break; default: break; } break; case 4: // Red switch( [email protected] ) { case 1: setarray [email protected]_list,15494,15487,15489; break; case 2: setarray [email protected]_list,15494,15487,15489; break; case 3: setarray [email protected]_list,15494,15487,15489; break; default: break; } break; case 5: // Red switch( [email protected] ) { case 1: setarray [email protected]_list,15541,15544; break; case 2: setarray [email protected]_list,15541,15544; break; case 3: setarray [email protected]_list,15541,15544; break; default: break; } break; default: break; } [email protected]_list_size = getarraysize( [email protected]_list ); if ( [email protected]_list_size ) { while ( [email protected] < [email protected]_list_size ) { [email protected]$ = [email protected]$ + ( ( countitem( [email protected]_list[[email protected]] ) )? "^0055FF":"^777777" ) + getitemname( [email protected]_list[[email protected]] ) + "^000000" + ":"; [email protected]++; } [email protected] = select( [email protected]$ ) - 1; if ( !countitem( [email protected]_list[[email protected]] ) ) { mes "You don't have the required rune."; close; } } return [email protected]_list[[email protected]]; } function get_rune_equip { [email protected] = getarg(0,0); switch ( [email protected] ) { case 1: // Blue setarray [email protected]_loc_list,EQI_SHOES; setarray [email protected]_loc_name$,"SHOES"; break; case 2: // Green setarray [email protected]_loc_list,EQI_ARMOR; setarray [email protected]_loc_name$,"ARMOR"; break; case 3: // Yellow setarray [email protected]_loc_list,EQI_HAND_L; setarray [email protected]_loc_name$,"SHIELD"; break; case 4: // Red setarray [email protected]_loc_list,EQI_ACC_L,EQI_ACC_R; setarray [email protected]_loc_name$,"ACCESSORY LEFT","ACCESSORY RIGHT"; break; case 5: // Red setarray [email protected]_loc_list,EQI_HEAD_LOW ; setarray [email protected]_loc_name$,"LOWER HEADGEAR"; break; default: break; } [email protected]_loc_list_size = getarraysize( [email protected]_loc_list ); if ( [email protected]_loc_list_size ) { while ( [email protected] < [email protected]_loc_list_size ) { [email protected]_id = getequipid( [email protected]_loc_list[[email protected]] ); [email protected]$ = [email protected]$ + ( ( [email protected]_id <= 0 )?"^777777":"^0055FF" ) [email protected]_loc_name$[[email protected]] + " (" + getitemname( [email protected]_id ) + ")^000000" + ":"; [email protected]++; } [email protected] = select( [email protected]$ ) - 1; if ( getequipid( [email protected]_loc_list[[email protected]] ) <= 0 ) { mes "You didnt equipped any equipment on this slot."; close; } } return [email protected]_loc_list[[email protected]]; } function get_rune_zeny { [email protected] = getarg(0,0); switch( [email protected] ) { case 1: return 1000000; // Rare - 1,000,000 Zeny case 2: return 10000000; // Epic - 10,000,000 Zeny case 3: return 25000000; // Legend - 80,000,000 Zeny default: return 0; } } function get_rune_success_rate { [email protected] = getarg(0,0); switch( [email protected] ) { case 1: return 10; // Rare - 90% success case 2: return 15; // Epic - 50% success case 3: return 20; // Legend - 20% success default: return 0; } } } I have this custom enchant system right, but when i tried to adapt it to random option support it always delete the random options, and shows the following error at console: -
Thanks for your input, but i don't think that's how its supposed to work, random option should stay permanently if so, enlight me otherwise.
-
//===== rAthena Script ======================================= //= Random Option NPC dealer //===== By: ================================================== //= Keitenai //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena Project //===== Description: ========================================= //= Deals with a player to apply random item option //= for the price of zeny/cashpoint //============================================================ vip_lounge,70,147,3 script Magnus 500,{ goto NPC; end; OnInit: //============================== // CURRENCY SETTING // 1 = Zeny // 0 = Cashpoints //============================== set .Currency,1; // Currency to buy random option //============================== // RANDOM OPTION SETTING //============================== set .OverWrite,1; // Allows overwriting the already existing option enchantment ( 0 to disable ) set .MaxOpt,64; // Maximum item option a player can enchant ( reference: https://github.com/rathena/rathena/blob/master/db/const.txt#L1645-L1836 ) set .MinOpt,1; // Minimum item option a player can enchant set .MinValue,1; // Minimum option effect value set .MaxValue,10; // Maximum option effect value set .MaxIndex,3; // Maximum option slots ( default is 0 to 4 ) // Random option that will not be applied setarray .ignore[0], end; NPC: disable_items; mes "[ Magnus ]"; mes "Good day sir"; mes "My name is magnus and i can unlock your Weapon inner abilities"; mes "abilities are chosen at ^FF0000random^000000"; next; mes "[ Magnus ]"; mes "I can make your weapon"; mes "become more powerful"; if(.Currency){ mes "For a prize of ^0000FF1x Weapon V Core^000000,"; } else { mes "For a prize of ^0000FF"+.Price+" Cashpoints^000000,"; } mes "I will apply a ^FF0000RANDOM^000000"; mes "option enchantment on your"; mes "equipment. (^_^)"; next; if(select("^0000FFEnchant my equip!^000000:Nevermind i changed my mind...")==2) goto OnCancel; mes "[ Magnus ]"; mes "Wonderful!"; mes "i'll start right away"; mes "Don't move a muscle while"; mes "i'm enchanting your equipment!"; close2; setarray [email protected][1], EQI_HAND_R; for(set [email protected],1; [email protected]<getarraysize([email protected]); set [email protected],[email protected]+1){ if(getequipisequiped([email protected][[email protected]])){ set [email protected]$,[email protected]$+F_getpositionname([email protected][[email protected]])+" ~ [ " + getequipname([email protected][[email protected]]) + " ]"; set [email protected],1; } set [email protected]$,[email protected]$+":"; } set [email protected],[email protected][select([email protected]$)]; set [email protected],rand(.MinValue,.MaxValue); OnLoop: set [email protected],rand(.MinOpt,.MaxOpt); for(set [email protected],1; [email protected]<getarraysize(.ignore); set [email protected],[email protected]+1){ if([email protected]==.ignore[[email protected]]){ goto IgnoreCheck; end; } } goto OnApplyOpts; end; IgnoreCheck: set [email protected],rand(.MinOpt,.MaxOpt); for(set [email protected],1; [email protected]<getarraysize(.ignore); set [email protected],[email protected]+1) if([email protected]==.ignore[[email protected]]){ goto OnLoop; end; } OnApplyOpts: set [email protected],rand(.MaxIndex); if(!.OverWrite){ if(getequiprandomoption([email protected],4,ROA_ID,getcharid(0))) set [email protected],4; if(getequiprandomoption([email protected],3,ROA_ID,getcharid(0))) set [email protected],3; if(getequiprandomoption([email protected],2,ROA_ID,getcharid(0))) set [email protected],2; if(getequiprandomoption([email protected],1,ROA_ID,getcharid(0))) set [email protected],1; if(getequiprandomoption([email protected],0,ROA_ID,getcharid(0))) set [email protected],0; if([email protected] == 0 && [email protected]) if([email protected]==.MaxIndex) goto OnMax; else set [email protected],1; if([email protected] == 1 && [email protected]) if([email protected]==.MaxIndex) goto OnMax; else set [email protected],2; if([email protected] == 2 && [email protected]) if([email protected]==.MaxIndex) goto OnMax; else set [email protected],3; if([email protected] == 3 && [email protected]) if([email protected]==.MaxIndex) goto OnMax; else set [email protected],4; if([email protected] == 4 && [email protected]) if([email protected]==.MaxIndex) goto OnMax; } if([email protected] == 4 && (!getequiprandomoption([email protected],3,ROA_ID,getcharid(0)))) set [email protected],3; if([email protected] == 3 && (!getequiprandomoption([email protected],2,ROA_ID,getcharid(0)))) set [email protected],2; if([email protected] == 2 && (!getequiprandomoption([email protected],1,ROA_ID,getcharid(0)))) set [email protected],1; if([email protected] == 1 && (!getequiprandomoption([email protected],0,ROA_ID,getcharid(0)))) set [email protected],0; if(.Currency){ if( countitem(20986) < 1 ) goto PriceFail; else delitem 20986,1; } else { if(#CASHPOINTS < .Price) goto PriceFail; else set #CASHPOINTS,#CASHPOINTS-.Price; } // Success!! setrandomoption([email protected],[email protected],[email protected],[email protected],[email protected],getcharid(0)); end; OnMax: mes "[ Magnus ]"; mes "Wow! your equip already"; mes "Maxed out its option"; mes "enchant slots!"; mes "Sorry but I can't add"; mes "any more enchantment with"; mes "your equipment."; close; OnFailure: specialeffect2 EF_PHARMACY_FAIL; mes "[ Magnus ]"," "; mes "I'm really sorry..."," "; mes "^FF0000The process have failed..."; mes "Your item has been destroyed.^000000"; delequip [email protected]; close; PriceFail: mes "[ Magnus ]"; mes "What's this?"; mes "Are you kidding me?"; mes "Sorry but I don't work"; mes "for free!"; mes "You can come back if you"; mes "Have enough to pay for"; mes "my service."; close; OnCancel: mes "[ Magnus ]"; mes "Suit yourself."; mes "Let me know if you"; mes "ever changed you mind"; close; } Although random option is applied and the bonus works, when i relog, the last random option applied dissapear, i tried simpliers script and it worked, this somehow not