11-12-2013, 06:48 PM
Помогите пожалуйста, не могу хилить себя, но не знаю в чем проблема, думаю или в doCast:
[SRC="java"] @Override
public void doCast(L2Skill skill)
{
if(skill == null)
return;
if (getTarget() instanceof L2PcInstance)
{
if(skill.getSkillType() != L2SkillType.HEAL || skill.getSkillType() != L2SkillType.BUFF)
{
if(getActingPlayer().getRace() == getTarget().getActingPlayer().getRace())
{
return;
}
}
}
super.doCast(skill);
// cancel the recent fake-death protection instantly if the player attacks or casts spells
getPlayer().setRecentFakeDeath(false);
}[/SRC]
Или в checkDoCastConditions:
[SRC="java"] @Override
protected boolean checkDoCastConditions(L2Skill skill)
{
if (!super.checkDoCastConditions(skill))
return false;
switch (skill.getSkillType())
{
case SUMMON_TRAP:
{
if (isInsideZone(ZONE_PEACE))
{
sendPacket(SystemMessageId.A_MALICIOUS_SKILL_CANNOT_BE_USED_IN_PEACE_ZONE);
return false;
}
if (getTrap() != null
&& getTrap().getSkill().getId() == ((L2SkillTrap)skill).getTriggerSkillId())
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
sm.addSkillName(skill);
sendPacket(sm);
return false;
}
break;
}
case SUMMON:
{
if (!((L2SkillSummon)skill).isCubic() && (getPet() != null || isMounted() || CharSummonTable.getInstance().getPets().contains(getObjectId()) || CharSummonTable.getInstance().getPets().contains(getObjectId())))
{
if (Config.DEBUG)
_log.fine("player has a pet already. ignore summon skill");
sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
return false;
}
}
}
if(getTarget() instanceof L2PcInstance)
{
if(skill.getSkillType() == L2SkillType.HEAL || skill.getSkillType() == L2SkillType.BUFF)
{
if (getActingPlayer().getRace() != getTarget().getActingPlayer().getRace())
{
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
if(skill.getSkillType() == L2SkillType.HEAL || skill.getSkillType() == L2SkillType.BUFF)
{
if (getActingPlayer().getRace() == getTarget().getActingPlayer().getRace())
{
return true;
}
}
}
}
[/SRC]
Может быть не так проверка сделана? Просто когда юзаю скилл на себя, все стопорится, нужно делать релог.
[SRC="java"] @Override
public void doCast(L2Skill skill)
{
if(skill == null)
return;
if (getTarget() instanceof L2PcInstance)
{
if(skill.getSkillType() != L2SkillType.HEAL || skill.getSkillType() != L2SkillType.BUFF)
{
if(getActingPlayer().getRace() == getTarget().getActingPlayer().getRace())
{
return;
}
}
}
super.doCast(skill);
// cancel the recent fake-death protection instantly if the player attacks or casts spells
getPlayer().setRecentFakeDeath(false);
}[/SRC]
Или в checkDoCastConditions:
[SRC="java"] @Override
protected boolean checkDoCastConditions(L2Skill skill)
{
if (!super.checkDoCastConditions(skill))
return false;
switch (skill.getSkillType())
{
case SUMMON_TRAP:
{
if (isInsideZone(ZONE_PEACE))
{
sendPacket(SystemMessageId.A_MALICIOUS_SKILL_CANNOT_BE_USED_IN_PEACE_ZONE);
return false;
}
if (getTrap() != null
&& getTrap().getSkill().getId() == ((L2SkillTrap)skill).getTriggerSkillId())
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
sm.addSkillName(skill);
sendPacket(sm);
return false;
}
break;
}
case SUMMON:
{
if (!((L2SkillSummon)skill).isCubic() && (getPet() != null || isMounted() || CharSummonTable.getInstance().getPets().contains(getObjectId()) || CharSummonTable.getInstance().getPets().contains(getObjectId())))
{
if (Config.DEBUG)
_log.fine("player has a pet already. ignore summon skill");
sendPacket(SystemMessageId.YOU_ALREADY_HAVE_A_PET);
return false;
}
}
}
if(getTarget() instanceof L2PcInstance)
{
if(skill.getSkillType() == L2SkillType.HEAL || skill.getSkillType() == L2SkillType.BUFF)
{
if (getActingPlayer().getRace() != getTarget().getActingPlayer().getRace())
{
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}
else
{
if(skill.getSkillType() == L2SkillType.HEAL || skill.getSkillType() == L2SkillType.BUFF)
{
if (getActingPlayer().getRace() == getTarget().getActingPlayer().getRace())
{
return true;
}
}
}
}
[/SRC]
Может быть не так проверка сделана? Просто когда юзаю скилл на себя, все стопорится, нужно делать релог.