|
@@ -55,36 +55,47 @@ public final class RequestHennaEquip extends L2GameClientPacket
|
|
|
L2PcInstance activeChar = getClient().getActiveChar();
|
|
|
|
|
|
if (activeChar == null)
|
|
|
- return;
|
|
|
+ return;
|
|
|
|
|
|
L2Henna template = HennaTable.getInstance().getTemplate(_symbolId);
|
|
|
|
|
|
- if (template == null)
|
|
|
- return;
|
|
|
+ if (template == null)
|
|
|
+ return;
|
|
|
|
|
|
- L2HennaInstance temp = new L2HennaInstance(template);
|
|
|
- long _count = 0;
|
|
|
-
|
|
|
- /* Prevents henna drawing exploit:
|
|
|
- 1) talk to L2SymbolMakerInstance
|
|
|
+ L2HennaInstance temp = new L2HennaInstance(template);
|
|
|
+ long _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;
|
|
|
- }
|
|
|
- }
|
|
|
- try{
|
|
|
+
|
|
|
+ boolean cheater = true;
|
|
|
+ for (L2HennaInstance h : HennaTreeTable.getInstance().getAvailableHenna(activeChar.getClassId()))
|
|
|
+ {
|
|
|
+ if (h.getSymbolId() == temp.getSymbolId())
|
|
|
+ {
|
|
|
+ cheater = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ try
|
|
|
+ {
|
|
|
_count = activeChar.getInventory().getItemByItemId(temp.getItemIdDye()).getCount();
|
|
|
}
|
|
|
- catch(Exception e){}
|
|
|
+ catch(Exception e)
|
|
|
+ {
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ if (activeChar.getHennaEmptySlots() == 0)
|
|
|
+ {
|
|
|
+ activeChar.sendPacket(new SystemMessage(SystemMessageId.SYMBOLS_FULL));
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
if (!cheater && (_count >= temp.getAmountDyeRequire())&& (activeChar.getAdena()>= temp.getPrice()) && activeChar.addHenna(temp))
|
|
|
{
|
|
@@ -103,14 +114,15 @@ public final class RequestHennaEquip extends L2GameClientPacket
|
|
|
|
|
|
//update inventory
|
|
|
InventoryUpdate iu = new InventoryUpdate();
|
|
|
- iu.addModifiedItem(activeChar.getInventory().getAdenaInstance());
|
|
|
+ iu.addModifiedItem(activeChar.getInventory().getAdenaInstance());
|
|
|
iu.addModifiedItem(dyeToUpdate);
|
|
|
activeChar.sendPacket(iu);
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
+ {
|
|
|
activeChar.sendPacket(new SystemMessage(SystemMessageId.CANT_DRAW_SYMBOL));
|
|
|
- if ((!activeChar.isGM()) && (cheater)) Util.handleIllegalPlayerAction(activeChar,"Exploit attempt: Character "+activeChar.getName()+" of account "+activeChar.getAccountName()+" tryed to add a forbidden henna.",Config.DEFAULT_PUNISH);
|
|
|
+ if ((!activeChar.isGM()) && (cheater))
|
|
|
+ Util.handleIllegalPlayerAction(activeChar,"Exploit attempt: Character "+activeChar.getName()+" of account "+activeChar.getAccountName()+" tryed to add a forbidden henna.",Config.DEFAULT_PUNISH);
|
|
|
}
|
|
|
}
|
|
|
|