Jump to content
Sign in to follow this  
Kennelz

Dicing - A simple and beginner way

Recommended Posts

Here is a simple way I have made the concept of the ever popular dicing into a 508 server. This was made in 2 minutes and takes no real effort to add in besides copy and pasting it in. But, its still a neat idea.


Difficulty: */***** (Beginner)
Tested on: Pur3zscape source, but any 508-525 should do, maybe even higher/lower.
Files modified: ItemSelect.java
Procedure: Copy and Paste

Step 1.

Open ItemSelect.java, Find a "break;". Then after that, add this:

[CODE]//dicing

case 2957: // Dice bag item aka druid pouch
int randomDice = Misc.random(100); // random dicing numbers 0-100
for (Player pl : Server.engine.players) { //for all the players in the server...
if (pl != null) { //...who are not nulls.
if (randomDice == 0 || randomDice == 1) { //should the dice numbers given be 0 or 1, impossible sum for two dice.
randomDice = 2; //sets the dice sum to 2 instead.
}
p.requestAnim(422, 0); //the closest to a "roll" emote, its a punch emote, change to something closer if you please.
pl.getActionSender().sendMessage(pl, "[DICER] "+p.username+" has rolled a "+randomDice+" with the dice."); //announces the results.
}
}
break;[/CODE]

So an example line would be like:

[DICER] Kennelz has rolled a 49 with the dice.

Save, compile and run. Edited by Kennelz

Share this post


Link to post
Share on other sites
No. This can be done way better and more full and complete. Dicing isn't handled for all players, it's only handled for those in your clan chat.

Share this post


Link to post
Share on other sites
I didnt make it for that purpose. This is just for those who want a form of dicing in a simple way. Does it work? Yes. Can it be improved? Of course. I am aware that it is for clan chat, but not all of us have or want that.

Share this post


Link to post
Share on other sites
It is a pretty basic and for the very beginners.

Share this post


Link to post
Share on other sites
[quote name='Kennelz']I didnt make it for that purpose. This is just for those who want a form of dicing in a simple way. Does it work? Yes. Can it be improved? Of course. I am aware that it is for clan chat, but not all of us have or want that.[/QUOTE]

Nobody wants a form of dicing in a simple way. If you're going to have dicing, you're going to want a complete system.

Share this post


Link to post
Share on other sites
[quote name='Mofo']Nobody wants a form of dicing in a simple way. If you're going to have dicing, you're going to want a complete system.[/QUOTE]

You have made your point, but I disagree.

Share this post


Link to post
Share on other sites
Could be done in a better way, but it could help many others who just want a simple dice.
doesn't have to be perfect if it works the same way regardless. Thanks for sharing and taking
time to help.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×