Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: java/com/l2jserver/gameserver/ai/L2AttackableAI.java
- ===================================================================
- --- java/com/l2jserver/gameserver/ai/L2AttackableAI.java (revision 85)
- +++ java/com/l2jserver/gameserver/ai/L2AttackableAI.java (working copy)
- @@ -29,7 +29,9 @@
- import com.l2jserver.gameserver.ThreadPoolManager;
- import com.l2jserver.gameserver.datatables.NpcTable;
- import com.l2jserver.gameserver.instancemanager.DimensionalRiftManager;
- +import com.l2jserver.gameserver.model.CharEffectList;
- import com.l2jserver.gameserver.model.L2CharPosition;
- +import com.l2jserver.gameserver.model.L2Effect;
- import com.l2jserver.gameserver.model.L2Object;
- import com.l2jserver.gameserver.model.L2Skill;
- import com.l2jserver.gameserver.model.L2Skill.SkillTargetType;
- @@ -467,17 +469,31 @@
- continue;
- }
- + boolean drawsAggression = target.isAffected(CharEffectList.EFFECT_DRAW_AGGRESSION);
- +
- // 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
- + if (autoAttackCondition(target) || drawsAggression) // check aggression
- {
- // Get the hate level of the L2Attackable against this L2Character target contained in _aggroList
- int hating = npc.getHating(target);
- // Add the attacker to the L2Attackable _aggroList with 0 damage and 1 hate
- if (hating == 0)
- - npc.addDamageHate(target, 0, 0);
- + {
- + // EffectDrawAggression handling
- + if (drawsAggression)
- + {
- + L2Effect eff = target.getFirstEffect(L2EffectType.DRAW_AGGRESSION);
- +
- + // If the target has draw aggression effect and the npc is inside the skill radius, add hate depending on the effect power.
- + if (eff != null && npc.isInsideRadius(target, eff.getSkill().getSkillRadius(), false, true))
- + npc.addDamageHate(target, 0, (int)eff.getEffectPower());
- + }
- + else
- + npc.addDamageHate(target, 0, 0);
- + }
- }
- }
- Index: java/com/l2jserver/gameserver/model/CharEffectList.java
- ===================================================================
- --- java/com/l2jserver/gameserver/model/CharEffectList.java (revision 85)
- +++ java/com/l2jserver/gameserver/model/CharEffectList.java (working copy)
- @@ -66,6 +66,7 @@
- public static final int EFFECT_FLAG_INVUL = 0x40000;
- public static final int EFFECT_FLAG_PARALYZED = 0x80000;
- public static final int EFFECT_FLAG_BLOCK_RESURRECTION = 0x100000;
- + public static final int EFFECT_DRAW_AGGRESSION = 0x200000;
- private FastList<L2Effect> _buffs;
- private FastList<L2Effect> _debuffs;
- Index: java/com/l2jserver/gameserver/skills/effects/EffectDrawAggression.java
- ===================================================================
- --- java/com/l2jserver/gameserver/skills/effects/EffectDrawAggression.java (revision 0)
- +++ java/com/l2jserver/gameserver/skills/effects/EffectDrawAggression.java (revision 0)
- @@ -0,0 +1,52 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package com.l2jserver.gameserver.skills.effects;
- +
- +import com.l2jserver.gameserver.model.CharEffectList;
- +import com.l2jserver.gameserver.model.L2Effect;
- +import com.l2jserver.gameserver.skills.Env;
- +import com.l2jserver.gameserver.templates.effects.EffectTemplate;
- +import com.l2jserver.gameserver.templates.skills.L2EffectType;
- +
- +public class EffectDrawAggression extends L2Effect
- +{
- + public EffectDrawAggression(Env env, EffectTemplate template)
- + {
- + super(env, template);
- + }
- +
- + /**
- + *
- + * @see com.l2jserver.gameserver.model.L2Effect#getEffectType()
- + */
- + @Override
- + public L2EffectType getEffectType()
- + {
- + return L2EffectType.DRAW_AGGRESSION;
- + }
- +
- + @Override
- + public int getEffectFlags()
- + {
- + return CharEffectList.EFFECT_DRAW_AGGRESSION;
- + }
- +
- + @Override
- + public boolean onActionTime()
- + {
- + // Simply stop the effect
- + return false;
- + }
- +}
- Index: java/com/l2jserver/gameserver/templates/skills/L2EffectType.java
- ===================================================================
- --- java/com/l2jserver/gameserver/templates/skills/L2EffectType.java (revision 85)
- +++ java/com/l2jserver/gameserver/templates/skills/L2EffectType.java (working copy)
- @@ -79,5 +79,6 @@
- ABORT_CAST,
- INCREASE_CHARGES,
- BLOCK_RESURRECTION,
- - DAMAGE_TRANSFER
- + DAMAGE_TRANSFER,
- + DRAW_AGGRESSION
- }
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement