Xemnas969696 Posted October 15, 2021 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 08/28/20 Last Seen: February 13 Share Posted October 15, 2021 Hi my friends I try to create a box with random items but I can't. could someone guide me step by step to do this? Thx so much for your help Quote Link to comment Share on other sites More sharing options...
0 Sallycantdance Posted October 15, 2021 Group: Members Topic Count: 225 Topics Per Day: 0.14 Content Count: 798 Reputation: 12 Joined: 12/04/20 Last Seen: 20 minutes ago Share Posted October 15, 2021 (edited) 1 hour ago, Xemnas969696 said: Hi my friends I try to create a box with random items but I can't. could someone guide me step by step to do this? Thx so much for your help 1st make a custom box if you want box in this example i use egg scroll in your db/import/item_db.yml - Id: 12654 AegisName: Lucky_Egg_C9 Name: Lucky Egg C9 Type: Usable Buy: 20 Weight: 10 Flags: Container: true Trade: Override: 100 NoDrop: true NoTrade: true NoSell: true NoCart: true NoGuildStorage: true NoMail: true NoAuction: true Script: | getitem callfunc("F_Rand",14003,12221,12208,14592,12210,12211,7621,7776),1; 2nd in your db/item_db.yml.txt 12654,Lucky_Egg_C9,Lucky Egg C9,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Lucky_Egg_C9); },{},{} Edited October 15, 2021 by Mael Use codebox Quote Link to comment Share on other sites More sharing options...
0 Xemnas969696 Posted October 15, 2021 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 08/28/20 Last Seen: February 13 Author Share Posted October 15, 2021 (edited) on my side it's item_db.txt. On 10/15/2021 at 9:55 PM, chadness said: 1st make a custom box if you want box in this example i use egg scroll in your db/import/item_db.yml - Id: 12654 AegisName: Lucky_Egg_C9 Name: Lucky Egg C9 Type: Usable Buy: 20 Weight: 10 Flags: Container: true Trade: Override: 100 NoDrop: true NoTrade: true NoSell: true NoCart: true NoGuildStorage: true NoMail: true NoAuction: true Script: | getitem callfunc("F_Rand",14003,12221,12208,14592,12210,12211,7621,7776),1; 2nd in your db/item_db.yml.txt 12654,Lucky_Egg_C9,Lucky Egg C9,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Lucky_Egg_C9); },{},{} how can I do to add a rate on the random? the IG_mabox I have to declare it somewhere? Edited October 16, 2021 by Xemnas969696 Quote Link to comment Share on other sites More sharing options...
0 Sallycantdance Posted October 16, 2021 Group: Members Topic Count: 225 Topics Per Day: 0.14 Content Count: 798 Reputation: 12 Joined: 12/04/20 Last Seen: 20 minutes ago Share Posted October 16, 2021 (edited) 14 hours ago, Xemnas969696 said: how can I do to add a rate on the random? the IG_mabox I have to declare it somewhere? function script CustomBox { setarray .i1[0],909,910; // Common Items set .i1rand,rand(0,1); // Randomize Common Items; just change max amount if you add items setarray .i2[0],911,912; // Rare Items set .i2rand,rand(0,1); // Randomize Rare Items; just change max amount if you add items setarray .i3[0],2199,1599; // Super Rare Items set .i3rand,rand(0,1); //Randomize Super Rare Items; just change max amount if you add items set .chance, rand(100); // Super Rare Item 1% if (.chance == 1){ getitem .i[.i3rand],1; announce "["+strcharinfo(0)+"] won a ["+getitemname(.i[0])+"] from the Special Box.",0; end; } // Rare Item 50% else if (.chance <= 50 && .chance >= 11){ getitem .i[.i2rand],1; announce "["+strcharinfo(0)+"] won a ["+getitemname(.i[0])+"] from the Special Box.",0; end; } // Common Items else { getitem .i1[.i1rand],1; end; } } Edited October 17, 2021 by Emistry codebox Quote Link to comment Share on other sites More sharing options...
Question
Xemnas969696
Hi my friends
I try to create a box with random items but I can't. could someone guide me step by step to do this?
Thx so much for your help
Link to comment
Share on other sites
3 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.