Code improvements.
This commit is contained in:
@@ -74,12 +74,9 @@ public class BeastSpiritShot implements IItemHandler
|
||||
final ShotType shotType = isBlessed ? ShotType.BLESSED_SPIRITSHOTS : ShotType.SPIRITSHOTS;
|
||||
|
||||
short shotConsumption = 0;
|
||||
if (pet != null)
|
||||
if ((pet != null) && !pet.isChargedShot(shotType))
|
||||
{
|
||||
if (!pet.isChargedShot(shotType))
|
||||
{
|
||||
shotConsumption += pet.getSpiritShotsPerHit();
|
||||
}
|
||||
shotConsumption += pet.getSpiritShotsPerHit();
|
||||
}
|
||||
|
||||
for (L2Summon servitors : aliveServitor)
|
||||
@@ -118,28 +115,25 @@ public class BeastSpiritShot implements IItemHandler
|
||||
|
||||
// Pet uses the power of spirit.
|
||||
activeOwner.sendPacket(SystemMessageId.YOUR_PET_USES_SPIRITSHOT);
|
||||
if (pet != null)
|
||||
if ((pet != null) && !pet.isChargedShot(shotType))
|
||||
{
|
||||
if (!pet.isChargedShot(shotType))
|
||||
pet.setChargedShot(shotType, true);
|
||||
// Visual effect change if player has equipped Sapphire lvl 3 or higher
|
||||
if ((activeOwner.getInventory().getItemByItemId(38931) != null) && (activeOwner.getInventory().getItemByItemId(38931).isEquipped()))
|
||||
{
|
||||
pet.setChargedShot(shotType, true);
|
||||
// Visual effect change if player has equipped Sapphire lvl 3 or higher
|
||||
if ((activeOwner.getInventory().getItemByItemId(38931) != null) && (activeOwner.getInventory().getItemByItemId(38931).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17821, 2, 0, 0), 600);
|
||||
}
|
||||
else if ((activeOwner.getInventory().getItemByItemId(38930) != null) && (activeOwner.getInventory().getItemByItemId(38930).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17820, 2, 0, 0), 600);
|
||||
}
|
||||
else if ((activeOwner.getInventory().getItemByItemId(38929) != null) && (activeOwner.getInventory().getItemByItemId(38929).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17819, 2, 0, 0), 600);
|
||||
}
|
||||
else
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
|
||||
}
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17821, 2, 0, 0), 600);
|
||||
}
|
||||
else if ((activeOwner.getInventory().getItemByItemId(38930) != null) && (activeOwner.getInventory().getItemByItemId(38930).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17820, 2, 0, 0), 600);
|
||||
}
|
||||
else if ((activeOwner.getInventory().getItemByItemId(38929) != null) && (activeOwner.getInventory().getItemByItemId(38929).isEquipped()))
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17819, 2, 0, 0), 600);
|
||||
}
|
||||
else
|
||||
{
|
||||
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user