Make use of onAttack with Skill parameter for some scripts.

Thanks to petryxa.
This commit is contained in:
MobiusDevelopment
2022-12-13 07:20:11 +00:00
parent 3f455121ef
commit 39fce1ade4
41 changed files with 123 additions and 82 deletions

View File

@@ -33,6 +33,7 @@ import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.type.WeaponType;
import org.l2jmobius.gameserver.model.siege.Castle;
import org.l2jmobius.gameserver.model.siege.Fort;
import org.l2jmobius.gameserver.model.skill.Skill;
import ai.AbstractNpcAI;
@@ -210,14 +211,14 @@ public class SiegeGuards extends AbstractNpcAI
}
@Override
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
public String onAttack(Npc npc, Player attacker, int damage, boolean isSummon, Skill skill)
{
if ((attacker.getSiegeState() == 2) && !attacker.isRegisteredOnThisSiegeField(npc.getScriptValue()))
{
((Attackable) npc).stopHating(attacker);
return null;
}
return super.onAttack(npc, attacker, damage, isSummon);
return super.onAttack(npc, attacker, damage, isSummon, skill);
}
@Override