From 34f61012cfc72386fafe142843f31d75e2883f46 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 20 Sep 2018 11:36:28 +0000 Subject: [PATCH] Improved GetAgro effect according to retail observations. --- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 29 +++++++++++++++++-- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- .../handlers/effecthandlers/GetAgro.java | 22 +++++++++++++- 11 files changed, 236 insertions(+), 13 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 71ba81b430..e35e8732c6 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,8 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; +import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.conditions.Condition; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; @@ -25,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.BuffInfo; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -49,9 +55,26 @@ public final class GetAgro extends AbstractEffect @Override public void onStart(BuffInfo info) { - if ((info.getEffected() != null) && info.getEffected().isAttackable()) + final L2Character effected = info.getEffected(); + if ((effected != null) && effected.isAttackable()) { - info.getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, info.getEffector()); + final L2Character effector = info.getEffector(); + effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java index 0298934d56..169cec6162 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/GetAgro.java @@ -16,9 +16,14 @@ */ package handlers.effecthandlers; +import java.util.Set; + import com.l2jmobius.gameserver.ai.CtrlIntention; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.L2Character; +import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; @@ -26,7 +31,7 @@ import com.l2jmobius.gameserver.model.skills.Skill; /** * Get Agro effect implementation. - * @author Adry_85 + * @author Adry_85, Mobius */ public final class GetAgro extends AbstractEffect { @@ -52,6 +57,21 @@ public final class GetAgro extends AbstractEffect if ((effected != null) && effected.isAttackable()) { effected.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + + // Monsters from the same clan should assist. + final L2NpcTemplate template = ((L2Attackable) effected).getTemplate(); + final Set clans = template.getClans(); + if (clans != null) + { + for (L2Attackable nearby : L2World.getInstance().getVisibleObjectsInRange(effected, L2Attackable.class, template.getClanHelpRange())) + { + if (!nearby.isMovementDisabled() && nearby.getTemplate().isClan(clans)) + { + nearby.addDamageHate(effector, 200, 200); + nearby.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, effector); + } + } + } } } }