Jump to content
  • 0

Add custom box


sran

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

Hello community, I was reading guides on how to add custom box and says that you have to modify this line in this file, what happens is that I do not see it and there is said line.
I do not know if it is now modified in another file, someone could help me.

//The max. item group count (increase this when needed).
#define MAX_ITEMGROUP 55

itemdb.h

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

since you are confused, use  this method

501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "CustomBox"; },{},{}
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;
}

change your item id, and give it any box sprite in your iteminfo

and change items that box gives here

.BoxItems[0],501,502,503;

,

Edited by Cyro
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

 

Then I add it as a custom item? I do not add it to db / const.txt?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

if you use this script, u need not to modify anything else 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

 

Thank you Lord for helping me in this, I throw the following errors When entering the RO did not open the box, only appeared the box but never opened, I leave as I have everything, and if you could the script of all items not random please.

Item_ DB

45000,Angelus_Box,Angelus_Box,2,10000,,200,,,,,0xFFFFFFFF,7,2,,,,,4000,{},{},{}

12214,Convex_Mirror,Convex Mirror,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_BOSSMAPINFO,600000,0; },{callfunc "Angelus_Box" ;},{}

12103,Bloody_Dead_Branch,Bloody Branch,2,10000,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ monster "this",-1,-1,"--ja--",-3,1,""; },{callfunc "Angelus_Box";},{}

 

errobox.jpg

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

43 minutes ago, sran said:

 

Thank you Lord for helping me in this, I throw the following errors When entering the RO did not open the box, only appeared the box but never opened, I leave as I have everything, and if you could the script of all items not random please.

Item_ DB

45000,Angelus_Box,Angelus_Box,2,10000,,200,,,,,0xFFFFFFFF,7,2,,,,,4000,{},{},{}

12214,Convex_Mirror,Convex Mirror,2,2,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_BOSSMAPINFO,600000,0; },{callfunc "Angelus_Box" ;},{}

12103,Bloody_Dead_Branch,Bloody Branch,2,10000,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ monster "this",-1,-1,"--ja--",-3,1,""; },{callfunc "Angelus_Box";},{}

 

errobox.jpg

the script already set to random, can u post your script?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

 

I'll leave it to you then

angelus.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

function	script	Angelus	{
setarray .BoxItems [ 0 ],12103,2214;	

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;
}

try this (didnt tested)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   0
  • Joined:  11/19/12
  • Last Seen:  

Now I'm getting this error

errorbox2.jpg

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   0
  • Joined:  03/04/20
  • Last Seen:  

how to make the items with quantity?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.03
  • Content Count:  55
  • Reputation:   0
  • Joined:  05/30/22
  • Last Seen:  

On 4/27/2017 at 6:05 PM, Cyro said:

since you are confused, use  this method

501,Red_Potion,Red Potion,0,50,,70,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc "CustomBox"; },{},{}
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;
}

change your item id, and give it any box sprite in your iteminfo

and change items that box gives here

.BoxItems[0],501,502,503;

Good day. i dont understand the part where to change iteminfo and item id. please reply. Thanks

 

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...