Now i will briefly explain some of it.
MAIN CODE
Code:
if (itemId == 6199) { //Mystery Box
int random[][] = {
{995, 10000000}, {13734, 1}, {15599, 1}
};
int rand = Utils.random(random.length);
player.getInventory().addItem(random[rand][0],
random[rand][1]);
player.getInventory().deleteItem(6199, 1);
This tells the file that if the items Id is 6199 to give the player one of the random items that are declared. then to delete that item.
EMOTES
Code:
player.setNextAnimation(new Animation(2414));
player.setNextGraphics(new Graphics(1537));
That chunk of code is the Emote that it performs after it has been opened.
Which currently is the Air Guitar. With the animation being the movement of the player, and the graphics being the notes.
DIALOGUE
Code:
player.getPackets().sendGameMessage("You've recieved an item from the Mystery Box!");
This line of text instructs the dialogue to say "You've recieved an item from the Mystery Box!"