-
Posts
479 -
Joined
-
Last visited
-
Days Won
13
Content Type
Profiles
Forums
Blogs
Top List
Everything posted by Mathy
-
Welcome and of course it will become bigger than Rune Server
-
Hahahaha I ain't doing that for free haha I saw that, although you never told me the problems you have .-.
-
Welcome dude and gl with your dog, seems so nice
- 9 replies
-
- runeleakers
- hello
-
(and 2 more)
Tagged with:
-
Hey Harry welcome to the community & hope you'll have some fun
-
Thanks Ace and like Booty said, great source to start
-
Particles would be awesome Although it looks so good
-
Welcome buddy Hope you find it wayyy better than Rune-Server
-
Welcome, if you ever need help feel free to PM me
-
I am willing to help you on your server over Skype like I did today but as Booty said, take some classes or just understand what the coding means and understand the errors you might get. That's how I learnt Java with few online classes
-
Yeah basically just take what I just posted and change the rewards
-
Haha what an intro, anyways welcome and enjoy this awesome community
-
I think he's talking about the fact that everyone has to introduce themselves to post / see other people's posts. Anyways, welcome and enjoy your stay
-
Make a new java file named MysteryBox.java and add all this in it: And put that file in server>Model>Players>Content package server.model.players.Content; import server.model.players.Client; import server.util.Misc; import server.model.players.PlayerHandler; import server.Server; /* Author : Mathy */ public class MysteryBox { public static int mysteryBoxID = 6199;//Just incase I want a different box id. public static boolean deleteBox = true;//Use this for reward testing. //Using arrays for item, and amount. private static int[][] commonRewards = { {4067, 1},// {990, 10},// {1053, 1},// {1055, 1},// {1057, 1},// }; private static int[][] uncommonRewards = { {4067, 1},// {16425, 1},// {14484, 1},// {12236, 1},// {12233, 1},// {12237, 1},// {12235, 1},// {12234, 1},// {12238, 1},// {12239, 1},// {11638, 1},// }; private static int[][] rareRewards = { {20089, 1},// {12230, 1},// {12231, 1},// {12225, 1},// {12227, 1},// {12229, 1},// {12232, 1},// {12228, 1},// {20088, 1},// {20093, 1},// {6199, 1},// }; private static int[][] veryRareRewards = { {990, 10},// {15017, 1},// }; private static int[][] UltraRareRewards = { {962, 1},// }; public static void openBox(Client c){ ///This part was just guesstimated, seeing as common would be used more, it has the highest chance of showing. int randomReward = Misc.random(100);//Picking the random number int itemToGive = 0, amountToGive = 0, rewardRoll; if(randomReward >= 0 && randomReward <= 60){//For all common items.. rewardRoll = Misc.random(commonRewards.length-1); itemToGive = commonRewards[rewardRoll][0]; amountToGive = commonRewards[rewardRoll][1]; }else if(randomReward >= 61 && randomReward <= 80){//Uncommon items. rewardRoll = Misc.random(uncommonRewards.length-1); itemToGive = uncommonRewards[rewardRoll][0]; amountToGive = uncommonRewards[rewardRoll][1]; }else if(randomReward >= 81 && randomReward <= 95){//Rare items rewardRoll = Misc.random(rareRewards.length-1); itemToGive = rareRewards[rewardRoll][0]; amountToGive = rareRewards[rewardRoll][1]; }else if(randomReward >= 96 && randomReward <= 99){//Very Rare items rewardRoll = Misc.random(veryRareRewards.length-1); itemToGive = veryRareRewards[rewardRoll][0]; amountToGive = veryRareRewards[rewardRoll][1]; }else if(randomReward >= 100){//Very Rare items rewardRoll = Misc.random(UltraRareRewards.length-1); itemToGive = UltraRareRewards[rewardRoll][0]; amountToGive = UltraRareRewards[rewardRoll][1]; for (int z = 0; z < Server.playerHandler.players.length; z++) { if (Server.playerHandler.players[z] != null) { Client o = (Client) Server.playerHandler.players[z]; o.sendMessage("<col=29184>["+Misc.optimizeText(c.playerName)+"]</col> <col=800000000>has just received a christmas cracker from mystery box!"); } } } if(deleteBox)//Removing the box c.getItems().deleteItem(mysteryBoxID, 1); c.getItems().addItem(itemToGive, amountToGive);//Adding reward if(itemToGive == 0) c.sendMessage("You open the box to find nothing. What bad luck.");//If you got 0, it says you find nothing. else c.sendMessage("You open the box and find " + (amountToGive > 1 ? "some " : "a ") + c.getItems().getItemName(itemToGive) + ".");//If more than one item, use some, otherwise use a. } } Somewhere in ClickItem.java add this: if (itemId == 6199) { MysteryBox.openBox(c); } If you get any errors, comment them, I should answer in the following minutes OT: I know Dan is using a custom server and the reward are custom items, so just change the rewards to match your items to your liking
-
Thanks, will definitely use, got a bunch of models to make / convert
-
Welcome, hope we can make you learn some more
-
Nice intro haha i r8 8/8 m8
-
Haha welcome man and happy leaking
-
Yeah I don't think/hope anyone uses this, just to get some ideas and rip some stuff
- 140 replies
-
- nightmare-scape
- release
-
(and 1 more)
Tagged with:
-
Done, sorry
- 140 replies
-
- nightmare-scape
- release
-
(and 1 more)
Tagged with: