Fixed monsters buffing players.

This commit is contained in:
MobiusDev
2016-09-24 17:36:59 +00:00
parent a0de93d6c6
commit cbfcbf0cd6

View File

@ -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);
}
}