...Thats what I use lol.Code:Misc.random(100);
|
There you have it, Each time I am to roll the 100 sided dice, I'd always get 100.Code:public void removeDice(Client c, int item) { int[] i = {15098, 15092, 15088, 15086}; for(int l = 0; l < i.length; l++) { if(i[l] == item) { c.getItems().deleteItem(i[l], c.getItems().getItemSlot(i[l]), 1); c.getItems().addItem(15084, 1); c.sendMessage("You put away the dies from the dice bag."); break; } } } public int randomDiceType(Client c, int item) { final int[][] DICE = {{15098, 100},{15086, 10}}; //TODO: Finish the dice random type for(int i = 0; i < DICE.length; i++) { if(item == DICE[i][0]) { return DICE[i][1]; } } return 0; } public void rollDice(Client c, int item, boolean clanRoll) { int randomDice = randomDiceType(c, item); final int[] DICE = { 15098, 15086, 15088, 15092 }; for(int i = 0; i < DICE.length; i++) { if(item == DICE[i]) { if(c.clanId < 0 && clanRoll) { c.sendMessage("You're can't roll a clan roll if you're not in a clan chat!"); return; } if(c.clanId >= 0 && !Server.clanChat.clans[c.clanId].owner.equalsIgnoreCase(c.playerName) && System.currentTimeMillis() - c.diceDelay >= 5000 && clanRoll) { c.sendMessage("Only the owner of the clan has the power to do that."); return; } c.startAnimation(11900); c.gfx0(2075); c.sendMessage("I've rolled a "+ randomDice +" on the amount dice."); c.diceDelay = System.currentTimeMillis(); if(clanRoll) { Server.clanChat.messageToClan("" + c.playerName + " rolled a "+ randomDice +" on the amount dice.", c.clanId); } break;
If you have any ideas, post down here. If you would like to see more, add me via MSN at "[email protected]" so we can discuss this further more.
...Thats what I use lol.Code:Misc.random(100);
Just go to ClickItem.java and put this code in:
Im not sure what the exact coding was for my server, don't have the files on this computer, but I am sure you can figure it out.Code:if (itemId == 15098) { c.forcedChat("ROLLED "+ Misc.random(100)); c.startAnimation(11900); c.gfx0(2075); }
Replace with that:
Then go to the top of the file and add this with the other imports:Code:public void removeDice(Client c, int item) { int[] i = {15098, 15092, 15088, 15086}; for(int l = 0; l < i.length; l++) { if(i[l] == item) { c.getItems().deleteItem(i[l], c.getItems().getItemSlot(i[l]), 1); c.getItems().addItem(15084, 1); c.sendMessage("You put away the dies from the dice bag."); break; } } } public int randomDiceType(Client c, int item) { final int[][] DICE = {{15098, 100},{15086, 10}}; //TODO: Finish the dice random type for(int i = 0; i < DICE.length; i++) { if(item == DICE[i][0]) { return DICE[i][1]; } } return 0; } public void rollDice(Client c, int item, boolean clanRoll) { int randomDice = Misc.random(100); final int[] DICE = { 15098, 15086, 15088, 15092 }; for(int i = 0; i < DICE.length; i++) { if(item == DICE[i]) { if(c.clanId < 0 && clanRoll) { c.sendMessage("You're can't roll a clan roll if you're not in a clan chat!"); return; } if(c.clanId >= 0 && !Server.clanChat.clans[c.clanId].owner.equalsIgnoreCase(c.playerName) && System.currentTimeMillis() - c.diceDelay >= 5000 && clanRoll) { c.sendMessage("Only the owner of the clan has the power to do that."); return; } c.startAnimation(11900); c.gfx0(2075); c.sendMessage("I've rolled a "+ randomDice +" on the amount dice."); c.diceDelay = System.currentTimeMillis(); if(clanRoll) { Server.clanChat.messageToClan("" + c.playerName + " rolled a "+ randomDice +" on the amount dice.", c.clanId); } break;
Code:import server.util.Misc;
src\server\model\players\packets\ClickItem.java:38 : cannot find symbol
symbol : variable Misc
location: class server.model.players.packets.ClickItem
c.forcedChat("ROLLED "+ Misc.random(100));
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Press any key to continue . . .
Do you have teamviewer O_O? I can't seem to get my "ClanChat Dice" to work after I imported the ClanChatHandler.java
Or...Possibly make it where I scream the lliving shit out myself those numbers.
EDIT: NEVERMIND. THANKS GRYLLS, And your TV shows are fucking amazing.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |