Jump to content
  • 0

Prize Box


WhatFT

Question


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

I don't know how to get a DB Script on this kind of Prize Box..

What is the DB SCRIPT for this one?

Thinking that the Item/Prize Box contains

-Chance to get Random Items

-The same as the Old Blue/Purple Boxes.

-Will not replace or Will replace OBB & OPB.

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   140
  • Joined:  01/04/12
  • Last Seen:  

There's quite a few ways to do it, if you really want to obtain a random item, use this script. It's a simple function.

function    script    PrizeBox    {
   setarray .PrizeBoxItems[0],5013,6414,5142,4124,5123;

   set .Random, getarraysize( .BoxItems );
   getitem .PrizeBoxItems[ rand( .Random ) ];
   end;
}

On this line you set the items you want the box to randomly give out:

   setarray .PrizeBoxItems[0],5013,6414,5142,4124,5123;

Now you simply add this as your item script.

20000,Prize_Box,Prize Box,0,150,,80,,,,,0xFFFFFFFF,31,2,,,,,,{ callfunc "PrizeBox"; },{},{}

Link to comment
Share on other sites


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

try this

http://upaste.me/index.php?show=17976

aw...Flaid is a minute faster than me..>.<

Edited by Emistry
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

XD Which one will I better to use?

@Emistry What will I put in the [ .Random ] ?

Edited by Paulinds
Link to comment
Share on other sites


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

you can also try this

item_db2 script

25500,Custom_Box,Custom Box,2,10000,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ getitem groupranditem(IG_whatever),1; },{},{}

const.txt:

IG_whatever<TAB>55

Find IG_Advanced_Weapons_Box 61, check the last number and name for the last IG_ and add the following below that

IG_whatever 62 (Depending on the last ID in there of course AND make sure to tab after IG_whatever, NOT space)

item_group_db.txt:

import: db/item_whatever.txt

item_whatever.txt:

62,<Item ID>,<Rate>

62,<Item ID>,<Rate>

62,<Item ID>,<Rate>

62,<Item ID>,<Rate>

// As many as you want

item_whatever.txt

// Structure of Database:

// GroupID,ItemID,Rate

62,ID,1 //The Group ID you must set in your db/const.txt

62,5013,1 //Lord Kaho's Horn

itemdb.h

#define MAX_ITEMGROUP #62 - change this to your IG_whatever# and add plus 1

means

#define MAX_ITEMGROUP #63 for my example.

Edited by simplemhan
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   140
  • Joined:  01/04/12
  • Last Seen:  

XD Which one will I better to use?

It doesn't matter, they are the same, almost scripted the same even.

Link to comment
Share on other sites


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

XD Which one will I better to use?

It doesn't matter, they are the same, almost scripted the same even.

well...both are origin of my script...O.O

anyway...

the 1 post by Flaid just can get 1 item..

the below 1 i post...

you can set how many items can be get in 1 box..

and every single items that you can get in the box have it's own quantity...

anyway...choose at your own...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   140
  • Joined:  01/04/12
  • Last Seen:  

Your script? How can it be your script if I was the first to post here D:

Link to comment
Share on other sites


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

mine is the same script in old blue box, ect.

Link to comment
Share on other sites


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

well..whatever...i dont wannt argu on this stuff...so just let it be...perhap my misunderstanding...

@TS..

there is nothing you have to change in the script part..

all you have to do is just edit the

setarray part for the item listing / amount

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  142
  • Topics Per Day:  0.03
  • Content Count:  511
  • Reputation:   7
  • Joined:  02/15/12
  • Last Seen:  

THANKS FOR SHARING EVERYONE !! Appreciate it :)

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