Jump to content
  • 0
simplemhan

How to make a customized box like obb?

Question

7 answers to this question

Recommended Posts

..

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

edit item list here

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

Re-Edit : Fixed Announcement Problems

Edited by Emistry
Link to comment
Share on other sites

@Emistry How about putting a percentage in a specific item?

Example; 501 // Which is Red Potion (0.01%) 502 (0.20%)

Edited by Cuspid
Link to comment
Share on other sites

function script CustomBox {
setarray .BoxItems[0],501,502,503,504;


set .rand, rand(100);

if (.rand <= 5){
getitem .BoxItems[0],1;}
if (.rand <= 10 && .rand > 5){
getitem .BoxItems[1],1;}
if (.rand <= 25 && .rand > 10){
getitem .BoxItems[2],1;}
if (.rand > 25){
getitem .BoxItems[3],1;}
end;
}

Edit the if blocks to your liking

Link to comment
Share on other sites

Why not just make a new box? Its not that hard :/ I have made 3 custom boxes that do not use this method

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.