Господа, подскажите, из-за чего может быть такое :
При создании чара сервер выдаёт такую ошибку -
Unknown Packet : d0:3d on State : AUTHED Client
* Всё, разобрался сам. Клиент не подходил ))
Добавлено через 13 часов 53 минуты
Цитата:
Сообщение от Azagthtot
Ну я так и думал. Однако, вы не правы. Точнее правы, но частично.
Вам надо проверку ставить "ниже", а конкретно в методе isAutoAttackable() и второе в методе addDamageHate() класса L2PcInstance
В первом за то можно ли атаковать чара, а во втором, что бы случайно ему скиллом не снесло жизнь.
|
Уважаемый Azagthtot, в сервере L2j T2.4 , есть только такой isAutoAttackable. ( В IT находил ещё один isAutoAttackable(player) ).
PHP код:
public boolean isAutoAttackable(L2Character attacker)
{
// Check if the attacker isn't the L2PcInstance Pet
if (attacker == this || attacker == getPet())
return false;
// TODO: check for friendly mobs
// Check if the attacker is a L2MonsterInstance
if (attacker instanceof L2MonsterInstance)
return true;
// Check if the attacker is not in the same party
if (getParty() != null && getParty().getPartyMembers().contains(attacker))
return false;
// Check if the attacker is in olympia and olympia start
if (attacker instanceof L2PcInstance && ((L2PcInstance)attacker).isInOlympiadMode() ){
if (isInOlympiadMode() && isOlympiadStart() && ((L2PcInstance)attacker).getOlympiadGameId()==getOlympiadGameId())
return true;
else
return false;
}
// Check if the attacker is in TvT and TvT is started
if (TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(getObjectId()))
return true;
// Check if the attacker is not in the same clan
if (getClan() != null && attacker != null && getClan().isMember(attacker.getObjectId()))
return false;
if(attacker instanceof L2Playable && isInsideZone(ZONE_PEACE))
return false;
// Check if the L2PcInstance has Karma
if (getKarma() > 0 || getPvpFlag() > 0)
return true;
// Check if the attacker is a L2Playable
if (attacker instanceof L2Playable)
{
// Get L2PcInstance
L2PcInstance cha = attacker.getActingPlayer();
// is AutoAttackable if both players are in the same duel and the duel is still going on
if ( getDuelState() == Duel.DUELSTATE_DUELLING
&& getDuelId() == cha.getDuelId())
return true;
// Check if the L2PcInstance is in an arena or a siege area
if (isInsideZone(ZONE_PVP) && cha.isInsideZone(ZONE_PVP))
return true;
if (getClan() != null)
{
Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(cha.getClan()) &&
siege.checkIsDefender(getClan()))
return false;
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(cha.getClan()) &&
siege.checkIsAttacker(getClan()))
return false;
}
// Check if clan is at war
if (getClan() != null && cha.getClan() != null
&& getClan().isAtWarWith(cha.getClanId())
&& cha.getClan().isAtWarWith(getClanId())
&& getWantsPeace() == 0
&& cha.getWantsPeace() == 0
&& !isAcademyMember())
return true;
}
}
else if (attacker instanceof L2DefenderInstance)
{
if (getClan() != null)
{
Siege siege = SiegeManager.getInstance().getSiege(this);
return (siege != null && siege.checkIsAttacker(getClan()));
}
}
return false;
}
Не могу разобраться, как при выполнении проверки, сравнивать getSpiritId игрока и чара выбранного по таргету ?
Я пытался сделать таким образом :
PHP код:
if (getSpiritId() != target.getSpiritId())
Пробывал и targetPlayer... Либо я не туда вписываю, либо таргет не предусмотрен в isAutoAttackable. Прошу, подскажите в чём я заблуждаюсь и по возможности укажите выход из "тупика".
Благодарю.