Reworked some scripts.

Contributed by Stayway, gigilo1968.
This commit is contained in:
MobiusDev
2017-05-28 18:37:26 +00:00
parent 9cb39dc889
commit 29042a9311
45 changed files with 487 additions and 390 deletions

View File

@@ -963,7 +963,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
}
// Notify to scripts
final TerminateReturn attackedReturn = EventDispatcher.getInstance().notifyEvent(new OnCreatureAttacked(this, target), target, TerminateReturn.class);
final TerminateReturn attackedReturn = EventDispatcher.getInstance().notifyEvent(new OnCreatureAttacked(this, target, null), target, TerminateReturn.class);
if ((attackedReturn != null) && attackedReturn.terminate())
{
getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);

View File

@@ -19,6 +19,7 @@ package com.l2jmobius.gameserver.model.events.impl.character;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.events.EventType;
import com.l2jmobius.gameserver.model.events.impl.IBaseEvent;
import com.l2jmobius.gameserver.model.skills.Skill;
/**
* An instantly executed event when L2Character is attacked by L2Character.
@@ -28,11 +29,13 @@ public class OnCreatureAttacked implements IBaseEvent
{
private final L2Character _attacker;
private final L2Character _target;
private final Skill _skill;
public OnCreatureAttacked(L2Character attacker, L2Character target)
public OnCreatureAttacked(L2Character attacker, L2Character target, Skill skill)
{
_attacker = attacker;
_target = target;
_skill = skill;
}
public final L2Character getAttacker()
@@ -45,6 +48,11 @@ public class OnCreatureAttacked implements IBaseEvent
return _target;
}
public final Skill getSkill()
{
return _skill;
}
@Override
public EventType getType()
{