Делаю ГвЕ систему, делаю по этому дифф файлу.
http://rghost.ru/44748525
Адаптировал под лыжу фрея, все с компилировалось без ошибок. Но зайдя в игру, я заметил, что не кастуются скилы(Ни на кого) с типом TARGET_AURA, весь день ломая голову, я так и не нашел в чем проблема. Подскажите пожалуйста.
code
[SRC="java"] // Check if this is offensive magic skill
if (skill.isOffensive())
{
boolean cond = true;
L2PcInstance trgtF = null;
if (target instanceof L2PcInstance)
trgtF = (L2PcInstance) target;
else if (target instanceof L2SummonInstance)
trgtF = ((L2SummonInstance)target).getOwner();
if (trgtF != null)
{
if (trgtF.getFactionId() == getFactionId())
cond = false;
}
if (!cond)
return false;
if ((isInsidePeaceZone(this, target)) && !getAccessLevel().allowPeaceAttack())
{
// If L2Character or target is in a peace zone, send a system message TARGET_IN_PEACEZONE a Server->Client packet ActionFailed
sendPacket(SystemMessage.getSystemMessage(SystemMessageId.TARGET_IN_PEACEZONE));
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if (isInOlympiadMode() && !isOlympiadStart()){
// if L2PcInstance is in Olympia and the match isn't already start, send a Server->Client packet ActionFailed
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
if (target.getActingPlayer() != null && getSiegeState() > 0 && isInsideZone(L2Character.ZONE_SIEGE)
&& target.getActingPlayer().getSiegeState() == getSiegeState()
&& target.getActingPlayer() != this && target.getActingPlayer().getSiegeSide() == getSiegeSide())
{
//
if (TerritoryWarManager.getInstance().isTWInProgress())
sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_CANNOT_ATTACK_A_MEMBER_OF_THE_SAME_TERRITORY));
else
sendPacket(SystemMessage.getSystemMessage(SystemMessageId.FORCED_ATTACK_IS_IMPOSSIBLE_AGAINST_SIEGE_SIDE_TEMPORARY_ALLIED_MEMBERS));
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
// Check if the target is attackable
if (!target.isAttackable() && !getAccessLevel().allowPeaceAttack())
{
// If target is not attackable, send a Server->Client packet ActionFailed
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
// Check for Event Mob's
if (target instanceof L2EventMonsterInstance && ((L2EventMonsterInstance)target).eventSkillAttackBlocked())
{
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
// Check if a Forced ATTACK is in progress on non-attackable target
if (!target.isAutoAttackable(this) && !forceUse)
{
switch (sklTargetType)
{
case TARGET_AURA:
case TARGET_FRONT_AURA:
case TARGET_BEHIND_AURA:
case TARGET_CLAN:
case TARGET_PARTY_CLAN:
case TARGET_ALLY:
case TARGET_PARTY:
case TARGET_SELF:
case TARGET_GROUND:
case TARGET_AREA_SUMMON:
break;
default: // Send a Server->Client packet ActionFailed to the L2PcInstance
sendPacket(ActionFailed.STATIC_PACKET);
return false;
}
}[/SRC]
Проблема в этом, только не понял почему. Добавляю этот код:
[SRC="java"] boolean cond = true;
L2PcInstance trgtF = null;
if (target instanceof L2PcInstance)
trgtF = (L2PcInstance) target;
else if (target instanceof L2SummonInstance)
trgtF = ((L2SummonInstance)target).getOwner();
if (trgtF != null)
{
if (trgtF.getFactionId() == getFactionId())
cond = false;
}
if (!cond)
return false;[/SRC]