aoshinho Posted March 3, 2023 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 15 Reputation: 8 Joined: 02/20/23 Last Seen: Thursday at 05:52 PM Share Posted March 3, 2023 14 minutes ago, hendra814 said: i want setup different random option for each location, but not limited for some items. i'm updated the code following sader instructions and now my npc do exactly it maybe you need something different but acctualy this npc do this Quote Link to comment Share on other sites More sharing options...
sader1992 Posted March 3, 2023 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 31 minutes ago Author Share Posted March 3, 2023 On 3/2/2023 at 6:25 PM, hendra814 said: if by equipment location is it possible? instead of .@gid = <Group ID>; Use .@gid = .@eq; now this is the group ID for each location EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 1 Quote Link to comment Share on other sites More sharing options...
hendra814 Posted March 4, 2023 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 11 hours ago Share Posted March 4, 2023 (edited) 21 hours ago, sader1992 said: instead of .@gid = <Group ID>; Use .@gid = .@eq; now this is the group ID for each location EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 Thanks @sader1992 already working, but if i want change the option where i should check the documentation for Random option Edited March 4, 2023 by hendra814 Quote Link to comment Share on other sites More sharing options...
sader1992 Posted March 4, 2023 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 31 minutes ago Author Share Posted March 4, 2023 44 minutes ago, hendra814 said: Thanks @sader1992 already working, but if i want change the option where i should check the documentation for Random option each random option have an item bonus under it you can check all the random options in here https://github.com/rathena/rathena/blob/master/db/re/item_randomopt_db.yml Quote Link to comment Share on other sites More sharing options...
hendra814 Posted March 4, 2023 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 11 hours ago Share Posted March 4, 2023 3 minutes ago, sader1992 said: each random option have an item bonus under it you can check all the random options in here https://github.com/rathena/rathena/blob/master/db/re/item_randomopt_db.yml Dear @sader1992, Thanks again for the information Quote Link to comment Share on other sites More sharing options...
Hyllok Posted March 17, 2023 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 27 Reputation: 5 Joined: 08/27/16 Last Seen: Wednesday at 09:16 PM Share Posted March 17, 2023 Hello! How can I add an option to reroll a specific slot? The actual reroll system do this to all slots at once, and I would like to give the option to choose a certain slot to reroll. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
kalabasa Posted June 6, 2023 Group: Members Topic Count: 123 Topics Per Day: 0.05 Content Count: 478 Reputation: 14 Joined: 11/30/17 Last Seen: January 23 Share Posted June 6, 2023 On 3/4/2023 at 1:46 AM, sader1992 said: instead of .@gid = <Group ID>; Use .@gid = .@eq; now this is the group ID for each location EQI_ACC_L (0) - Accessory 1 EQI_ACC_R (1) - Accessory 2 EQI_SHOES (2) - Footgear (shoes, boots) EQI_GARMENT (3) - Garment (mufflers, hoods, manteaux) EQI_HEAD_LOW (4) - Lower Headgear (beards, some masks) EQI_HEAD_MID (5) - Middle Headgear (masks, glasses) EQI_HEAD_TOP (6) - Upper Headgear EQI_ARMOR (7) - Armor (jackets, robes) EQI_HAND_L (8) - Left hand (weapons, shields) EQI_HAND_R (9) - Right hand (weapons) EQI_COSTUME_HEAD_TOP (10) - Upper Costume Headgear EQI_COSTUME_HEAD_MID (11) - Middle Costume Headgear EQI_COSTUME_HEAD_LOW (12) - Lower Costume Headgear EQI_COSTUME_GARMENT (13) - Costume Garment EQI_AMMO (14) - Arrow/Ammunition EQI_SHADOW_ARMOR (15) - Shadow Armor EQI_SHADOW_WEAPON (16) - Shadow Weapon EQI_SHADOW_SHIELD (17) - Shadow Shield EQI_SHADOW_SHOES (18) - Shadow Shoes EQI_SHADOW_ACC_R (19) - Shadow Accessory 2 EQI_SHADOW_ACC_L (20) - Shadow Accessory 1 How would i add for left accessory since you can only add group starting 1? Quote Link to comment Share on other sites More sharing options...
Johnson Posted January 6, 2024 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 23 Reputation: 1 Joined: 08/22/18 Last Seen: 4 hours ago Share Posted January 6, 2024 (edited) How do I link the item with enchant options from `<ITEM> <INFO> </INFO></ITEM>` I've tried this but just linking the Hat with no random option info Quote mes "<ITEM>" + getitemname(.@id) + "[" + getitemslots(.@id) + "]<INFO>" + .@id[getrandomoptinfo(.@r_v)] + "</INFO></ITEM>"; In this line of script: if(.KeepItemData) set .@ref, 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); .@s = getarraysize(getd(".ro_id_" + .@id)); mes "<ITEM>" + getitemname(.@id) + "[" + getitemslots(.@id) + "]<INFO>" + .@id[getrandomoptinfo(.@r_v)] + "</INFO></ITEM>"; mes "Done!"; Edited January 6, 2024 by khouuming21 Quote Link to comment Share on other sites More sharing options...
Metrius Posted January 18, 2024 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 2 Reputation: 0 Joined: 12/30/23 Last Seen: September 29, 2024 Share Posted January 18, 2024 (edited) I get the error in the mapserver and in the client game Note i just install the npc and just testing no modifications Edited January 18, 2024 by Metrius Quote Link to comment Share on other sites More sharing options...
sader1992 Posted April 29, 2024 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 31 minutes ago Author Share Posted April 29, 2024 (edited) Version 1.1 Fixing an issue where sometimes the script break because of 'rand' function. Nothing have changed in the script just the rnd function if anyone want to update the script without replacing it , just replace the 'rnd' function at around line 210 with this function rnd { if(getarg(0) == getarg(1)) return getarg(0); if(.HardBalance){ .@r = rand(getarg(0),getarg(1)); if(getarg(0) == .@r) return getarg(0); return rand(getarg(0),.@r); } return rand(getarg(0),getarg(1)); } this should fix the problem where sometimes the script break because of the 'rand' function Edited April 29, 2024 by sader1992 1 Quote Link to comment Share on other sites More sharing options...
Eragonat Posted May 4, 2024 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 15 Reputation: 0 Joined: 03/06/16 Last Seen: 39 minutes ago Share Posted May 4, 2024 Hi guys! You are getting this error, what could it be? Quote Link to comment Share on other sites More sharing options...
varinha Posted October 9, 2024 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 18 Reputation: 0 Joined: 07/14/14 Last Seen: 21 hours ago Share Posted October 9, 2024 On 4/29/2024 at 7:24 PM, sader1992 said: Version 1.1 Fixing an issue where sometimes the script break because of 'rand' function. Nothing have changed in the script just the rnd function if anyone want to update the script without replacing it , just replace the 'rnd' function at around line 210 with this function rnd { if(getarg(0) == getarg(1)) return getarg(0); if(.HardBalance){ .@r = rand(getarg(0),getarg(1)); if(getarg(0) == .@r) return getarg(0); return rand(getarg(0),.@r); } return rand(getarg(0),getarg(1)); } this should fix the problem where sometimes the script break because of the 'rand' function Even with these changes, still have the same problem. Quote Link to comment Share on other sites More sharing options...
sader1992 Posted October 9, 2024 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 31 minutes ago Author Share Posted October 9, 2024 (edited) 8 hours ago, varinha said: Even with these changes, still have the same problem. are you using "0" as a value in the maximum value ? because that is what the messages you are having says, it's different from the other problem i fixed before. Edited October 9, 2024 by sader1992 Quote Link to comment Share on other sites More sharing options...
rmon Posted November 22, 2024 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 97 Reputation: 2 Joined: 04/27/16 Last Seen: 4 hours ago Share Posted November 22, 2024 Also getting the same issue [Error]: buildin_rand: range (0) is too small. No randomness possible. [Warning]: Script command 'rand' returned failure. [Debug]: Source (NPC): AllInOne_RandomOption at prontera (147,171) [Debug]: Source (NPC): AllInOne_RandomOption is located in: npc/custom/costume_enchant.txt //Creating Group id 1 , with Hat items inside. AddGroup(1,2000001,2000002,2000006,2000007,2000023,2000038,2000039,2000040,2000043,2000044,2000045,2000046,2000047,2000048,2000049,2000050,2000053,2000068,2000069,2000070,2000071,2000072,2000073,2000074,2000075,2000076,2000077,2000078,3000006,3000012,3000035,3000037,3000039); //Group id 1 Options AddGroupOption(1,true,true); //Group id 1 Cost AddGroupCost(1,250000,0,0); //Group id 1 ReRoll Cost AddGroupReRollCost(1,500000,50,0); //Group id 1 Chances. AddGroupChance(1,100,30,20,10,5); //Group id 1 Random Option List. AddOpt(1,1,RDMOPT_ADDEXPPERCENT_KILLRACE_ALL,1,100); Quote Link to comment Share on other sites More sharing options...
sader1992 Posted November 23, 2024 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 31 minutes ago Author Share Posted November 23, 2024 On 11/22/2024 at 11:09 AM, rmon said: Also getting the same issue [Error]: buildin_rand: range (0) is too small. No randomness possible. [Warning]: Script command 'rand' returned failure. [Debug]: Source (NPC): AllInOne_RandomOption at prontera (147,171) [Debug]: Source (NPC): AllInOne_RandomOption is located in: npc/custom/costume_enchant.txt //Creating Group id 1 , with Hat items inside. AddGroup(1,2000001,2000002,2000006,2000007,2000023,2000038,2000039,2000040,2000043,2000044,2000045,2000046,2000047,2000048,2000049,2000050,2000053,2000068,2000069,2000070,2000071,2000072,2000073,2000074,2000075,2000076,2000077,2000078,3000006,3000012,3000035,3000037,3000039); //Group id 1 Options AddGroupOption(1,true,true); //Group id 1 Cost AddGroupCost(1,250000,0,0); //Group id 1 ReRoll Cost AddGroupReRollCost(1,500000,50,0); //Group id 1 Chances. AddGroupChance(1,100,30,20,10,5); //Group id 1 Random Option List. AddOpt(1,1,RDMOPT_ADDEXPPERCENT_KILLRACE_ALL,1,100); are you using 1 option only ? are you using the latest version of the script ? Quote Link to comment Share on other sites More sharing options...
rmon Posted November 24, 2024 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 97 Reputation: 2 Joined: 04/27/16 Last Seen: 4 hours ago Share Posted November 24, 2024 14 hours ago, sader1992 said: are you using 1 option only ? are you using the latest version of the script ? For testing purpose i want to try 1 first. Yes, i'm using 1.1 Quote Link to comment Share on other sites More sharing options...
Astro Young Posted January 5 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 5 Reputation: 0 Joined: 06/12/22 Last Seen: April 12 Share Posted January 5 After i enchant there is no effect in my stats even the given value is + 50 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.