Dropped L2QuestGuardInstance.
This commit is contained in:
@@ -42,7 +42,6 @@ public enum InstanceType
|
||||
// Attackable
|
||||
L2Attackable(L2Npc),
|
||||
L2GuardInstance(L2Attackable),
|
||||
L2QuestGuardInstance(L2GuardInstance),
|
||||
L2MonsterInstance(L2Attackable),
|
||||
L2BlockInstance(L2Attackable),
|
||||
L2ChestInstance(L2MonsterInstance),
|
||||
|
@@ -82,7 +82,6 @@ import com.l2jmobius.gameserver.model.TimeStamp;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.stat.CharStat;
|
||||
import com.l2jmobius.gameserver.model.actor.status.CharStatus;
|
||||
import com.l2jmobius.gameserver.model.actor.tasks.character.HitTask;
|
||||
@@ -3631,7 +3630,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
if (Config.PATHFINDING && ((originalDistance - distance) > 30) && !isControlBlocked() && !isInVehicle)
|
||||
{
|
||||
// Path calculation -- overrides previous movement check
|
||||
if (isPlayable() || isMinion() || isInCombat() || (this instanceof FriendlyNpcInstance) || (this instanceof L2QuestGuardInstance))
|
||||
if (isPlayable() || isMinion() || isInCombat() || (this instanceof FriendlyNpcInstance))
|
||||
{
|
||||
m.geoPath = GeoEngine.getInstance().findPath(curX, curY, curZ, originalX, originalY, originalZ, getInstanceWorld());
|
||||
if ((m.geoPath == null) || (m.geoPath.size() < 2)) // No path found
|
||||
|
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jmobius.gameserver.model.actor.instance;
|
||||
|
||||
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.events.EventDispatcher;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.npc.OnAttackableAttack;
|
||||
import com.l2jmobius.gameserver.model.events.impl.character.npc.OnAttackableKill;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
|
||||
/**
|
||||
* This class extends Guard class for quests, that require tracking of onAttack and onKill events from monsters' attacks.
|
||||
* @author GKR
|
||||
*/
|
||||
public final class L2QuestGuardInstance extends L2GuardInstance
|
||||
{
|
||||
private boolean _isAutoAttackable = true;
|
||||
private boolean _isPassive = false;
|
||||
|
||||
public L2QuestGuardInstance(L2NpcTemplate template)
|
||||
{
|
||||
super(template);
|
||||
setInstanceType(InstanceType.L2QuestGuardInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDamage(L2Character attacker, int damage, Skill skill)
|
||||
{
|
||||
super.addDamage(attacker, damage, skill);
|
||||
|
||||
if (attacker instanceof L2Attackable)
|
||||
{
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnAttackableAttack(null, this, damage, skill, false), this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doDie(L2Character killer)
|
||||
{
|
||||
// Kill the L2NpcInstance (the corpse disappeared after 7 seconds)
|
||||
if (!super.doDie(killer))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (killer instanceof L2Attackable)
|
||||
{
|
||||
// Delayed notification
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnAttackableKill(null, this, false), this);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDamageHate(L2Character attacker, int damage, int aggro)
|
||||
{
|
||||
if (!_isPassive && !(attacker instanceof L2PcInstance))
|
||||
{
|
||||
super.addDamageHate(attacker, damage, aggro);
|
||||
}
|
||||
}
|
||||
|
||||
public void setPassive(boolean state)
|
||||
{
|
||||
_isPassive = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoAttackable(L2Character attacker)
|
||||
{
|
||||
return _isAutoAttackable && !(attacker instanceof L2PcInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAutoAttackable(boolean state)
|
||||
{
|
||||
_isAutoAttackable = state;
|
||||
}
|
||||
|
||||
public boolean isPassive()
|
||||
{
|
||||
return _isPassive;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user