if (!activeChar.getFloodProtectors().getItemPetSummon().tryPerformAction("mount"))
return;
Ride mount = new Ride(activeChar.getObjectId(), Ride.ACTION_MOUNT, pet.getTemplate().npcId);
activeChar.broadcastPacket(mount);
activeChar.setMountType(mount.getMountType());
activeChar.setMountObjectID(pet.getControlItemId());
pet.unSummon(activeChar);
if(activeChar.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) != null || activeChar.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LRHAND) != null)
{
if(activeChar.isFlying())
{
// Remove skill Wyvern Breath
activeChar.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
activeChar.sendSkillList();
}
if(activeChar.setMountType(0))
{
Ride dismount = new Ride(activeChar.getObjectId(), Ride.ACTION_DISMOUNT, 0);
activeChar.broadcastPacket(dismount);
activeChar.setMountObjectID(0);
}
}
}
}
else if(activeChar.isRentedPet())
{
activeChar.stopRentPet();
}
else if(activeChar.isMounted())
{
if(activeChar.isFlying())
{
// Remove skill Wyvern Breath
activeChar.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
activeChar.sendSkillList();
}
if(activeChar.setMountType(0))
{
Ride dismount = new Ride(activeChar.getObjectId(), Ride.ACTION_DISMOUNT, 0);
activeChar.broadcastPacket(dismount);
activeChar.setMountObjectID(0);
// Update status after unmount to avoid visual bug
activeChar.broadcastStatusUpdate();