Minor Npc class cleanup.

This commit is contained in:
MobiusDevelopment
2022-01-06 23:21:40 +00:00
parent ff4e454f7c
commit 2d2dfa224c
25 changed files with 169 additions and 254 deletions

View File

@@ -1581,10 +1581,6 @@ public class Npc extends Creature
Item item = null;
for (int i = 0; i < itemCount; i++)
{
// Randomize drop position.
final int newX = (getX() + Rnd.get((RANDOM_ITEM_DROP_LIMIT * 2) + 1)) - RANDOM_ITEM_DROP_LIMIT;
final int newY = (getY() + Rnd.get((RANDOM_ITEM_DROP_LIMIT * 2) + 1)) - RANDOM_ITEM_DROP_LIMIT;
final int newZ = getZ() + 20;
if (ItemTable.getInstance().getTemplate(itemId) == null)
{
LOGGER.severe("Item doesn't exist so cannot be dropped. Item ID: " + itemId + " Quest: " + getName());
@@ -1602,6 +1598,11 @@ public class Npc extends Creature
item.getDropProtection().protect(creature);
}
// Randomize drop position.
final int newX = (getX() + Rnd.get((RANDOM_ITEM_DROP_LIMIT * 2) + 1)) - RANDOM_ITEM_DROP_LIMIT;
final int newY = (getY() + Rnd.get((RANDOM_ITEM_DROP_LIMIT * 2) + 1)) - RANDOM_ITEM_DROP_LIMIT;
final int newZ = getZ() + 20;
item.dropMe(this, newX, newY, newZ);
// Add drop to auto destroy item task.