Small rework for pet shot recharge messages.
This commit is contained in:
@@ -18,6 +18,7 @@ package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jmobius.commons.network.PacketReader;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.enums.ShotType;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.items.L2Item;
|
||||
@@ -118,21 +119,32 @@ public final class RequestAutoSoulShot implements IClientIncomingPacket
|
||||
activeChar.addAutoSoulShot(_itemId);
|
||||
client.sendPacket(new ExAutoSoulShot(_itemId, _enable, _type));
|
||||
|
||||
// Send message
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_AUTOMATIC_USE_OF_S1_HAS_BEEN_ACTIVATED);
|
||||
sm.addItemName(item);
|
||||
client.sendPacket(sm);
|
||||
|
||||
// Recharge summon's shots
|
||||
final L2Summon pet = activeChar.getPet();
|
||||
if (pet != null)
|
||||
{
|
||||
// Send message
|
||||
if (!pet.isChargedShot(item.getItem().getDefaultAction() == ActionType.SUMMON_SOULSHOT ? ShotType.SOULSHOTS : ((item.getId() == 6647) || (item.getId() == 20334)) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_AUTOMATIC_USE_OF_S1_HAS_BEEN_ACTIVATED);
|
||||
sm.addItemName(item);
|
||||
client.sendPacket(sm);
|
||||
}
|
||||
// Charge
|
||||
pet.rechargeShots(isSoulshot, isSpiritshot, false);
|
||||
}
|
||||
activeChar.getServitors().values().forEach(s ->
|
||||
for (L2Summon summon : activeChar.getServitors().values())
|
||||
{
|
||||
s.rechargeShots(isSoulshot, isSpiritshot, false);
|
||||
});
|
||||
// Send message
|
||||
if (!summon.isChargedShot(item.getItem().getDefaultAction() == ActionType.SUMMON_SOULSHOT ? ShotType.SOULSHOTS : ((item.getId() == 6647) || (item.getId() == 20334)) ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_AUTOMATIC_USE_OF_S1_HAS_BEEN_ACTIVATED);
|
||||
sm.addItemName(item);
|
||||
client.sendPacket(sm);
|
||||
}
|
||||
// Charge
|
||||
summon.rechargeShots(isSoulshot, isSpiritshot, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user