Jump to content

Question

Posted

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.

10 answers to this question

Recommended Posts

Posted

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"; },{},{}

Posted (edited)

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
Posted

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

Posted

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

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