Removed AttackableAI casting skills with the onIntentionAttack method.
Contributed by Trance.
This commit is contained in:
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -913,7 +913,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
|
|
||||||
final WorldObject oldTarget = _actor.getTarget();
|
final WorldObject oldTarget = _actor.getTarget();
|
||||||
clientStopMoving(null);
|
clientStopMoving(null);
|
||||||
|
|
||||||
_accessor.doCast(sk);
|
_accessor.doCast(sk);
|
||||||
_actor.setTarget(oldTarget);
|
_actor.setTarget(oldTarget);
|
||||||
return;
|
return;
|
||||||
|
@@ -112,7 +112,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
/** The flag used to indicate that a thinking action is in progress, to prevent recursive thinking. */
|
/** The flag used to indicate that a thinking action is in progress, to prevent recursive thinking. */
|
||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
private int _chaosTime = 0;
|
private int _chaosTime = 0;
|
||||||
private int _lastBuffTick;
|
|
||||||
// Fear parameters
|
// Fear parameters
|
||||||
private int _fearTime;
|
private int _fearTime;
|
||||||
private Future<?> _fearTask = null;
|
private Future<?> _fearTask = null;
|
||||||
@@ -381,22 +380,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((_lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
if (checkSkillCastConditions(getActiveChar(), buff) && !_actor.isAffectedBySkill(buff.getId()))
|
|
||||||
{
|
|
||||||
_actor.setTarget(_actor);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
_actor.setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -1834,16 +1817,19 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Character is in "skill disabled" mode.
|
// Character is in "skill disabled" mode.
|
||||||
if (caster.isSkillDisabled(skill))
|
if (caster.isSkillDisabled(skill))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If is a static skill and magic skill and character is muted or is a physical skill muted and character is physically muted.
|
// If is a static skill and magic skill and character is muted or is a physical skill muted and character is physically muted.
|
||||||
if (!skill.isStatic() && ((skill.isMagic() && caster.isMuted()) || caster.isPhysicalMuted()))
|
if (!skill.isStatic() && ((skill.isMagic() && caster.isMuted()) || caster.isPhysicalMuted()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1853,6 +1839,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Attackable actor = getActiveChar();
|
final Attackable actor = getActiveChar();
|
||||||
if (!sk.hasEffectType(EffectType.DISPEL, EffectType.DISPEL_BY_SLOT))
|
if (!sk.hasEffectType(EffectType.DISPEL, EffectType.DISPEL_BY_SLOT))
|
||||||
{
|
{
|
||||||
|
@@ -112,7 +112,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
/** The flag used to indicate that a thinking action is in progress, to prevent recursive thinking. */
|
/** The flag used to indicate that a thinking action is in progress, to prevent recursive thinking. */
|
||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
private int _chaosTime = 0;
|
private int _chaosTime = 0;
|
||||||
private int _lastBuffTick;
|
|
||||||
// Fear parameters
|
// Fear parameters
|
||||||
private int _fearTime;
|
private int _fearTime;
|
||||||
private Future<?> _fearTask = null;
|
private Future<?> _fearTask = null;
|
||||||
@@ -381,22 +380,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((_lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
if (checkSkillCastConditions(getActiveChar(), buff) && !_actor.isAffectedBySkill(buff.getId()))
|
|
||||||
{
|
|
||||||
_actor.setTarget(_actor);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
_actor.setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -1834,16 +1817,19 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Character is in "skill disabled" mode.
|
// Character is in "skill disabled" mode.
|
||||||
if (caster.isSkillDisabled(skill))
|
if (caster.isSkillDisabled(skill))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If is a static skill and magic skill and character is muted or is a physical skill muted and character is physically muted.
|
// If is a static skill and magic skill and character is muted or is a physical skill muted and character is physically muted.
|
||||||
if (!skill.isStatic() && ((skill.isMagic() && caster.isMuted()) || caster.isPhysicalMuted()))
|
if (!skill.isStatic() && ((skill.isMagic() && caster.isMuted()) || caster.isPhysicalMuted()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1853,6 +1839,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Attackable actor = getActiveChar();
|
final Attackable actor = getActiveChar();
|
||||||
if (!sk.hasEffectType(EffectType.DISPEL, EffectType.DISPEL_BY_SLOT))
|
if (!sk.hasEffectType(EffectType.DISPEL, EffectType.DISPEL_BY_SLOT))
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
private boolean _thinking;
|
private boolean _thinking;
|
||||||
|
|
||||||
private int chaostime = 0;
|
private int chaostime = 0;
|
||||||
int lastBuffTick;
|
|
||||||
|
|
||||||
public AttackableAI(Attackable attackable)
|
public AttackableAI(Attackable attackable)
|
||||||
{
|
{
|
||||||
@@ -267,23 +266,6 @@ public class AttackableAI extends CreatureAI
|
|||||||
// Calculate the attack timeout
|
// Calculate the attack timeout
|
||||||
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
_attackTimeout = MAX_ATTACK_TIMEOUT + GameTimeController.getInstance().getGameTicks();
|
||||||
|
|
||||||
// self and buffs
|
|
||||||
if ((lastBuffTick + 30) < GameTimeController.getInstance().getGameTicks())
|
|
||||||
{
|
|
||||||
for (Skill buff : getActiveChar().getTemplate().getAISkills(AISkillScope.BUFF))
|
|
||||||
{
|
|
||||||
final Creature buffTarget = skillTargetReconsider(buff, true);
|
|
||||||
if (buffTarget != null)
|
|
||||||
{
|
|
||||||
setTarget(buffTarget);
|
|
||||||
_actor.doCast(buff);
|
|
||||||
setTarget(target);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lastBuffTick = GameTimeController.getInstance().getGameTicks();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
// Manage the Attack Intention : Stop current Attack (if necessary), Start a new Attack and Launch Think Event
|
||||||
super.onIntentionAttack(target);
|
super.onIntentionAttack(target);
|
||||||
}
|
}
|
||||||
@@ -295,10 +277,12 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
if (maybeMoveToPawn(target, _actor.getMagicalAttackRange(_skill)))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIntention(AI_INTENTION_ACTIVE);
|
setIntention(AI_INTENTION_ACTIVE);
|
||||||
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
_actor.doCast(_skill, _item, _forceUse, _dontMove);
|
||||||
}
|
}
|
||||||
@@ -316,6 +300,7 @@ public class AttackableAI extends CreatureAI
|
|||||||
{
|
{
|
||||||
final Attackable npc = getActiveChar();
|
final Attackable npc = getActiveChar();
|
||||||
WorldObject target = getTarget();
|
WorldObject target = getTarget();
|
||||||
|
|
||||||
// Update every 1s the _globalAggro counter to come close to 0
|
// Update every 1s the _globalAggro counter to come close to 0
|
||||||
if (_globalAggro != 0)
|
if (_globalAggro != 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user