I'm working on a lootshare system (i'm using a very noobish version at the moment because clan chat ain't added to my server yet and it ain't open for public)
first the monster dropped all the items it was able to...
i fixed that
then the monster dropped almost normally... (dropped only when the counter was below or equal to the drop rate, and it gave the drop to a random clan member)
but it dropped 2 of the items instead of 1
i fixed that too
now to the problem i'm asking for help to
fixing the above caused the drop system to give the drop to nobody if you're on lootshare
so it takes 30 secs for the drop to appear
here's my MonsterDropItems() void
Code:
public void MonsterDropItems(int NPCID, NPC npc) {
try {
int totalDrops = dropCount[NPCID] / 3;
client p = (client) server.playerHandler.players[npc
.getKiller()];//
if (totalDrops > 0) {
// Random roller = new Random();
for (int i = 0; i < dropCount[NPCID]; i += 3) {
double roll = Math.random() * 10000;
if (p != null) {
if (p.debug)
p.sM("Roll: " + roll + ", Itemid: "
+ drops[NPCID][i] + ", amt: "
+ drops[NPCID][i + 1] + ", percent: "
+ drops[NPCID][i + 2]);
}
if(p.playerEquipment[p.playerRing] != 2572 && p.lootshare == false){
if (roll <= drops[NPCID][i + 2]) {
if (p != null) {
if (p.debug)
p.sM("Rewarding " + drops[NPCID][i]);
}
}
if ((drops[NPCID] != null) && (npc != null))
ItemHandler.addItem((int) drops[NPCID][i],
npc.absX, npc.absY,
(int) drops[NPCID][i + 1], npc.getKiller(),
false);
}
if( p.lootshare == true){
if (roll <= drops[NPCID][i + 2]) {
if (p != null) {
if (p.debug)
p.sM("Rewarding " + drops[NPCID][i]);
}
if ((drops[NPCID] != null) && (npc != null)){
ItemHandler.addItem((int) drops[NPCID][i],
npc.absX, npc.absY,
(int) drops[NPCID][i + 1], p.randomclanmember(),
false);
}}
if(p.playerEquipment[p.playerRing] == 2572 && p.lootshare == false){
if (roll/1.10 <= drops[NPCID][i + 2]) {
if (p != null) {
if (p.debug)
p.sM("Rewarding " + drops[NPCID][i]);
}
if ((drops[NPCID] != null) && (npc != null))
ItemHandler.addItem((int) drops[NPCID][i],
npc.absX, npc.absY,
(int) drops[NPCID][i + 1], npc.getKiller(),
false);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
can anyone locate the problem?