From cbfcbf0cd6328fa75c4d5086c0a631936727221a Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 24 Sep 2016 17:36:59 +0000 Subject: [PATCH] Fixed monsters buffing players. --- .../model/actor/instance/L2MonsterInstance.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java index 0cb4625c5e..e9a9976e87 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2MonsterInstance.java @@ -23,6 +23,8 @@ import com.l2jmobius.gameserver.enums.InstanceType; 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.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.util.MinionList; /** @@ -239,4 +241,15 @@ public class L2MonsterInstance extends L2Attackable { return (isRaidMinion() && (getLeader() != null)) ? getLeader().giveRaidCurse() : super.giveRaidCurse(); } + + @Override + public synchronized void doCast(Skill skill, L2ItemInstance item, boolean ctrlPressed, boolean shiftPressed) + { + // Might need some exceptions here, but it will prevent the monster buffing player bug. + if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) + { + return; + } + super.doCast(skill, item, ctrlPressed, shiftPressed); + } }