johnbond Posted September 14, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Share Posted September 14, 2014 I would like to request an item script for a "box" that would give random items when opened. I shall provide which items it shall randomly give out from the list. Example of items are #2202, #2217, #2231 etc. It will be around 5-10 items. Is this possible? Thank you in advance guys! Quote Link to comment Share on other sites More sharing options...
Chaos92 Posted September 14, 2014 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 1826 Reputation: 288 Joined: 08/03/12 Last Seen: 40 minutes ago Share Posted September 14, 2014 {getitem callfunc("F_Rand",2202,2217,2231),1; },{},{} Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 14, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 14, 2014 {getitem callfunc("F_Rand",2202,2217,2231),1; },{},{} I think its not working. I used: {getitem callfunc("F_Rand",2202,2217,2231),1; },{},{} exactly the same. I get the errors everytime I click: [03:19:20][Error]: script:callfunc: function not found! [F_Rand] [03:19:20][Debug]: Source (NPC): FAKE_NPC (invisible/not on a map) [03:19:33][Error]: script:callfunc: function not found! [F_Rand] [03:19:33][Debug]: Source (NPC): FAKE_NPC (invisible/not on a map) Btw, I still use 3ceam svn sorry for not making it clear. Thank you again my friend. Quote Link to comment Share on other sites More sharing options...
Chaos92 Posted September 14, 2014 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 1826 Reputation: 288 Joined: 08/03/12 Last Seen: 40 minutes ago Share Posted September 14, 2014 (edited) u are not using rathena ? Edited September 14, 2014 by Chaos92 Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 14, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 14, 2014 u are not using rathena ? I am using 3ceam with some rathena modifications. Quote Link to comment Share on other sites More sharing options...
Radian Posted September 15, 2014 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share Posted September 15, 2014 F_Rand function is not available on 3ceam. Quote Link to comment Share on other sites More sharing options...
Chaos92 Posted September 15, 2014 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 1826 Reputation: 288 Joined: 08/03/12 Last Seen: 40 minutes ago Share Posted September 15, 2014 yes its not available in 3ceam. if you are using NPC to replace the item , its easy setarray .@card,2202,2217,2231; getitem .@card[ rand( getarraysize( .@card ) ) ],1; delitem 501,1; change 501 to any item that u want to let them change to that npc Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 15, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 15, 2014 yes its not available in 3ceam. if you are using NPC to replace the item , its easy setarray .@card,2202,2217,2231; getitem .@card[ rand( getarraysize( .@card ) ) ],1; delitem 501,1; change 501 to any item that u want to let them change to that npc I need it to be in my itemdb. It will be in a box of which the box will give random items from the list I will have. Is there any other way around this? Thank you my friend. Quote Link to comment Share on other sites More sharing options...
Radian Posted September 15, 2014 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share Posted September 15, 2014 i think getitem,rand(501,502,503,504)1; will be okay? Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 15, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 15, 2014 i think getitem,rand(501,502,503,504)1; will be okay? I tried it but its not working. The "rand" part behaves differently. According to doc.txt: *rand(<number>{,<number>}); This function returns a number, randomly positioned between 0 and the number you specify (if you only specify one) and the two numbers you specify if you give it two. rand(10) would result in 0,1,2,3,4,5,6,7,8 or 9 rand(2,10) would result in 2,3,4,5,6,7,8,9 or 10 Quote Link to comment Share on other sites More sharing options...
Chaos92 Posted September 15, 2014 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 1826 Reputation: 288 Joined: 08/03/12 Last Seen: 40 minutes ago Share Posted September 15, 2014 yes its not available in 3ceam. if you are using NPC to replace the item , its easy setarray .@card,2202,2217,2231; getitem .@card[ rand( getarraysize( .@card ) ) ],1; delitem 501,1; change 501 to any item that u want to let them change to that npc I need it to be in my itemdb. It will be in a box of which the box will give random items from the list I will have. Is there any other way around this? Thank you my friend. just give any etc items that u didnt use to them to exchange with those items. its simple and easy though Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 15, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 15, 2014 yes its not available in 3ceam. if you are using NPC to replace the item , its easy setarray .@card,2202,2217,2231; getitem .@card[ rand( getarraysize( .@card ) ) ],1; delitem 501,1; change 501 to any item that u want to let them change to that npc I need it to be in my itemdb. It will be in a box of which the box will give random items from the list I will have. Is there any other way around this? Thank you my friend. just give any etc items that u didnt use to them to exchange with those items. its simple and easy though I need that the box should give random prizes so it is not always what they expect to get. The box should give items randomly from my list. Another idea is what if I manully put the callfunc("F_Rand" codes in my SRC? Will this do the trick? Thanks. Quote Link to comment Share on other sites More sharing options...
Chaos92 Posted September 15, 2014 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 1826 Reputation: 288 Joined: 08/03/12 Last Seen: 40 minutes ago Share Posted September 15, 2014 is this that u need ? 501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "CustomBox"; },{},{} for itemdb function script CustomBox { setarray .BoxItems[0],501,502,503; set .Random, getarraysize( .BoxItems ); getitem .BoxItems[ rand( .Random ) ], 1; announce "["+strcharinfo(0)+"] has just obtained a ["+getitemname(.BoxItems[ .Random ])+"] from a Custom Box.",0; end; } in script that u need to load edit setarray .BoxItems[0],501,502,503; for item list random Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 15, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 15, 2014 is this that u need ? 501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "CustomBox"; },{},{} for itemdb function script CustomBox { setarray .BoxItems[0],501,502,503; set .Random, getarraysize( .BoxItems ); getitem .BoxItems[ rand( .Random ) ], 1; announce "["+strcharinfo(0)+"] has just obtained a ["+getitemname(.BoxItems[ .Random ])+"] from a Custom Box.",0; end; } in script that u need to load edit setarray .BoxItems[0],501,502,503; for item list random Wow you are awesome! I will give this a try soon and let you know. Thank you my friend! Quote Link to comment Share on other sites More sharing options...
Chaos92 Posted September 15, 2014 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 1826 Reputation: 288 Joined: 08/03/12 Last Seen: 40 minutes ago Share Posted September 15, 2014 try and tell us here is it work or not Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 16, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 16, 2014 is this that u need ? 501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "CustomBox"; },{},{} for itemdb function script CustomBox { setarray .BoxItems[0],501,502,503; set .Random, getarraysize( .BoxItems ); getitem .BoxItems[ rand( .Random ) ], 1; announce "["+strcharinfo(0)+"] has just obtained a ["+getitemname(.BoxItems[ .Random ])+"] from a Custom Box.",0; end; } in script that u need to load edit setarray .BoxItems[0],501,502,503; for item list random Working! Awesome! Thank you my friend! Quote Link to comment Share on other sites More sharing options...
Chaos92 Posted September 16, 2014 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 1826 Reputation: 288 Joined: 08/03/12 Last Seen: 40 minutes ago Share Posted September 16, 2014 welcome Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 18, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 18, 2014 welcome My friend the announcement feature you had put is great: announce "["+strcharinfo(0)+"] has just obtained a ["+getitemname(.BoxItems[ .Random ])+"] from a Custom Box.",0; But it does not announce properly. It gives "null" announcement of the item. [Test123] has just obtained a [null] from a a Custom Box. No error in map console. Can we fix? I use 3Ceam. Thank you! Quote Link to comment Share on other sites More sharing options...
johnbond Posted September 21, 2014 Group: Members Topic Count: 113 Topics Per Day: 0.03 Content Count: 457 Reputation: 11 Joined: 02/17/13 Last Seen: January 23, 2018 Author Share Posted September 21, 2014 welcome My friend the announcement feature you had put is great: announce "["+strcharinfo(0)+"] has just obtained a ["+getitemname(.BoxItems[ .Random ])+"] from a Custom Box.",0; But it does not announce properly. It gives "null" announcement of the item. [Test123] has just obtained a [null] from a a Custom Box. No error in map console. Can we fix? I use 3Ceam. Thank you! Oh nevermind I already got it hehe. Thank you Mr. Chaos92! Quote Link to comment Share on other sites More sharing options...
Emistry Posted September 21, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 19 hours ago Share Posted September 21, 2014 {getitem callfunc("F_Rand",2202,2217,2231),1; },{},{} I think its not working. I used: {getitem callfunc("F_Rand",2202,2217,2231),1; },{},{} exactly the same. I get the errors everytime I click: [03:19:20][Error]: script:callfunc: function not found! [F_Rand] [03:19:20][Debug]: Source (NPC): FAKE_NPC (invisible/not on a map) [03:19:33][Error]: script:callfunc: function not found! [F_Rand] [03:19:33][Debug]: Source (NPC): FAKE_NPC (invisible/not on a map) Btw, I still use 3ceam svn sorry for not making it clear. Thank you again my friend. the missing function.... function script F_Rand { return getarg(rand(getargcount())); } but not compatible with 3ceam or older ea Quote Link to comment Share on other sites More sharing options...
Question
johnbond
I would like to request an item script for a "box" that would give random items when opened. I shall provide which items it shall randomly give out from the list. Example of items are #2202, #2217, #2231 etc. It will be around 5-10 items.
Is this possible?
Thank you in advance guys!
Link to comment
Share on other sites
19 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.