Proper summon intention after stun.
This commit is contained in:
@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.ai.CtrlEvent;
|
|||||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||||
@@ -66,13 +67,27 @@ public final class BlockActions extends AbstractEffect
|
|||||||
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
||||||
{
|
{
|
||||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||||
if (!effected.isPlayer())
|
if (effected.isPlayable())
|
||||||
{
|
{
|
||||||
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
if (effected.isSummon())
|
||||||
|
{
|
||||||
|
if ((effector != null) && !effector.isDead())
|
||||||
|
{
|
||||||
|
((L2Summon) effected).doAttack(effector);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, effected.getActingPlayer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.ai.CtrlEvent;
|
|||||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||||
@@ -66,13 +67,27 @@ public final class BlockActions extends AbstractEffect
|
|||||||
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
||||||
{
|
{
|
||||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||||
if (!effected.isPlayer())
|
if (effected.isPlayable())
|
||||||
{
|
{
|
||||||
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
if (effected.isSummon())
|
||||||
|
{
|
||||||
|
if ((effector != null) && !effector.isDead())
|
||||||
|
{
|
||||||
|
((L2Summon) effected).doAttack(effector);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, effected.getActingPlayer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.ai.CtrlEvent;
|
|||||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||||
@@ -66,13 +67,27 @@ public final class BlockActions extends AbstractEffect
|
|||||||
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
||||||
{
|
{
|
||||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||||
if (!effected.isPlayer())
|
if (effected.isPlayable())
|
||||||
{
|
{
|
||||||
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
if (effected.isSummon())
|
||||||
|
{
|
||||||
|
if ((effector != null) && !effector.isDead())
|
||||||
|
{
|
||||||
|
((L2Summon) effected).doAttack(effector);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, effected.getActingPlayer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.ai.CtrlEvent;
|
|||||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||||
@@ -66,13 +67,27 @@ public final class BlockActions extends AbstractEffect
|
|||||||
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
||||||
{
|
{
|
||||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||||
if (!effected.isPlayer())
|
if (effected.isPlayable())
|
||||||
{
|
{
|
||||||
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
if (effected.isSummon())
|
||||||
|
{
|
||||||
|
if ((effector != null) && !effector.isDead())
|
||||||
|
{
|
||||||
|
((L2Summon) effected).doAttack(effector);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, effected.getActingPlayer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||||
import com.l2jmobius.gameserver.model.conditions.Condition;
|
import com.l2jmobius.gameserver.model.conditions.Condition;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||||
@@ -49,7 +52,20 @@ public final class Stun extends AbstractEffect
|
|||||||
@Override
|
@Override
|
||||||
public void onExit(BuffInfo info)
|
public void onExit(BuffInfo info)
|
||||||
{
|
{
|
||||||
info.getEffected().stopStunning(false);
|
final L2Character effected = info.getEffected();
|
||||||
|
effected.stopStunning(false);
|
||||||
|
if (effected.isSummon())
|
||||||
|
{
|
||||||
|
final L2Character effector = info.getEffector();
|
||||||
|
if ((effector != null) && !effector.isDead())
|
||||||
|
{
|
||||||
|
((L2Summon) effected).doSummonAttack(effector);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, effected.getActingPlayer());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -945,12 +945,12 @@ public abstract class L2Summon extends L2Playable
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs an attack to the owner's target.
|
* Performs an attack to the owner's target.
|
||||||
|
* @param target the target to attack.
|
||||||
*/
|
*/
|
||||||
public void doAttack()
|
public void doSummonAttack(L2Object target)
|
||||||
{
|
{
|
||||||
if (_owner != null)
|
if (_owner != null)
|
||||||
{
|
{
|
||||||
final L2Object target = _owner.getTarget();
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
{
|
{
|
||||||
setTarget(target);
|
setTarget(target);
|
||||||
|
@@ -183,7 +183,7 @@ public final class RequestActionUse implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
if (summon.canAttack(_ctrlPressed))
|
if (summon.canAttack(_ctrlPressed))
|
||||||
{
|
{
|
||||||
summon.doAttack();
|
summon.doSummonAttack(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -241,7 +241,7 @@ public final class RequestActionUse implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
if (summon.canAttack(_ctrlPressed))
|
if (summon.canAttack(_ctrlPressed))
|
||||||
{
|
{
|
||||||
summon.doAttack();
|
summon.doSummonAttack(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.ai.CtrlEvent;
|
|||||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||||
@@ -66,13 +67,27 @@ public final class BlockActions extends AbstractEffect
|
|||||||
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
||||||
{
|
{
|
||||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||||
if (!effected.isPlayer())
|
if (effected.isPlayable())
|
||||||
{
|
{
|
||||||
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
if (effected.isSummon())
|
||||||
|
{
|
||||||
|
if ((effector != null) && !effector.isDead())
|
||||||
|
{
|
||||||
|
((L2Summon) effected).doAttack(effector);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, effected.getActingPlayer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.ai.CtrlEvent;
|
|||||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||||
@@ -66,13 +67,27 @@ public final class BlockActions extends AbstractEffect
|
|||||||
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
||||||
{
|
{
|
||||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||||
if (!effected.isPlayer())
|
if (effected.isPlayable())
|
||||||
{
|
{
|
||||||
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
if (effected.isSummon())
|
||||||
|
{
|
||||||
|
if ((effector != null) && !effector.isDead())
|
||||||
|
{
|
||||||
|
((L2Summon) effected).doAttack(effector);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, effected.getActingPlayer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@ import com.l2jmobius.gameserver.ai.CtrlEvent;
|
|||||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||||
import com.l2jmobius.gameserver.model.StatsSet;
|
import com.l2jmobius.gameserver.model.StatsSet;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
|
import com.l2jmobius.gameserver.model.actor.L2Summon;
|
||||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||||
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
import com.l2jmobius.gameserver.model.effects.EffectFlag;
|
||||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||||
@@ -66,13 +67,27 @@ public final class BlockActions extends AbstractEffect
|
|||||||
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
public void onExit(L2Character effector, L2Character effected, Skill skill)
|
||||||
{
|
{
|
||||||
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
_allowedSkills.stream().forEach(effected::removeBlockActionsAllowedSkill);
|
||||||
if (!effected.isPlayer())
|
if (effected.isPlayable())
|
||||||
{
|
{
|
||||||
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
if (effected.isSummon())
|
||||||
|
{
|
||||||
|
if ((effector != null) && !effector.isDead())
|
||||||
|
{
|
||||||
|
((L2Summon) effected).doAttack(effector);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, effected.getActingPlayer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effected.getAI().notifyEvent(CtrlEvent.EVT_THINK);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user