Sebo
July 20th, 2010, 03:40
Hello everybody.
This is the first thing i'm ever releasing on this forum, so I hope I can get *some* positive comments back on this. So, no anti-leech on this.
This can be used in any sauce if you just modify a few things. So don't ask me to rewrite it for your shitty bulby shit.
First off, create a new class and name it "NPCDrops" in the palidino76.rs2.npcs.combat package.
Second, add this stuff in there:
package palidino76.rs2.npcs.combat;
import palidino76.rs2.Engine;
import palidino76.rs2.npcs.NPC;
import palidino76.rs2.players.Player;
import palidino76.rs2.util.Misc;
public class NPCDrops {
public static void doDrop(Player pa, NPC n) {
switch (n.npcType) {
case 1: // Man
if (Misc.random(3) == 1)
Engine.items.createGroundItem(995, 20 + Misc.random(1200), n.absX, n.absY, n.heightLevel, pa.username);
Engine.items.createGroundItem(526, 1, n.absX, n.absY, n.heightLevel, pa.username); //Bones
break;
}
}
}
Now, save and close that mofo up.
Now, open up your NPCPlayerCombat class, and scroll all the way down until you see:
if (n.isDead)
{
n.attackingPlayer = false;
after that, add this:
n.dropItemsOnDeath(p, n);
Save that file, and I think you are good to go! I might have missed something though, not sure.
To add a new NPC to drop shit, go to the NPCDrop class, and add:
case NPCIDHERE:
// if you want the random drop chance add this, and change the
// "2" to a higher number if you want the drop to be rarer.
// if (Misc.random(2) == 1) {
// The dropped item here
// }
break;
enjoy.
This is the first thing i'm ever releasing on this forum, so I hope I can get *some* positive comments back on this. So, no anti-leech on this.
This can be used in any sauce if you just modify a few things. So don't ask me to rewrite it for your shitty bulby shit.
First off, create a new class and name it "NPCDrops" in the palidino76.rs2.npcs.combat package.
Second, add this stuff in there:
package palidino76.rs2.npcs.combat;
import palidino76.rs2.Engine;
import palidino76.rs2.npcs.NPC;
import palidino76.rs2.players.Player;
import palidino76.rs2.util.Misc;
public class NPCDrops {
public static void doDrop(Player pa, NPC n) {
switch (n.npcType) {
case 1: // Man
if (Misc.random(3) == 1)
Engine.items.createGroundItem(995, 20 + Misc.random(1200), n.absX, n.absY, n.heightLevel, pa.username);
Engine.items.createGroundItem(526, 1, n.absX, n.absY, n.heightLevel, pa.username); //Bones
break;
}
}
}
Now, save and close that mofo up.
Now, open up your NPCPlayerCombat class, and scroll all the way down until you see:
if (n.isDead)
{
n.attackingPlayer = false;
after that, add this:
n.dropItemsOnDeath(p, n);
Save that file, and I think you are good to go! I might have missed something though, not sure.
To add a new NPC to drop shit, go to the NPCDrop class, and add:
case NPCIDHERE:
// if you want the random drop chance add this, and change the
// "2" to a higher number if you want the drop to be rarer.
// if (Misc.random(2) == 1) {
// The dropped item here
// }
break;
enjoy.