L2Henna template = HennaTable.getInstance().getTemplate(_symbolId);
if(template == null)
return;
L2HennaInstance temp = new L2HennaInstance(template);
int _count = 0;
/* Prevents henna drawing exploit:
1) talk to L2SymbolMakerInstance
2) RequestHennaList
3) Don't close the window and go to a GrandMaster and change your subclass
4) Get SymbolMaker range again and press draw
You could draw any kind of henna just having the required subclass...
*/
boolean cheater = true;
for(L2HennaInstance h : HennaTreeTable.getInstance().getAvailableHenna(activeChar.getClassId()))
{
if(h.getSymbolId() == temp.getSymbolId())
{
cheater = false;
break;
}
}
if(activeChar.getInventory()!=null && activeChar.getInventory().getItemByItemId(temp.getItemIdDye())!=null){
_count = activeChar.getInventory().getItemByItemId(temp.getItemIdDye()).getCount();
}
if(!cheater && _count >= temp.getAmountDyeRequire() && activeChar.getAdena() >= temp.getPrice() && activeChar.addHenna(temp))
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_DISAPPEARED);
sm.addNumber(temp.getItemIdDye());
activeChar.sendPacket(sm);
sm = null;
activeChar.sendPacket(new SystemMessage(SystemMessageId.SYMBOL_ADDED));
//HennaInfo hi = new HennaInfo(temp,activeChar);
//activeChar.sendPacket(hi);
activeChar.getInventory().reduceAdena("Henna", temp.getPrice(), activeChar, activeChar.getLastFolkNPC());
L2ItemInstance dyeToUpdate = activeChar.getInventory().destroyItemByItemId("Henna", temp.getItemIdDye(), temp.getAmountDyeRequire(), activeChar, activeChar.getLastFolkNPC());
//update inventory
InventoryUpdate iu = new InventoryUpdate();
iu.addModifiedItem(activeChar.getInventory().getAdenaInstance());
iu.addModifiedItem(dyeToUpdate);