Code improvements.

This commit is contained in:
MobiusDev
2016-04-24 16:30:15 +00:00
parent 8bd51aba1c
commit 2dd14bef9b
860 changed files with 8865 additions and 17041 deletions

View File

@@ -72,12 +72,9 @@ public class BeastSoulShot implements IItemHandler
final SkillHolder[] skills = item.getItem().getSkills();
short shotConsumption = 0;
if (pet != null)
if ((pet != null) && !pet.isChargedShot(ShotType.SOULSHOTS))
{
if (!pet.isChargedShot(ShotType.SOULSHOTS))
{
shotConsumption += pet.getSoulShotsPerHit();
}
shotConsumption += pet.getSoulShotsPerHit();
}
for (L2Summon servitors : aliveServitor)
@@ -116,28 +113,25 @@ public class BeastSoulShot implements IItemHandler
// Pet uses the power of spirit.
activeOwner.sendPacket(SystemMessageId.YOUR_PET_USES_SPIRITSHOT);
if (pet != null)
if ((pet != null) && !pet.isChargedShot(ShotType.SOULSHOTS))
{
if (!pet.isChargedShot(ShotType.SOULSHOTS))
pet.setChargedShot(ShotType.SOULSHOTS, true);
// Visual effect change if player has equipped Ruby lvl 3 or higher
if ((activeOwner.getInventory().getItemByItemId(38859) != null) && (activeOwner.getInventory().getItemByItemId(38859).isEquipped()))
{
pet.setChargedShot(ShotType.SOULSHOTS, true);
// Visual effect change if player has equipped Ruby lvl 3 or higher
if ((activeOwner.getInventory().getItemByItemId(38859) != null) && (activeOwner.getInventory().getItemByItemId(38859).isEquipped()))
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17817, 1, 0, 0), 600);
}
else if ((activeOwner.getInventory().getItemByItemId(38858) != null) && (activeOwner.getInventory().getItemByItemId(38858).isEquipped()))
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17816, 1, 0, 0), 600);
}
else if ((activeOwner.getInventory().getItemByItemId(38857) != null) && (activeOwner.getInventory().getItemByItemId(38857).isEquipped()))
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17815, 1, 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, 17817, 1, 0, 0), 600);
}
else if ((activeOwner.getInventory().getItemByItemId(38858) != null) && (activeOwner.getInventory().getItemByItemId(38858).isEquipped()))
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17816, 1, 0, 0), 600);
}
else if ((activeOwner.getInventory().getItemByItemId(38857) != null) && (activeOwner.getInventory().getItemByItemId(38857).isEquipped()))
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, 17815, 1, 0, 0), 600);
}
else
{
Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(pet, pet, skills[0].getSkillId(), skills[0].getSkillLvl(), 0, 0), 600);
}
}