Jump to content
Sign in to follow this  
bitmask

[PI] Rare drop announcing

Recommended Posts

I saw rare drops -snippet at r-s done by item ids, decided to help everyone out by doing this by item name, giving you ability to add much effectively rare drop announcements. Code is absolutely horrible but works, wrote this just in 2 minutes in a rush, didn't add this to my server at all but it works for sure. :)

[CODE]

public static final String SUPER_RARES[] = {"armadyl", "bandos", "godsword"};

public static final String RARES[] = {"dragon chainbody", "whip" , "of fury"};[/CODE]

[CODE] public static final void announce(Client c, int id) {
String item = ItemAssistant.getItemName(id).toString();
for (String superRares : SUPER_RARES) {
if (item.toLowerCase().contains(superRares)) {
for (int j = 0; j < PlayerHandler.players.length; j++) {
if (PlayerHandler.players[j] != null) {
Client c2 = (Client) PlayerHandler.players[j];
c2.sendMessage("@[email protected]"+c.playerName+" has received x1 "+item+" as a extreme rare drop!");
}
}
return;
}
}
for (String rares : RARES) {
if (item.toLowerCase().contains(rares)) {
for (int j = 0; j < PlayerHandler.players.length; j++) {
if (PlayerHandler.players[j] != null) {
Client c2 = (Client) PlayerHandler.players[j];
c2.sendMessage("@[email protected]"+c.playerName+" has received x1 "+item+" as a rare drop.");
}
}
}
}
}[/CODE] Edited by FUZENSETH

Share this post


Link to post
Share on other sites
This is what most project insanity clan chats have, the lootshare is different for some reason.

Nice snippet though.

Share this post


Link to post
Share on other sites
I no way is a snippet, dont even say where to put it haha

Share this post


Link to post
Share on other sites
good snip, saved some time.

Share this post


Link to post
Share on other sites
SUPER_RARES[ wasn't identified for me or wasn't a variable i forget

Share this post


Link to post
Share on other sites
[quote name='fallen2dc']SUPER_RARES[ wasn't identified for me or wasn't a variable i forget[/QUOTE]

In the tutorial, it shows that you make this variable. Make it an array, list the item names in this array. There is an example of this in the OP.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×