Jump to content
  • 0

How to make a customized box like obb?


simplemhan

Question


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  308
  • Reputation:   3
  • Joined:  12/18/11
  • Last Seen:  

Thanks for helping me.

Edited by simplemhan
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

..

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


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

@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


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  222
  • Reputation:   35
  • Joined:  12/13/11
  • Last Seen:  


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


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  231
  • Reputation:   9
  • Joined:  12/16/11
  • Last Seen:  

@Pneuma Can you put a guide on how to create a custom box?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  222
  • Reputation:   35
  • Joined:  12/13/11
  • Last Seen:  

we should put that guide here since eA = dead in the water.

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