• 0
Sign in to follow this  
sokarpupe

Boxes

Question

Hi, I need to create my own boxes, for example, "old blue box", any guide ?. Thank you.

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0
Posted (edited)

I use this procedure
item_db.txt // I create the item box
33000, Renewal_Box, Renewal Box, 18.10,, 10 ,,,,, 0xFFFFFFFF, 63.2 ,,,,,, {getgroupitem (IG_RNBOX); }, {}, {}


then in item_group_db.txt
I enter the items that can come out
// ID_BOX,ITEM_ID,RATE_ITEM_Drop, Amount <---- If I'm wrong, this is the procedure
  IG_RNBOX, 607,5,3 // Yggdrasil Berry
  IG_RNBOX, 7517.3 // Gold Coin
  IG_RNBOX, 12522.4 // Blessing Scroll

 

try also to take a look on the forum item_group_db surely there will be some tutorials

Edited by Shinto

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

I see guides, but it's so obsolete :( 

first entry in the item_db 

  • 21031,Caja_1,Caja de Nivel,2,0,,0,,,,,0xFFFFFFFF,63,2,,,70,,2000,{ getrandgroupitem(IG_LVLBOX,1); },{},{}

then entry in rA/src/map/script_constants.hpp

  • export_constant(IG_LVLBOX);

then i modify in rA/src/map/itemdb.hpp

  • #define MAX_ITEMGROUP_RANDGROUP 4 

to

  • #define MAX_ITEMGROUP_RANDGROUP 5

 

then in rA/db/re  i create this item_lvlbox.txt

// LVLBOX Obtainable Items Database
//
// Structure of Database:
// GroupID,ItemID,Rate

// LVLBOX
IG_LVLBOX,501,1    // Red Potion
IG_LVLBOX,502,1    // Orange Potion
IG_LVLBOX,503,1    // Yellow Potion
IG_LVLBOX,504,1    // White Potion

 

and i recompile my svr whit ./configure, and it did not work :S

I know i forget something, but i do not know what it is, help :( 

Edited by sokarpupe

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

in the past I also used that guide without having results ... try to do so:

first entry in the item_db 

  • 21031,Caja_1,Caja de Nivel,2,0,,0,,,,,0xFFFFFFFF,63,2,,,70,,2000,{ getgroupitem(IG_LVLBOX); },{},{}
  • ( use getgroupitem instead of getrandgroupitem )

there is no need to modify script_costants.hpp and itemdb.hpp

then for second open item_group_db.txt
and enter

  • // GroupID,ItemID,Rate
  • // LVLBOX

IG_LVLBOX,501,1    // Red Potion

IG_LVLBOX,502,1    // Orange Potion

IG_LVLBOX,503,1    // Yellow Potion

IG_LVLBOX,504,1    // White Potion

 

I tried it with an item box that I created and it works .... I hope I helped you

Edited by Shinto

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

use my function its much easier

 

21031,Caja_1,Caja de Nivel,2,0,,0,,,,,0xFFFFFFFF,63,2,,,70,,2000,{ callfunc "F_RandWeight",501,1,502,1503,1,504,1; },{},{}

the chance will be item weight/total weight, in the above example each potion has a 1 weight with 4 total items meaning 1/4 chance

Edited by Stolao

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

Btw if you make your custom boxes before editing the itemdb.hpp, use the db/const.txt.

You just have to look up the latest of box identifier in the itemdb.hpp count the lines, and use the next free value as identifier. 

2nd option would be an custom function to generate the items. With their respective chances. That's an option if you don't want to do the part above, and much easier to edit in my opinion but you need to script the chances of course.

Regards,

Chris

Edited by llchrisll

Share this post


Link to post
Share on other sites
  • 0

STOLAO, where entry your scrit? in rA/db/re??? or is npc custom script?

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, Stolao said:

 

i posted in my 1st post....

thx, I use your scrip, but ... it did not work, I don't know which direction to enter the script in my rA emulator, i entry this in rA/npc/custom and, use the line item

.

21031,Caja_1,Caja de Nivel,2,0,,0,,,,,0xFFFFFFFF,63,2,,,70,,2000,{ callfunc "F_RandWeight",501,1,502,1503,1,504,1; },{},{}

and it did not work :(

 

Share this post


Link to post
Share on other sites
  • 0
8 hours ago, sokarpupe said:

thx, I use your scrip, but ... it did not work, I don't know which direction to enter the script in my rA emulator, i entry this in rA/npc/custom and, use the line item

.

21031,Caja_1,Caja de Nivel,2,0,,0,,,,,0xFFFFFFFF,63,2,,,70,,2000,{ callfunc "F_RandWeight",501,1,502,1503,1,504,1; },{},{}

and it did not work :(

 

Ok I haven't updated/tested the script in a while let me check once I get home assuming someone else doesn't show a fix before then

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, sokarpupe said:

 

Stolao, excuse me, any solution?

21031,Caja_1,Caja de Nivel,2,0,,0,,,,,0xFFFFFFFF,63,2,,,70,,2000,{ callfunc("F_RandWeight",501,1,502,1,503,1,504,1); },{},{

it was missing a comma in the other one, creating inf loop, fixed
this works fine just tested

 

Share this post


Link to post
Share on other sites
  • 0

thx Stolao for your script and suport, i thought you scrip was wrong, but no, the line was wrong xD

i use

11 hours ago, Stolao said:

 

but this line also wrong.

when i thought and see the problem and change some things, and finalliy, this line works

21031,Caja_1,Caja de Nivel,2,0,,0,,,,,0xFFFFFFFF,63,2,,,70,,2000,{callfunc ("F_RandWeight",501,1,502,1,503,1,504,1); },{},{}

 

Thanks to everyone who commented and tried to solve my question, Thx Stolao :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this