Monsters should not use heal skills on characters.

This commit is contained in:
MobiusDev 2019-02-17 08:36:58 +00:00
parent 327e23d67c
commit 6943ed2f94
10 changed files with 50 additions and 10 deletions

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);

View File

@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
import com.l2jmobius.gameserver.model.effects.EffectFlag; import com.l2jmobius.gameserver.model.effects.EffectFlag;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.skills.SkillCaster;
import com.l2jmobius.gameserver.util.MinionList; import com.l2jmobius.gameserver.util.MinionList;
/** /**
@ -248,7 +249,10 @@ public class L2MonsterInstance extends L2Attackable
// Might need some exceptions here, but it will prevent the monster buffing player bug. // Might need some exceptions here, but it will prevent the monster buffing player bug.
if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer()) if (!skill.isBad() && (getTarget() != null) && getTarget().isPlayer())
{ {
abortCast(); for (SkillCaster skillCaster : getSkillCasters())
{
skillCaster.stopCasting(true);
}
return; return;
} }
super.doCast(skill, item, ctrlPressed, shiftPressed); super.doCast(skill, item, ctrlPressed, shiftPressed);