Jump to content
Sign in to follow this  
drakola

Исправить Fear

Recommended Posts

Привет всем. 

 

дело в том что когда кидаешь фир на моба он бегает как бешеный в перед и назад и при этом может еще и атаковать как мне исправить и где?

мне как то давали совет удалить в файле L2Character.java

 

|| isAfraid() в строках  с public boolean isAllSkillsDisabled() и с public boolean isAttackingDisabled()

 

я удалил фир стал работать но все равно не так как надо.

/**


* Return true if the L2Character can't use its skills (ex : stun,
* sleep...).
*/
public boolean isAllSkillsDisabled() {
return _allSkillsDisabled || isStunned() || isSleeping() || isImmobileUntilAttacked() || isParalyzed() || isPetrified();
}

/**
* Return true if the L2Character can't attack (stun, sleep, attackEndTime,
* fakeDeath, paralyse).
*/
public boolean isAttackingDisabled() {
return isStunned() || isSleeping() || isImmobileUntilAttacked() || isAttackingNow() || isFakeDeath() || isParalyzed()
|| isPetrified() || isFallsdown() || isPhysicalAttackMuted() || isCoreAIDisabled();
}

public final Calculator[] getCalculators() {
return _calculators;
}

public final boolean isConfused() {
return _isConfused;
}

public final void setIsConfused(boolean value) {
_isConfused = value;
}

public final boolean isDead() {
return _isDead;
}

public final void setIsDead(boolean value) {
_isDead = value;
}

 

Edited by Demoncool

Share this post


Link to post
Share on other sites

@@zGosu

 

у меня в L2Character.java  так

    public boolean isOutOfControl() {
        return isConfused() || isAfraid();
    }

а в L2AttackableAI.java я не понял где. есть только 

    public void run() {
        onEvtThink();
    }

и вот это 

    protected void onEvtThink() {
        // Check if the thinking action is already in progress
        if (_thinking || _actor.isCastingNow() || _actor.isAllSkillsDisabled()) {
            return;
        }

Share this post


Link to post
Share on other sites

 

@@zGosu

 

у меня в L2Character.java  так

    public boolean isOutOfControl() {
        return isConfused() || isAfraid();
    }

а в L2AttackableAI.java я не понял где. есть только 

    public void run() {
        onEvtThink();
    }

и вот это 

    protected void onEvtThink() {
        // Check if the thinking action is already in progress
        if (_thinking || _actor.isCastingNow() || _actor.isAllSkillsDisabled()) {
            return;
        }

Если во время фира моб подбигает и бьет скилом, то надо

// Check if the thinking action is already in progress

добавляете:

if (npc.isAllSkillsDisabled() || npc.isAfraid())
			npc.abortCast();

P.S. Этот фикс работает на L2JServer. Для других сборок фикс может немного отличаться (обычно смотрят в сам эффект)

Edited by zGosu
  • Upvote 1

Share this post


Link to post
Share on other sites

У вас формула не верно написана в EffectFear.java метод onStart()

вот формула
 
    public boolean onStart() {
        // Fear skills cannot be used L2Pcinstance to L2Pcinstance.
        // Heroic Dread, Curse: Fear, Fear, Horror, Sword Symphony, Word of Fear and Mass Curse Fear are the exceptions.
        if (getEffected() instanceof L2PcInstance && getEffector() instanceof L2PcInstance) {
            switch (getSkill().getId()) {
                case 65:
                case 98:
                case 1092:
                case 1169:
                case 1272:
                case 1376:
                case 1381:
                    // all ok
                    break;
                default:
                    return false;
            }
        }

Share this post


Link to post
Share on other sites

 

вот формула
 
    public boolean onStart() {
        // Fear skills cannot be used L2Pcinstance to L2Pcinstance.
        // Heroic Dread, Curse: Fear, Fear, Horror, Sword Symphony, Word of Fear and Mass Curse Fear are the exceptions.
        if (getEffected() instanceof L2PcInstance && getEffector() instanceof L2PcInstance) {
            switch (getSkill().getId()) {
                case 65:
                case 98:
                case 1092:
                case 1169:
                case 1272:
                case 1376:
                case 1381:
                    // all ok
                    break;
                default:
                    return false;
            }
        }

 

Какая формула? Ее тут нет) Тут просто ID скилов перечислено, которые не отвечают за обрыв скила и т.п.

  • Upvote 1

Share this post


Link to post
Share on other sites

Если во время фира моб подбигает и бьет скилом, то надо

// Check if the thinking action is already in progress

добавляете:

if (npc.isAllSkillsDisabled() || npc.isAfraid())
			npc.abortCast();

P.S. Этот фикс работает на L2JServer. Для других сборок фикс может немного отличаться (обычно смотрят в сам эффект)

ошибка в гс 

        at ru.catssoftware.gameserver.ai.L2AttackableAI.onEvtThink(L2AttackableAI.java:1633)
        at ru.catssoftware.gameserver.ai.L2CharacterAI.onEvtArrived(L2CharacterAI.java:700)
        at ru.catssoftware.gameserver.ai.L2AttackableAI.onEvtArrived(L2AttackableAI.java:563)
        at ru.catssoftware.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:449)
        at ru.catssoftware.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:375)
        at ru.catssoftware.gameserver.GameTimeController$ArrivedCharacterManager.callTask(GameTimeController.java:218)
        at ru.catssoftware.gameserver.GameTimeController$ArrivedCharacterManager.callTask(GameTimeController.java:197)
        at ru.catssoftware.gameserver.taskmanager.AbstractFIFOPeriodicTaskManager.run(AbstractFIFOPeriodicTaskManager.java:62)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Share this post


Link to post
Share on other sites

 

ошибка в гс 

        at ru.catssoftware.gameserver.ai.L2AttackableAI.onEvtThink(L2AttackableAI.java:1633)
        at ru.catssoftware.gameserver.ai.L2CharacterAI.onEvtArrived(L2CharacterAI.java:700)
        at ru.catssoftware.gameserver.ai.L2AttackableAI.onEvtArrived(L2AttackableAI.java:563)
        at ru.catssoftware.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:449)
        at ru.catssoftware.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:375)
        at ru.catssoftware.gameserver.GameTimeController$ArrivedCharacterManager.callTask(GameTimeController.java:218)
        at ru.catssoftware.gameserver.GameTimeController$ArrivedCharacterManager.callTask(GameTimeController.java:197)
        at ru.catssoftware.gameserver.taskmanager.AbstractFIFOPeriodicTaskManager.run(AbstractFIFOPeriodicTaskManager.java:62)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

 

Если во время фира моб подбигает и бьет скилом, то надо

// Check if the thinking action is already in progress

добавляете:

if (npc.isAllSkillsDisabled() || npc.isAfraid())
			npc.abortCast();

P.S. Этот фикс работает на L2JServer. Для других сборок фикс может немного отличаться (обычно смотрят в сам эффект)

Лучше правьте в самом эффекте, а не в AI

  • Upvote 1

Share this post


Link to post
Share on other sites

Как фиксить бег я скидывал выше. 

За отмену каста отвечает метод abortCast()

За отмену автоатаки - abortAttack()

Пора уже учиться самому править такие не сложные баги. 

так дела то тогда в L2Character.java а не в  L2AttackableAI.java  и EffectFear.java

Share this post


Link to post
Share on other sites

так дела то тогда в L2Character.java а не в  L2AttackableAI.java  и EffectFear.java

Вам виднее. Если такая проблема только с мобами, то править надо L2AttackableAI.java. В остальных случаях в EffectFear.java

 

oBM368E276.jpg

 

 

  • Upvote 1

Share this post


Link to post
Share on other sites

Вам виднее. Если такая проблема только с мобами, то править надо L2AttackableAI.java. В остальных случаях в EffectFear.java

 

oBM368E276.jpg

 

 

public final boolean isAfraid() {
        return _isAfraid;

Share this post


Link to post
Share on other sites

 

public final boolean isAfraid() {
        return _isAfraid;

 

Это просто метод. Я скинул фикс с бегом и как оборвать атаку\каст. Дело за Вами осталось) 

  • Upvote 1

Share this post


Link to post
Share on other sites

мне как то давали совет удалить в файле L2Character.java

 

|| isAfraid() в строках  с public boolean isAllSkillsDisabled() и с public boolean isAttackingDisabled()

после выполнения таких дебильных советов не стоит удивляться самым странным проблемам появившимся после правок. Edited by Gaikotsu

Share this post


Link to post
Share on other sites

после выполнения таких дебильных советов не стоит удивляться самым странным проблемам появившимся после правок.

если это || isAfraid() в строках  с public boolean isAllSkillsDisabled() и с public boolean isAttackingDisabled() 

вернуть обратно то при фире моб просто стоит и не двигается.

Share this post


Link to post
Share on other sites

если это || isAfraid() в строках  с public boolean isAllSkillsDisabled() и с public boolean isAttackingDisabled() 

вернуть обратно то при фире моб просто стоит и не двигается.

ну а так он будет всех бить в фире) 

Просто добавь метод, который будет заставлять их бегать и всё. 

  • Upvote 1

Share this post


Link to post
Share on other sites

ну а так он будет всех бить в фире) 

Просто добавь метод, который будет заставлять их бегать и всё. 

не подскажешь какой метод надо найти ? 

Share this post


Link to post
Share on other sites

не подскажешь какой метод надо найти ? 

На передвижение. Если знаете английский, то без проблем его найдете. 

  • Upvote 1

Share this post


Link to post
Share on other sites

На передвижение. Если знаете английский, то без проблем его найдете. 

в том то и дело что нет )))

 

может это ? 

        // Caclulate the Nb of ticks between the current position and the destination
        // One tick added for rounding reasons
        int ticksToMove = 1 + (int) ((GameTimeController.TICKS_PER_SECOND * distance) / speed);
        m._xDestination = x;
        m._yDestination = y;
        m._zDestination = z; // this is what was requested from client
Edited by drakola

Share this post


Link to post
Share on other sites

 

в том то и дело что нет )))

 

может это ? 

        // Caclulate the Nb of ticks between the current position and the destination
        // One tick added for rounding reasons
        int ticksToMove = 1 + (int) ((GameTimeController.TICKS_PER_SECOND * distance) / speed);
        m._xDestination = x;
        m._yDestination = y;
        m._zDestination = z; // this is what was requested from client

это не метод.... moveToLocation или похожие на него. методов на передвижение много. Но обычно пользуются тем, что я выделил, или new Location.

Тут надо смотреть, не двигается вообще (и мобы и игроки). Если только мобы, то править надо только для них (L2Attackable) или смотреть ограничения в фир эффекте или методе на передвижение. 

  • Upvote 1

Share this post


Link to post
Share on other sites

это не метод.... moveToLocation или похожие на него. методов на передвижение много. Но обычно пользуются тем, что я выделил, или new Location.

Тут надо смотреть, не двигается вообще (и мобы и игроки). Если только мобы, то править надо только для них (L2Attackable) или смотреть ограничения в фир эффекте или методе на передвижение. 

        public void moveTo(int x, int y, int z, int offset) {
            moveToLocation(x, y, z, offset);
        }

        public boolean moveTo(int x, int y, int z) {
            return moveToLocation(x, y, z, 0);
        }
        // the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
        // to destination by GameTimeController
        // Send a Server->Client packet CharMoveToLocation to the actor and all L2PcInstance in its _knownPlayers
        broadcastPacket(new MoveToLocation(this));
    protected boolean moveToLocation(int x, int y, int z, int offset) {
		// Get the Move Speed of the L2Charcater
		float speed = getStat().getMoveSpeed();
		if (speed <= 0 || isMovementDisabled()) {
//			actionFail();
			return _AIdisabled;
		}

вот все что есть

Share this post


Link to post
Share on other sites
        public void moveTo(int x, int y, int z, int offset) {
            moveToLocation(x, y, z, offset);
        }

        public boolean moveTo(int x, int y, int z) {
            return moveToLocation(x, y, z, 0);
        }
        // the CtrlEvent.EVT_ARRIVED will be sent when the character will actually arrive
        // to destination by GameTimeController
        // Send a Server->Client packet CharMoveToLocation to the actor and all L2PcInstance in its _knownPlayers
        broadcastPacket(new MoveToLocation(this));
    protected boolean moveToLocation(int x, int y, int z, int offset) {
		// Get the Move Speed of the L2Charcater
		float speed = getStat().getMoveSpeed();
		if (speed <= 0 || isMovementDisabled()) {
//			actionFail();
			return _AIdisabled;
		}

вот все что есть

 

Я фикс до этого выше Вам кидал (потом Модерация его удалила). Я так понял он Вам не помог. Поэтому рекомендую выбрать один из следующих вариантов:

1) Попросить разработчика, что бы исправили баг

2) Взять код из сборки, где работает этот эффект

3) Ну если нет разработчика и Вы не умеете копировать код из одного места в другое (т.к. фикс я Вам кидал, а Вы не можете его вставить :( ), то просить человека, что бы он за Вас поправил баг (платно\бесплатно - как повезет).

Fear.7z

Share this post


Link to post
Share on other sites

Я фикс до этого выше Вам кидал (потом Модерация его удалила). Я так понял он Вам не помог. Поэтому рекомендую выбрать один из следующих вариантов:

1) Попросить разработчика, что бы исправили баг

2) Взять код из сборки, где работает этот эффект

3) Ну если нет разработчика и Вы не умеете копировать код из одного места в другое (т.к. фикс я Вам кидал, а Вы не можете его вставить :( ), то просить человека, что бы он за Вас поправил баг (платно\бесплатно - как повезет).

вы мне скинули эффект в нем то как раз все хорошо. а вот в L2Character.java косяк какой то.

Share this post


Link to post
Share on other sites

вы мне скинули эффект в нем то как раз все хорошо. а вот в L2Character.java косяк какой то.

Вы удалили в Character проверку на фир эффект... Верните его обратно. 

Share this post


Link to post
Share on other sites

Вы удалили в Character проверку на фир эффект... Верните его обратно. 

|| isAfraid это ?

 

вернул.

   /**
     * Return true if the L2Character can't use its skills (ex : stun,
     * sleep...).
     */
    public boolean isAllSkillsDisabled() {
        return _allSkillsDisabled || isStunned() || isSleeping() || isImmobileUntilAttacked() || isParalyzed() || isPetrified()|| isAfraid() ;
    }

    /**
     * Return true if the L2Character can't attack (stun, sleep, attackEndTime,
     * fakeDeath, paralyse).
     */
    public boolean isAttackingDisabled() {
        return isStunned() || isSleeping() || isImmobileUntilAttacked() || isAttackingNow() || isFakeDeath() || isParalyzed()
                || isPetrified() || isFallsdown() || isPhysicalAttackMuted() || isCoreAIDisabled() || isAfraid();
    }
Edited by drakola

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...