Jump to content
Sign in to follow this  
Fuzenseth

Global Charm Drops

Recommended Posts

Proper globabl charms for matrix, also add content to the arrays yourself cbf letting you off that easy.

*Invalid NPCs added (NPC that doesn't drop charms)
*Boss NPC's gives extra charms
*Easy to configure
* Added Player param so if your server loads 803+ it would be easy to add the charms go straight to inventory. (Sadly I got a 742/742 convert.)

[CODE]package com.rs.game.npc;

import com.rs.game.World;
import com.rs.game.WorldTile;
import com.rs.game.item.Item;
import com.rs.game.player.Player;
import com.rs.utils.Utils;

/**
*
* @author FUZENSETH
* [MENTION=98951]infor[/MENTION]amtion Global NPC Charm drops.
* [MENTION=3199]Sin[/MENTION]ce 22.10.2014
*/
public class GlobalCharms {

/** Maxinum amount of charms that boss can drop. */
public static final int MAX_BOSS_CHARMS = 15;

/** Maxinum amount of charms that a NON-boss NPC can drop. */
public static final int MAX_CHARM_AMOUNT = 7;

/** Integer array, holding the charm item ids. */
public static final int[] CHARMS = { 12158, 12163, 12159, 12160 };

/** Holds the names of NPC's that cannot drop charms. */
public static final String[] INVALID_NPCS = { "none yet" };

/** Boss npc names which drops a little more charms than basic npcs. */
public static final String[] BOSS_NPCS = { "graardor", "tormented demon" };

/** Processes global charm drops. */
public static final void excecute(Player killer, NPC npc) {
for (String invalidNPC : INVALID_NPCS)
if (npc.getName().toLowerCase().contains(invalidNPC))
return;
for (String bossNPC : BOSS_NPCS)
if (npc.getName().toLowerCase().contains(bossNPC)) {
World.addGroundItem(
new Item(CHARMS[Utils.getRandom(CHARMS.length - 1)],
Utils.getRandom(MAX_BOSS_CHARMS)),
new WorldTile(npc.getX(), npc.getY(), npc.getPlane()));
} else {
World.addGroundItem(
new Item(CHARMS[Utils.getRandom(CHARMS.length - 1)],
Utils.getRandom(MAX_CHARM_AMOUNT)),
new WorldTile(npc.getX(), npc.getY(), npc.getPlane()));
}
}

}
[/CODE]

Share this post


Link to post
Share on other sites
After adding this i didnt get any charm drops anymore, help please

Share this post


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

×