Attempt to fix YeSagiraGuards onEvtThink issue.
This commit is contained in:
@@ -48,7 +48,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
||||||
{
|
{
|
||||||
if (monster.isScriptValue(0)) // not retail - but looks better
|
if ((monster != null) && monster.isScriptValue(0)) // not retail - but looks better
|
||||||
{
|
{
|
||||||
monster.setScriptValue(1);
|
monster.setScriptValue(1);
|
||||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||||
|
@@ -1079,8 +1079,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
@Override
|
@Override
|
||||||
protected void onEvtThink()
|
protected void onEvtThink()
|
||||||
{
|
{
|
||||||
// Check if the actor can't use skills and if a thinking action isn't already in progress
|
// Check if the actor can't use skills
|
||||||
if (_thinking || getActiveChar().isAllSkillsDisabled())
|
if (getActiveChar().isAllSkillsDisabled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Check if a thinking action isn't already in progress
|
||||||
|
if (_thinking)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1112,14 +1117,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, this + " - onEvtThink() failed", e);
|
LOGGER.log(Level.WARNING, this + " - " + getIntention().toString() + " - onEvtThink() failed", e);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
// Finish thinking action
|
||||||
// Stop thinking action
|
|
||||||
_thinking = false;
|
_thinking = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch actions corresponding to the Event Attacked.<br>
|
* Launch actions corresponding to the Event Attacked.<br>
|
||||||
|
@@ -48,7 +48,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
||||||
{
|
{
|
||||||
if (monster.isScriptValue(0)) // not retail - but looks better
|
if ((monster != null) && monster.isScriptValue(0)) // not retail - but looks better
|
||||||
{
|
{
|
||||||
monster.setScriptValue(1);
|
monster.setScriptValue(1);
|
||||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||||
|
@@ -1079,8 +1079,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
@Override
|
@Override
|
||||||
protected void onEvtThink()
|
protected void onEvtThink()
|
||||||
{
|
{
|
||||||
// Check if the actor can't use skills and if a thinking action isn't already in progress
|
// Check if the actor can't use skills
|
||||||
if (_thinking || getActiveChar().isAllSkillsDisabled())
|
if (getActiveChar().isAllSkillsDisabled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Check if a thinking action isn't already in progress
|
||||||
|
if (_thinking)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1112,14 +1117,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, this + " - onEvtThink() failed", e);
|
LOGGER.log(Level.WARNING, this + " - " + getIntention().toString() + " - onEvtThink() failed", e);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
// Finish thinking action
|
||||||
// Stop thinking action
|
|
||||||
_thinking = false;
|
_thinking = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch actions corresponding to the Event Attacked.<br>
|
* Launch actions corresponding to the Event Attacked.<br>
|
||||||
|
@@ -48,7 +48,7 @@ public final class YeSagiraGuards extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
L2World.getInstance().forEachVisibleObjectInRange(npc, L2MonsterInstance.class, 1000, monster ->
|
||||||
{
|
{
|
||||||
if (monster.isScriptValue(0)) // not retail - but looks better
|
if ((monster != null) && monster.isScriptValue(0)) // not retail - but looks better
|
||||||
{
|
{
|
||||||
monster.setScriptValue(1);
|
monster.setScriptValue(1);
|
||||||
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
npc.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||||
|
@@ -1079,8 +1079,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
@Override
|
@Override
|
||||||
protected void onEvtThink()
|
protected void onEvtThink()
|
||||||
{
|
{
|
||||||
// Check if the actor can't use skills and if a thinking action isn't already in progress
|
// Check if the actor can't use skills
|
||||||
if (_thinking || getActiveChar().isAllSkillsDisabled())
|
if (getActiveChar().isAllSkillsDisabled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Check if a thinking action isn't already in progress
|
||||||
|
if (_thinking)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1112,14 +1117,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, this + " - onEvtThink() failed", e);
|
LOGGER.log(Level.WARNING, this + " - " + getIntention().toString() + " - onEvtThink() failed", e);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
// Finish thinking action
|
||||||
// Stop thinking action
|
|
||||||
_thinking = false;
|
_thinking = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch actions corresponding to the Event Attacked.<br>
|
* Launch actions corresponding to the Event Attacked.<br>
|
||||||
|
@@ -1079,8 +1079,13 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
@Override
|
@Override
|
||||||
protected void onEvtThink()
|
protected void onEvtThink()
|
||||||
{
|
{
|
||||||
// Check if the actor can't use skills and if a thinking action isn't already in progress
|
// Check if the actor can't use skills
|
||||||
if (_thinking || getActiveChar().isAllSkillsDisabled())
|
if (getActiveChar().isAllSkillsDisabled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Check if a thinking action isn't already in progress
|
||||||
|
if (_thinking)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1112,14 +1117,12 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, this + " - onEvtThink() failed", e);
|
LOGGER.log(Level.WARNING, this + " - " + getIntention().toString() + " - onEvtThink() failed", e);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
// Finish thinking action
|
||||||
// Stop thinking action
|
|
||||||
_thinking = false;
|
_thinking = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch actions corresponding to the Event Attacked.<br>
|
* Launch actions corresponding to the Event Attacked.<br>
|
||||||
|
Reference in New Issue
Block a user