Jump to content
  • 0

Boxes


sokarpupe

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  07/06/17
  • Last Seen:  


Hi, I need to create my own boxes, for example, "old blue box", any guide ?. Thank you.
Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  12/16/17
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  07/06/17
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  12/16/17
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  625
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  07/06/17
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

3 hours ago, sokarpupe said:

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

 

On 4/17/2018 at 4:20 AM, Stolao said:

i posted in my 1st post....

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  07/06/17
  • Last Seen:  

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 :(

 

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  07/06/17
  • Last Seen:  

 

Stolao, excuse me, any solution?

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  07/06/17
  • Last Seen:  

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...