|
|
@ -166,50 +166,6 @@ public final class MobLoot extends Item { |
|
|
|
return item; |
|
|
|
return item; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public synchronized Item promoteToItemForNPC(NPC looter) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (looter == null) |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isDeleted) |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.getItemBase().getType().equals(ItemType.GOLD)) |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Item item = this; |
|
|
|
|
|
|
|
item.setOwner(looter); |
|
|
|
|
|
|
|
item.containerType = Enum.ItemContainerType.INVENTORY; |
|
|
|
|
|
|
|
item.setIsID(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.getNumOfItems() > 1) |
|
|
|
|
|
|
|
item.setNumOfItems(this.getNumOfItems()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
item = DbManager.ItemQueries.PERSIST(item); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error(e); |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
item.containerType = Enum.ItemContainerType.INVENTORY; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for (String effectName : this.effectNames)
|
|
|
|
|
|
|
|
// item.addPermanentEnchantment(effectName, 0);
|
|
|
|
|
|
|
|
//transfer enchantments to item
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
for (String enchant : this.getEffectNames()) { |
|
|
|
|
|
|
|
item.addPermanentEnchantment(enchant, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
Logger.error(e.getMessage()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbManager.NPCQueries.REMOVE_FROM_PRODUCTION_LIST(this.getObjectUUID(), looter.getObjectUUID()); |
|
|
|
|
|
|
|
looter.removeItemFromForge(this); |
|
|
|
|
|
|
|
this.junk(); |
|
|
|
|
|
|
|
return item; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public synchronized void recycle(NPC vendor) { |
|
|
|
public synchronized void recycle(NPC vendor) { |
|
|
|
|
|
|
|
|
|
|
|
//remove from production list for npc in db
|
|
|
|
//remove from production list for npc in db
|
|
|
|