Jump to content
  • 0

How to make a customized box like obb?


Question

7 answers to this question

Recommended Posts

Posted (edited)

..

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
Posted


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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...