sader1992 Posted September 9, 2021 Share Posted September 9, 2021 View File All In One - Random Options Script The goal in this script is to allow you to create any random option enchantment system by just creating a new copy of this script , change the script name and setting You should be able to create any random option system exist currently in the game DO NOT PM ME FOR ERRORS Use the forum post to report for any bugs and errors the script allow you to create a group of items > you can create as many groups as you want each group has it's own options allow reroll or not put price for first time and price for the reroll after the first time the price can be zeny, cashpoints, custom points, items put random options for all slots or specific slot of the random options slot put exclusive random options groups so they cannot coexist in the same item The script config and example AT LINE 290 in the script file > OnInit: .exv = true;//DO NOT REMOVE THIS. .KeepItemData = true;//if this is 'false , the player will loss the refine+cards from the item when he use this npc. .CustomPointsVariable$ = "#COSTUMPOINTS";//The variable name of the costum points. .CustomPointsName$ = "Server RO Points";//The name of the costum points, this what the player will see. .HardBalance = true;//if this is true , it would be much harder to get high value in the random option. //AddGroup(<Group ID>,<ItemID>,<ItemID>,<ItemID>,<ItemID>,<ItemID>); /* AddGroup Doc <Group ID> = a number between 1 and MAX_INT64 DO NOT REUSE THE GROUP ID IN THE SAME FILE CONFIG! DO NOT REUSE THE SAME ITEM ID IN DIFFERENT GROUP! will create a group id you can add as many as you want items inside a group. */ //AddGroupOption(<Group ID>,<Allow ReRoll?true:false>,<Allow reuse already gotten option?true:false>,<Zeny Cost>,<CashPoint Cost>,<Custom Points Cost>,<Item1 ID Cost>,<Item1 Amount Cost>,<Item2 ID Cost>,<Item2 Amount Cost>,<....ETC>); /* AddGroupOption Doc <Group ID> = A group id that is already created in AddGroup()!. <Allow ReRoll?true:false> = allow reroll an item with random option or not <Allow reuse already gotten option?true:false> = for exammple if you have str in the options and the player gor it , can he get it again in another slot? */ //AddGroupCost(<Group ID>,<Zeny Cost>,<CashPoint Cost>,<Custom Points Cost>,<Item1 ID Cost>,<Item1 Amount Cost>,<Item2 ID Cost>,<Item2 Amount Cost>,<....ETC>); /* AddGroupCost Doc <Group ID> = A group id that is already created in AddGroup()!. <Zeny Cost> = the zeny cost (can be 0) <CashPoint Cost> = the cashpoints cost (can be 0) <Custom Points Cost> = if you are using costum points in the script , check out .CustomPointsVariable$ and .CustomPointsName$ at the start of the script (can be 0) <Item1 ID Cost> = the item cost <Item1 Amount Cost> = the item amount cost You can use as many item,amount cost at the end of the function. */ //AddGroupReRollCost(<Group ID>,<Zeny Cost>,<CashPoint Cost>,<Custom Points Cost>,<Item1 ID Cost>,<Item1 Amount Cost>,<Item2 ID Cost>,<Item2 Amount Cost>,<....ETC>); /* AddGroupReRollCost Doc <Group ID> = A group id that is already created in AddGroup()!. <Zeny Cost> = the zeny cost (can be 0) <CashPoint Cost> = the cashpoints cost (can be 0) <Custom Points Cost> = if you are using costum points in the script , check out .CustomPointsVariable$ and .CustomPointsName$ at the start of the script (can be 0) <Item1 ID Cost> = the item cost <Item1 Amount Cost> = the item amount cost You can use as many item,amount cost at the end of the function. */ //AddGroupChance(<Group ID>,<1st Option Chance>,<2nd Option Chance>,<3rd Option Chance>,<4th Option Chance>,<5th Option Chance>); /* AddGroupChance Doc <Group ID> = A group id that is already created in AddGroup()!. <1st Option Chance> = the Chance to get one of the random options in the slot 1 (can be 0) <2nd Option Chance> = the Chance to get one of the random options in the slot 2 (can be 0) <3rd Option Chance> = the Chance to get one of the random options in the slot 3 (can be 0) <4th Option Chance> = the Chance to get one of the random options in the slot 4 (can be 0) <5th Option Chance> = the Chance to get one of the random options in the slot 5 (can be 0) Keep inmind that if the player didn't get lucky for example at the slot 2 , all the chances after will be ignored you cannot skip a random option slot that would bug the game client. */ //AddOpt(<Group ID>,<Location>,<Random Option ID>,<Minimum Value>,<Maximum Value>); /* AddOpt Doc <Group ID> = A group id that is already created in AddGroup()!. <Location> = you can spisfiy random option to a location from 1 to 5 , but you can use 0 , if you used 0 it will apply to all locations that doesn't have spisfied random options. <Random Option ID> = random option id , you can use the id or the variable , check out the file /rathena/db/re/item_randomopt_db.yml <Minimum Value> = the minimum value <Maximum Value> = the maximum value */ //AddExclusiveOpt(<Random Option ID>,<Random Option ID>,<Random Option ID>,<Random Option ID>,<Random Option ID>); /* AddExclusiveOpt Doc this will help you to prevent a group of random opions typs in the same item in different slots for example RDMOPT_DAMAGE_PROPERTY_NOTHING_TARGET RDMOPT_DAMAGE_PROPERTY_WATER_TARGET RDMOPT_DAMAGE_PROPERTY_GROUND_TARGET RDMOPT_DAMAGE_PROPERTY_FIRE_TARGET RDMOPT_DAMAGE_PROPERTY_WIND_TARGET RDMOPT_DAMAGE_PROPERTY_POISON_TARGET RDMOPT_DAMAGE_PROPERTY_SAINT_TARGET RDMOPT_DAMAGE_PROPERTY_DARKNESS_TARGET RDMOPT_DAMAGE_PROPERTY_TELEKINESIS_TARGET RDMOPT_DAMAGE_PROPERTY_UNDEAD_TARGET if the player got 1 of them in a slot , he wont get another one to another slot */ //Example!!!> //this is just an example , this script allow you to create any random option system you want. //Creating Group id 1 , with Hat items inside. AddGroup(1,2220,2221,2222,2223); //Group id 1 Options AddGroupOption(1,true,false); //Group id 1 Cost AddGroupCost(1,50,0,0,502,1,503,2); //Group id 1 ReRoll Cost AddGroupReRollCost(1,50,0,0,502,5,503,2); //Group id 1 Chances. AddGroupChance(1,100,75,60,40,20);AddGroupChance(1,100,100,100,100,100); //Group id 1 Random Option List. location 0 mean all the slot locations AddOpt(1,0,RDMOPT_VAR_STRAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_INTAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_VITAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_LUKAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_AGIAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_DEXAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_MAXHPPERCENT,1,100); AddOpt(1,0,RDMOPT_VAR_MAXSPPERCENT,1,100); //those enchantment you wont get unless in slot 5 AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_NOTHING_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_WATER_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_GROUND_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_FIRE_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_WIND_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_POISON_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_SAINT_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_DARKNESS_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_TELEKINESIS_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_UNDEAD_TARGET,1,100); //this mean those random options cannot coexist in the same item!. AddExclusiveOpt(RDMOPT_DAMAGE_PROPERTY_NOTHING_TARGET, RDMOPT_DAMAGE_PROPERTY_WATER_TARGET, RDMOPT_DAMAGE_PROPERTY_GROUND_TARGET, RDMOPT_DAMAGE_PROPERTY_FIRE_TARGET, RDMOPT_DAMAGE_PROPERTY_WIND_TARGET, RDMOPT_DAMAGE_PROPERTY_POISON_TARGET, RDMOPT_DAMAGE_PROPERTY_SAINT_TARGET, RDMOPT_DAMAGE_PROPERTY_DARKNESS_TARGET, RDMOPT_DAMAGE_PROPERTY_TELEKINESIS_TARGET, RDMOPT_DAMAGE_PROPERTY_UNDEAD_TARGET); end; https://sader1992.com/ Submitter sader1992 Submitted 09/09/2021 Category Utilities Video Content Author sader1992 4 1 Quote Link to comment Share on other sites More sharing options...
Slammer Posted September 13, 2021 Share Posted September 13, 2021 Thank 's for share. AddGroupChance(1,100,100,100,100,100); i change no effect. Quote Link to comment Share on other sites More sharing options...
sader1992 Posted September 14, 2021 Author Share Posted September 14, 2021 7 hours ago, Slammer said: AddGroupChance(1,100,100,100,100,100); i change no effect. what do you mean by "no effect" ,also post all your config from OnInit to the end; 1 Quote Link to comment Share on other sites More sharing options...
Slammer Posted September 14, 2021 Share Posted September 14, 2021 15 minutes ago, sader1992 said: what do you mean by "no effect" ,also post all your config from OnInit to the end; ow. my mistake. now it's fix. @sader1992 can u make it choise /Slot? Quote Link to comment Share on other sites More sharing options...
Lelouch vi Britannia Posted October 12, 2021 Share Posted October 12, 2021 Hey @sader1992 is it possible to add item category to this? for example: > Headgears Upper Headgears Middle Headgears Lower Headgears > Weapons Daggers Swords Bows Staffs Quote Link to comment Share on other sites More sharing options...
sader1992 Posted October 12, 2021 Author Share Posted October 12, 2021 6 minutes ago, Lelouch vi Britannia said: Hey @sader1992 is it possible to add item category to this? for example: > Headgears Upper Headgears Middle Headgears Lower Headgears > Weapons Daggers Swords Bows Staffs the short answer is no the npc config allow you to sort out the options for the equipment , however the UI is the list of what the player is wearing while talking to the npc , similar to the refine npc , so the player cannot choose an equipment in his inventory , he must equip it, and he will see one option for left hand and one option for right hand , he wont see one option for weapon and one option for shield. Quote Link to comment Share on other sites More sharing options...
AinsLord Posted February 12 Share Posted February 12 (edited) it was working before but now when i tried it again seems after this part its not proceeding at all cant event teleport what seems to be the problem no error in the console here the code //===== rAthena Script ======================================= //= saders All in one Random Option Script //= Free Script!!!! //===== By: ================================================== //= sader1992 //= https://sader1992.com/ //= https://rathena.org/board/profile/30766-sader1992/ //= https://sader1992.com/?page=item&item=54 //= For more , check out here > //= https://sader1992.com/?page=ra_services //= https://sader1992.com/?page=store //= https://rathena.org/board/profile/30766-sader1992/content/?type=downloads_file //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= rAthena Project //https://rathena.org/board/files/file/4309-all-in-one-random-options-script/ //https://github.com/sader1992/sader_scripts //===== Update Log: ========================================= //= Version 1.0 Creating the script. //===== Description: ========================================= //= This is a Highly Custumizable random option script //= you can reuse the script by just creating a new file with different setting!. //= read and understand the settings. //============================================================ prontera,127,170,7 script AllInOne_RandomOption 444,{ disable_items; function rnd; switch(select("Insert Random Options:Allowed Items List")){ case 1: mes "You must equip the item to appear here!"; for(.@i=0;.@i<EQI_MAX;.@i++){ if(getequipisequiped(.@i)) { .@m1$ += (inarray(.item_list,getequipid(.@i)) != -1?"^11AD09":"^F73831") + F_getpositionname(.@i) + "-[" + getequipname(.@i) + "]^000000"; .@exist = true; } .@m1$ += ":"; } if(!.@exist){ mes "You have to equip the item you want to insert the random options into!."; end; } .@eq = select(.@m1$) -1; clear; .@id = getequipid(.@eq); if(inarray(.item_list,.@id) == -1){ mes "Sorry , I cannot deal with this item!"; end; } .@gid = .it[.@id]; if(!.@gid){ mes "Something went wrong!"; end; } if(!getequiprandomoption(.@eq,0,ROA_ID)){ .@zeny = .nz[.@gid]; .@cashpoint = .nk[.@gid]; .@costumpoint = .nc[.@gid]; copyarray(.@item,getd(".ni_" + .@gid),getarraysize(getd(".ni_" + .@gid))); copyarray(.@amount,getd(".na_" + .@gid),getarraysize(getd(".na_" + .@gid))); }else{ if(!.g_reroll[.@gid]){ mes "Sorry , i cannot reroll the random options in this item!"; end; } .@zeny = .rz[.@gid]; .@cashpoint = .rk[.@gid]; .@costumpoint = .rc[.@gid]; copyarray(.@item,getd(".ri_" + .@gid),getarraysize(getd(".ri_" + .@gid))); copyarray(.@amount,getd(".ra_" + .@gid),getarraysize(getd(".ra_" + .@gid))); } mes "Selected Item [" + getequipname(.@eq) + "]"; mes "==== Cost ===="; if(.@zeny) mes "Zeny: " + .@zeny; if(.@cashpoint) mes "CashPoint: " + .@cashpoint; if(.@costumpoint) mes .CustomPointsName$ + ": " + .@costumpoint; for(.@i=0;.@i<getarraysize(.@item);.@i++){ mes "(" + .@amount[.@i] + ") " + getitemname(.@item[.@i]); } if(!.KeepItemData){ mes "^E01E00You will loss all the refine and cards in the item if you continue.^000000"; } mes "Would you like to continue?"; if(select("Yes:No") == 2){ clear; mes "Ok, see you next time!"; end; } clear; if(Zeny < .@zeny){ mes "You don't have " + .@zeny + " Zeny"; .@close = true; } if(#CASHPOINTS < .@cashpoint){ mes "You don't have " + .@cashpoint + " CashPoints"; .@close = true; } if(getd(.CustomPointsVariable$) < .@costumpoint){ mes "You don't have " + .@costumpoint + " " + .CustomPointsName$; .@close = true; } for(.@i=0;.@i<getarraysize(.@item);.@i++){ if(countitem(.@item[.@i]) < .@amount[.@i]){ mes "You don't have (" + .@amount[.@i] + ") " + getitemname(.@item[.@i]); .@close = true; } } if(.@close) end; .@r = getequiprefinerycnt(.@eq); for(.@i=0;.@i<4;.@i++){ if(getequipcardid(.@eq,.@i)){ setd "[email protected]" + .@i,getequipcardid(.@eq,.@i); .@re[getarraysize(.@re)] = true; } } copyarray(.@opt_id,getd(".ro_id_" + .@gid + "_0"),getarraysize(getd(".ro_id_" + .@gid + "_0"))); copyarray(.@opt_mn,getd(".ro_mn_" + .@gid + "_0"),getarraysize(getd(".ro_mn_" + .@gid + "_0"))); copyarray(.@opt_mx,getd(".ro_mx_" + .@gid + "_0"),getarraysize(getd(".ro_mx_" + .@gid + "_0"))); for(.@i=1;.@i<6;.@i++){ copyarray(getd("[email protected]_id" + .@i),getd(".ro_id_" + .@gid + "_" + .@i),getarraysize(getd(".ro_id_" + .@gid + "_" + .@i))); copyarray(getd("[email protected]_mn" + .@i),getd(".ro_mn_" + .@gid + "_" + .@i),getarraysize(getd(".ro_mn_" + .@gid + "_" + .@i))); copyarray(getd("[email protected]_mx" + .@i),getd(".ro_mx_" + .@gid + "_" + .@i),getarraysize(getd(".ro_mx_" + .@gid + "_" + .@i))); } for(.@i=1;.@i<6;.@i++){ if(rand(100) > getd(".s_" + .@i + "[" + .@gid + "]")) break; if(getd(".ro_id_" + .@gid + "_" + .@i)){ if(!getarraysize(getd("[email protected]_id" + .@i))) break; .@ndx = rand(getarraysize(getd("[email protected]_id" + .@i))); .@result_id = getd("[email protected]_id" + .@i + "[" + .@ndx + "]"); .@result_vl = rnd(getd("[email protected]_mn" + .@i + "[" + .@ndx + "]"),getd("[email protected]_mx" + .@i + "[" + .@ndx + "]")); deletearray(getd("[email protected]_id" + .@i + "[" + .@ndx + "]"),1); deletearray(getd("[email protected]_mn" + .@i + "[" + .@ndx + "]"),1); deletearray(getd("[email protected]_mx" + .@i + "[" + .@ndx + "]"),1); }else{ if(!.@opt_id) break; .@ndx = rand(getarraysize(.@opt_id)); .@result_id = .@opt_id[.@ndx]; .@result_vl = rnd(.@opt_mn[.@ndx],.@opt_mx[.@ndx]); if(!.g_reuse[.@gid]){ deletearray(.@opt_id[.@ndx],1); deletearray(.@opt_mn[.@ndx],1); deletearray(.@opt_mx[.@ndx],1); } } if(.ex[.@result_id]){ for(.@i2=0;.@i2<getarraysize(.@r_id);.@i2++){ if(.ex[.@result_id] == .ex[.@r_id[.@i2]]){ .@reject = true; } } } if(!.@reject){ .@s1 = getarraysize(.@r_id); .@r_id[.@s1] = .@result_id; .@r_v[.@s1] = .@result_vl; }else{ .@i--; .@failsafe++; if(.@failsafe > 50){ mes "Something went wrong , The server admin need to make sure that the config is done correctly!"; end; } } } if(Zeny < .@zeny) end; if(#CASHPOINTS < .@cashpoint) end; if(getd(.CustomPointsVariable$) < .@costumpoint) end; for(.@i=0;.@i<getarraysize(.@item);.@i++){ if(countitem(.@item[.@i]) < .@amount[.@i]){ end; } } // anti-hack if (callfunc("F_IsEquipIDHack", .@eq, .@id) || callfunc("F_IsEquipCardHack", .@eq, .@c0, .@c1, .@c2, .@c3)) { // anti-hack emotion ET_FRET; mes "Item Switch detected!"; end; } Zeny -= .@zeny; #CASHPOINTS-= .@cashpoint; setd(.CustomPointsVariable$,getd(.CustomPointsVariable$) - .@costumpoint); for(.@i=0;.@i<getarraysize(.@item);.@i++){ delitem(.@item[.@i],.@amount[.@i]); } if(!.@r_id){ specialeffect2 EF_REFINEOK; mes "Look Like you didn't get any random option, your luck is really bad!"; end; } delequip(.@eq); specialeffect2 EF_REFINEOK; if(.KeepItemData) getitem3(.@id,1,1,.@r,0,.@c0,.@c1,.@c2,.@c3,.@r_id,.@r_v,.@null); else getitem3(.@id,1,1,0,0,0,0,0,0,.@r_id,.@r_v,.@null); equip(.@id); mes "Done!"; end; case 2: mes "The list of the allowed items in this npc!"; for(.@i=0;.@i<getarraysize(.item_list);.@i++){ mes "<ITEM>" + getitemname(.item_list[.@i]) + "[" + getitemslots(.item_list[.@i]) + "]<INFO>" + .item_list[.@i] + "</INFO></ITEM>"; if(.@i >= 10 && !(.@i%10)) next; } end; } end; function rnd { if(.HardBalance){ return rand(getarg(0),rand(getarg(0),getarg(1))); } return rand(getarg(0),getarg(1)); } function AddGroup { .@id = getarg(0); for(.@i=1;.@i<getargcount();.@i++){ .it[getarg(.@i)] = .@id; .item_list[getarraysize(.item_list)] = getarg(.@i); } return; } function AddGroupOption { .@id = getarg(0); .g_reroll[.@id] = getarg(1); .g_reuse[.@id] = getarg(2); return; } function AddGroupCost { .@id = getarg(0); .nz[.@id] = getarg(1); .nk[.@id] = getarg(2); .nc[.@id] = getarg(3); for(.@i=4;.@i<getargcount();.@i+=2){ .@s = getarraysize(getd(".ni_" + .@id)); setd(".ni_" + .@id + "[" + .@s + "]",getarg(.@i)); setd(".na_" + .@id + "[" + .@s + "]",getarg(.@i+1)); } return; } function AddGroupReRollCost { .@id = getarg(0); .rz[.@id] = getarg(1); .rk[.@id] = getarg(2); .rc[.@id] = getarg(3); for(.@i=4;.@i<getargcount();.@i+=2){ .@s = getarraysize(getd(".ri_" + .@id)); setd(".ri_" + .@id + "[" + .@s + "]",getarg(.@i)); setd(".ra_" + .@id + "[" + .@s + "]",getarg(.@i+1)); } return; } function AddGroupChance { .@id = getarg(0); .s_1[.@id] = getarg(1); .s_2[.@id] = getarg(2); .s_3[.@id] = getarg(3); .s_4[.@id] = getarg(4); .s_5[.@id] = getarg(5); return; } function AddOpt { .@id = getarg(0); .@loc = getarg(1); .@s = getarraysize(getd(".ro_id_" + .@id + "_" + .@loc)); setd(".ro_id_" + .@id + "_" + .@loc + "[" + .@s + "]",getarg(2)); setd(".ro_mn_" + .@id + "_" + .@loc + "[" + .@s + "]",getarg(3)); setd(".ro_mx_" + .@id + "_" + .@loc + "[" + .@s + "]",getarg(4)); return; } function AddExclusiveOpt { .@s1 = getarraysize(.exv); .exv[.@s1] = true; for(.@i=0;.@i<getargcount();.@i++){ .ex[getarg(.@i)] = .@s1; } return; } OnInit: .exv = true;//DO NOT REMOVE THIS. .KeepItemData = true;//if this is 'false , the player will loss the refine+cards from the item when he use this npc. .CustomPointsVariable$ = "#COSTUMPOINTS";//The variable name of the costum points. .CustomPointsName$ = "Server RO Points";//The name of the costum points, this what the player will see. .HardBalance = true;//if this is true , it would be much harder to get high value in the random option. //AddGroup(<Group ID>,<ItemID>,<ItemID>,<ItemID>,<ItemID>,<ItemID>); /* AddGroup Doc <Group ID> = a number between 1 and MAX_INT64 DO NOT REUSE THE GROUP ID IN THE SAME FILE CONFIG! DO NOT REUSE THE SAME ITEM ID IN DIFFERENT GROUP! will create a group id you can add as many as you want items inside a group. */ //AddGroupOption(<Group ID>,<Allow ReRoll?true:false>,<Allow reuse already gotten option?true:false>,<Zeny Cost>,<CashPoint Cost>,<Custom Points Cost>,<Item1 ID Cost>,<Item1 Amount Cost>,<Item2 ID Cost>,<Item2 Amount Cost>,<....ETC>); /* AddGroupOption Doc <Group ID> = A group id that is already created in AddGroup()!. <Allow ReRoll?true:false> = allow reroll an item with random option or not <Allow reuse already gotten option?true:false> = for exammple if you have str in the options and the player gor it , can he get it again in another slot? */ //AddGroupCost(<Group ID>,<Zeny Cost>,<CashPoint Cost>,<Custom Points Cost>,<Item1 ID Cost>,<Item1 Amount Cost>,<Item2 ID Cost>,<Item2 Amount Cost>,<....ETC>); /* AddGroupCost Doc <Group ID> = A group id that is already created in AddGroup()!. <Zeny Cost> = the zeny cost (can be 0) <CashPoint Cost> = the cashpoints cost (can be 0) <Custom Points Cost> = if you are using costum points in the script , check out .CustomPointsVariable$ and .CustomPointsName$ at the start of the script (can be 0) <Item1 ID Cost> = the item cost <Item1 Amount Cost> = the item amount cost You can use as many item,amount cost at the end of the function. */ //AddGroupReRollCost(<Group ID>,<Zeny Cost>,<CashPoint Cost>,<Custom Points Cost>,<Item1 ID Cost>,<Item1 Amount Cost>,<Item2 ID Cost>,<Item2 Amount Cost>,<....ETC>); /* AddGroupReRollCost Doc <Group ID> = A group id that is already created in AddGroup()!. <Zeny Cost> = the zeny cost (can be 0) <CashPoint Cost> = the cashpoints cost (can be 0) <Custom Points Cost> = if you are using costum points in the script , check out .CustomPointsVariable$ and .CustomPointsName$ at the start of the script (can be 0) <Item1 ID Cost> = the item cost <Item1 Amount Cost> = the item amount cost You can use as many item,amount cost at the end of the function. */ //AddGroupChance(<Group ID>,<1st Option Chance>,<2nd Option Chance>,<3rd Option Chance>,<4th Option Chance>,<5th Option Chance>); /* AddGroupChance Doc <Group ID> = A group id that is already created in AddGroup()!. <1st Option Chance> = the Chance to get one of the random options in the slot 1 (can be 0) <2nd Option Chance> = the Chance to get one of the random options in the slot 2 (can be 0) <3rd Option Chance> = the Chance to get one of the random options in the slot 3 (can be 0) <4th Option Chance> = the Chance to get one of the random options in the slot 4 (can be 0) <5th Option Chance> = the Chance to get one of the random options in the slot 5 (can be 0) Keep inmind that if the player didn't get lucky for example at the slot 2 , all the chances after will be ignored you cannot skip a random option slot that would bug the game client. */ //AddOpt(<Group ID>,<Location>,<Random Option ID>,<Minimum Value>,<Maximum Value>); /* AddOpt Doc <Group ID> = A group id that is already created in AddGroup()!. <Location> = you can spisfiy random option to a location from 1 to 5 , but you can use 0 , if you used 0 it will apply to all locations that doesn't have spisfied random options. <Random Option ID> = random option id , you can use the id or the variable , check out the file /rathena/db/re/item_randomopt_db.yml <Minimum Value> = the minimum value <Maximum Value> = the maximum value */ //AddExclusiveOpt(<Random Option ID>,<Random Option ID>,<Random Option ID>,<Random Option ID>,<Random Option ID>); /* AddExclusiveOpt Doc this will help you to prevent a group of random opions typs in the same item in different slots for example RDMOPT_DAMAGE_PROPERTY_NOTHING_TARGET RDMOPT_DAMAGE_PROPERTY_WATER_TARGET RDMOPT_DAMAGE_PROPERTY_GROUND_TARGET RDMOPT_DAMAGE_PROPERTY_FIRE_TARGET RDMOPT_DAMAGE_PROPERTY_WIND_TARGET RDMOPT_DAMAGE_PROPERTY_POISON_TARGET RDMOPT_DAMAGE_PROPERTY_SAINT_TARGET RDMOPT_DAMAGE_PROPERTY_DARKNESS_TARGET RDMOPT_DAMAGE_PROPERTY_TELEKINESIS_TARGET RDMOPT_DAMAGE_PROPERTY_UNDEAD_TARGET if the player got 1 of them in a slot , he wont get another one to another slot */ //Example!!!> //this is just an example , this script allow you to create any random option system you want. //Creating Group id 1 , with Hat items inside. AddGroup(1,2220,2221,2222,2223); //Group id 1 Options AddGroupOption(1,true,false); //Group id 1 Cost AddGroupCost(1,50,0,0,0,0,0,0); //Group id 1 ReRoll Cost AddGroupReRollCost(1,50,0,0,0,0,0,0); //Group id 1 Chances. AddGroupChance(1,100,100,100,100,100); //Group id 1 Random Option List. location 0 mean all the slot locations AddOpt(1,0,RDMOPT_VAR_STRAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_INTAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_VITAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_LUKAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_AGIAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_DEXAMOUNT,1,100); AddOpt(1,0,RDMOPT_VAR_MAXHPPERCENT,1,100); AddOpt(1,0,RDMOPT_VAR_MAXSPPERCENT,1,100); //those enchantment you wont get unless in slot 5 AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_NOTHING_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_WATER_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_GROUND_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_FIRE_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_WIND_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_POISON_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_SAINT_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_DARKNESS_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_TELEKINESIS_TARGET,1,100); AddOpt(1,5,RDMOPT_DAMAGE_PROPERTY_UNDEAD_TARGET,1,100); //this mean those random options cannot coexist in the same item!. AddExclusiveOpt(RDMOPT_DAMAGE_PROPERTY_NOTHING_TARGET, RDMOPT_DAMAGE_PROPERTY_WATER_TARGET, RDMOPT_DAMAGE_PROPERTY_GROUND_TARGET, RDMOPT_DAMAGE_PROPERTY_FIRE_TARGET, RDMOPT_DAMAGE_PROPERTY_WIND_TARGET, RDMOPT_DAMAGE_PROPERTY_POISON_TARGET, RDMOPT_DAMAGE_PROPERTY_SAINT_TARGET, RDMOPT_DAMAGE_PROPERTY_DARKNESS_TARGET, RDMOPT_DAMAGE_PROPERTY_TELEKINESIS_TARGET, RDMOPT_DAMAGE_PROPERTY_UNDEAD_TARGET); end; } this is a work of @sader1992 TIA EDIT: whole map server lags when i try to add option Edited February 12 by AinsLord Quote Link to comment Share on other sites More sharing options...
AinsLord Posted February 13 Share Posted February 13 (edited) im using this sir @sader1992 at 1st it was working fine then several days after when i tried to put options after selecting proceed this happens it hangs cant move cant even TP nor chat i need to reboot the whole VPS to bring it back i dunno what happen i didnt change any codes or add anything i just created another NPC of it for addition ID option i forgot that ID 1 has the same item on the other NPC that has ID 2 like this NPC 1 //Creating Group id 1 , with Hat items inside. AddGroup(1,2220,2221,2222,2223); NPC 2 //Creating Group id 1 , with Hat items inside. AddGroup(2,2223); will that affect this DO NOT REUSE THE SAME ITEM ID IN DIFFERENT GROUP! Edited February 13 by AinsLord more info Quote Link to comment Share on other sites More sharing options...
sader1992 Posted February 13 Author Share Posted February 13 7 hours ago, AinsLord said: im using this sir @sader1992 at 1st it was working fine then several days after when i tried to put options after selecting proceed this happens it hangs cant move cant even TP nor chat i need to reboot the whole VPS to bring it back i dunno what happen i didnt change any codes or add anything i just created another NPC of it for addition ID option i forgot that ID 1 has the same item on the other NPC that has ID 2 like this NPC 1 //Creating Group id 1 , with Hat items inside. AddGroup(1,2220,2221,2222,2223); NPC 2 //Creating Group id 1 , with Hat items inside. AddGroup(2,2223); will that affect this DO NOT REUSE THE SAME ITEM ID IN DIFFERENT GROUP! The groups/ids are per npc , you can use the same item in a different npc copy however you cannot use the same item in the same npc in a different group. also i need more information about when this happen to you , at any step of the npc ? the image you provided the next line is just select , so I don't think this where you are getting the issue Quote Link to comment Share on other sites More sharing options...
AinsLord Posted February 14 Share Posted February 14 21 hours ago, sader1992 said: The groups/ids are per npc , you can use the same item in a different npc copy however you cannot use the same item in the same npc in a different group. also i need more information about when this happen to you , at any step of the npc ? the image you provided the next line is just select , so I don't think this where you are getting the issue i found out why it hangs it happens because of my phpmyadmin database thanks i love your script Quote Link to comment Share on other sites More sharing options...
mrfizi Posted February 15 Share Posted February 15 Thanks for this release @sader1992. Realy like it and will use it on my server. Quote Link to comment Share on other sites More sharing options...