|
@@ -484,31 +484,31 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (obj.isPlayable())
|
|
|
+ // TODO: The AI Script ought to handle aggro behaviors in onSee. Once implemented, aggro behaviors ought
|
|
|
+ // to be removed from here. (Fulminus)
|
|
|
+ // For each L2Character check if the target is autoattackable
|
|
|
+ if (autoAttackCondition(target)) // check aggression
|
|
|
{
|
|
|
- final List<Quest> quests = getActiveChar().getTemplate().getEventQuests(QuestEventType.ON_NPC_HATE);
|
|
|
- if (quests != null)
|
|
|
+ if (target.isPlayable())
|
|
|
{
|
|
|
- boolean breaking = false;
|
|
|
- for (Quest q : quests)
|
|
|
+ final List<Quest> quests = getActiveChar().getTemplate().getEventQuests(QuestEventType.ON_NPC_HATE);
|
|
|
+ if (quests != null)
|
|
|
{
|
|
|
- if (!q.onNpcHate(getActiveChar(), (L2Playable) obj))
|
|
|
+ boolean breaking = false;
|
|
|
+ for (Quest q : quests)
|
|
|
{
|
|
|
- breaking = true;
|
|
|
+ if (!q.onNpcHate(getActiveChar(), (L2Playable) target))
|
|
|
+ {
|
|
|
+ breaking = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (breaking)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
}
|
|
|
- }
|
|
|
- if (breaking)
|
|
|
- {
|
|
|
- continue;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- // TODO: The AI Script ought to handle aggro behaviors in onSee. Once implemented, aggro behaviors ought
|
|
|
- // to be removed from here. (Fulminus)
|
|
|
- // For each L2Character check if the target is autoattackable
|
|
|
- if (autoAttackCondition(target)) // check aggression
|
|
|
- {
|
|
|
+
|
|
|
// Get the hate level of the L2Attackable against this L2Character target contained in _aggroList
|
|
|
int hating = npc.getHating(target);
|
|
|
|