Update Scrolls (#191)

* Fix local Parabot instructions

* Add kick command, and force logout function

* Update scroll handling
This commit is contained in:
Danial
2019-11-18 09:33:10 +13:00
committed by Daniel Ginovker
parent 92c5ac1f7e
commit 4a2358945c
@@ -927,18 +927,25 @@ public class NpcHandler {
}
break;
}
if (Misc.random(1, 256) == 1) {
int level = getNpcListCombat(npcs[i].npcType);
if (level >= 2 && level <= 24) // easy
Server.itemHandler.createGroundItem(c, 2677, npcs[i].absX, npcs[i].absY, 1, c.playerId);
int level = getNpcListCombat(npcs[i].npcType);
// higher level monsters have a better drop rate (max of 1/128)
int chance = Math.max(128, 512 - (level * 2));
if (Misc.random(1, chance) == 1) {
int scroll = -1;
if (level <= 1) // none
scroll = -1;
else if (level <= 24) // easy
scroll = 2677;
else if (level <= 40) // easy → medium
Server.itemHandler.createGroundItem(c, 2677 + Misc.random(0, 1), npcs[i].absX, npcs[i].absY, 1, c.playerId);
scroll = 2677 + Misc.random(0, 1);
else if (level <= 80) // medium
Server.itemHandler.createGroundItem(c, 2678, npcs[i].absX, npcs[i].absY, 1, c.playerId);
scroll = 2678;
else if (level <= 150) // medium → hard
Server.itemHandler.createGroundItem(c, 2678 + Misc.random(0, 1), npcs[i].absX, npcs[i].absY, 1, c.playerId);
scroll = 2678 + Misc.random(0, 1);
else if (level > 150)// hard
Server.itemHandler.createGroundItem(c, 2679, npcs[i].absX, npcs[i].absY, 1, c.playerId);
scroll = 2679;
if (scroll >= 0)
Server.itemHandler.createGroundItem(c, scroll, npcs[i].absX, npcs[i].absY, 1, c.playerId);
}
}
}