Fixed skill attack for pets.
Thanks to Index.
This commit is contained in:
@@ -629,7 +629,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -655,10 +655,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -629,7 +629,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -655,10 +655,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -629,7 +629,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -655,10 +655,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -629,7 +629,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -655,10 +655,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -629,7 +629,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -655,10 +655,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -629,7 +629,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -655,10 +655,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -646,7 +646,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -672,10 +672,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -646,7 +646,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -672,10 +672,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -646,7 +646,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -672,10 +672,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -646,7 +646,7 @@ public abstract class Summon extends Playable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the target for the skill
|
// Get the target for the skill
|
||||||
final WorldObject target;
|
WorldObject target;
|
||||||
if (skill.getTargetType() == TargetType.OWNER_PET)
|
if (skill.getTargetType() == TargetType.OWNER_PET)
|
||||||
{
|
{
|
||||||
target = _owner;
|
target = _owner;
|
||||||
@@ -672,10 +672,18 @@ public abstract class Summon extends Playable
|
|||||||
|
|
||||||
// Check the validity of the target
|
// Check the validity of the target
|
||||||
if (target == null)
|
if (target == null)
|
||||||
|
{
|
||||||
|
if (!isMovementDisabled())
|
||||||
|
{
|
||||||
|
setTarget(_owner.getTarget());
|
||||||
|
target = skill.getTarget(this, forceUse, dontMove, false);
|
||||||
|
}
|
||||||
|
if (target == null)
|
||||||
{
|
{
|
||||||
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
sendPacket(SystemMessageId.YOUR_TARGET_CANNOT_BE_FOUND);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if this skill is enabled (e.g. reuse time)
|
// Check if this skill is enabled (e.g. reuse time)
|
||||||
if (isSkillDisabled(skill))
|
if (isSkillDisabled(skill))
|
||||||
|
@@ -18,7 +18,9 @@ package org.l2jmobius.gameserver.network.clientpackets;
|
|||||||
|
|
||||||
import org.l2jmobius.commons.network.PacketReader;
|
import org.l2jmobius.commons.network.PacketReader;
|
||||||
import org.l2jmobius.gameserver.data.xml.SkillData;
|
import org.l2jmobius.gameserver.data.xml.SkillData;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Playable;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
|
import org.l2jmobius.gameserver.model.actor.Summon;
|
||||||
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
import org.l2jmobius.gameserver.model.skill.CommonSkill;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.GameClient;
|
import org.l2jmobius.gameserver.network.GameClient;
|
||||||
@@ -54,18 +56,40 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
Skill skill = player.getKnownSkill(_magicId);
|
Skill skill = player.getKnownSkill(_magicId);
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) //
|
if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
||||||
|| ((_magicId > 1565) && (_magicId < 1570))) // subClass change SkillTree
|
|
||||||
{
|
{
|
||||||
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
skill = SkillData.getInstance().getSkill(_magicId, 1);
|
||||||
}
|
}
|
||||||
else
|
else // Check for known pet skill.
|
||||||
|
{
|
||||||
|
Playable pet = null;
|
||||||
|
if (player.hasServitors())
|
||||||
|
{
|
||||||
|
for (Summon summon : player.getServitors().values())
|
||||||
|
{
|
||||||
|
skill = summon.getKnownSkill(_magicId);
|
||||||
|
if (skill != null)
|
||||||
|
{
|
||||||
|
pet = summon;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((skill == null) && player.hasPet())
|
||||||
|
{
|
||||||
|
pet = player.getPet();
|
||||||
|
skill = pet.getKnownSkill(_magicId);
|
||||||
|
}
|
||||||
|
if ((skill != null) && (pet != null))
|
||||||
|
{
|
||||||
|
player.onActionRequest();
|
||||||
|
pet.useMagic(skill, null, _ctrlPressed, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (skill == null)
|
||||||
{
|
{
|
||||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
// if (_magicId > 0)
|
|
||||||
// {
|
|
||||||
// PacketLogger.warning("Skill Id " + _magicId + " not found in player: " + player);
|
|
||||||
// }
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +110,6 @@ public class RequestMagicSkillUse implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.onActionRequest();
|
player.onActionRequest();
|
||||||
|
|
||||||
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
player.useMagic(skill, null, _ctrlPressed, _shiftPressed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user