Dropped L2QuestGuardInstance.
This commit is contained in:
parent
e971fbf3b8
commit
1b17669d5b
@ -23,8 +23,8 @@ import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.Id;
|
||||
@ -149,7 +149,7 @@ public final class Wastelands extends AbstractNpcAI
|
||||
if (guard.getId() == SCHUAZEN)
|
||||
{
|
||||
//@formatter:off
|
||||
final L2QuestGuardInstance decoGuard = (L2QuestGuardInstance) L2World.getInstance().getVisibleObjects(guard, L2Npc.class, 500)
|
||||
final FriendlyNpcInstance decoGuard = (FriendlyNpcInstance) L2World.getInstance().getVisibleObjects(guard, L2Npc.class, 500)
|
||||
.stream()
|
||||
.filter(obj -> (obj.getId() == DECO_GUARD2))
|
||||
.findFirst()
|
||||
@ -202,7 +202,7 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
final int guardId = npc.getId() == REGENERATED_KANILOV ? JOEL : SCHUAZEN;
|
||||
//@formatter:off
|
||||
final L2QuestGuardInstance guard = (L2QuestGuardInstance) L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 500)
|
||||
final FriendlyNpcInstance guard = (FriendlyNpcInstance) L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 500)
|
||||
.stream()
|
||||
.filter(obj -> (obj.getId() == guardId))
|
||||
.findFirst()
|
||||
|
@ -30,10 +30,10 @@ import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
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.instance.L2RaidBossInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@ -430,14 +430,14 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
||||
freya.disableCoreAI(false);
|
||||
manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4);
|
||||
|
||||
final L2QuestGuardInstance jinia = (L2QuestGuardInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
|
||||
final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
|
||||
jinia.setIsRunning(true);
|
||||
jinia.setIsInvul(true);
|
||||
jinia.setCanReturnToSpawnPoint(false);
|
||||
jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
|
||||
freya.reduceCurrentHp(1, jinia, null);
|
||||
|
||||
final L2QuestGuardInstance kegor = (L2QuestGuardInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
|
||||
final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
|
||||
kegor.setIsRunning(true);
|
||||
kegor.setIsInvul(true);
|
||||
kegor.setCanReturnToSpawnPoint(false);
|
||||
|
@ -19,8 +19,8 @@ package quests.Q10791_TheManOfMystery;
|
||||
import com.l2jmobius.gameserver.enums.QuestSound;
|
||||
import com.l2jmobius.gameserver.enums.Race;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
import com.l2jmobius.gameserver.model.base.ClassId;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
import com.l2jmobius.gameserver.model.quest.QuestState;
|
||||
@ -187,7 +187,7 @@ public class Q10791_TheManOfMystery extends Quest
|
||||
if (kills >= 5)
|
||||
{
|
||||
final L2Npc monster = addSpawn(NEEDLE_STAKATO_CAPTAIN, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 600000, false);
|
||||
final L2QuestGuardInstance kain = (L2QuestGuardInstance) addSpawn(KAIN_VAN_HALTER, killer.getX() + getRandom(-100, 100), killer.getY() + getRandom(-100, 100), killer.getZ(), 0, true, 300000, false);
|
||||
final FriendlyNpcInstance kain = (FriendlyNpcInstance) addSpawn(KAIN_VAN_HALTER, killer.getX() + getRandom(-100, 100), killer.getY() + getRandom(-100, 100), killer.getZ(), 0, true, 300000, false);
|
||||
kain.setRunning();
|
||||
kain.setIsInvul(true);
|
||||
kain.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
|
@ -1846,7 +1846,7 @@
|
||||
<height normal="0.1" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18846" level="85" type="L2QuestGuard" name="Kegor">
|
||||
<npc id="18846" level="85" type="FriendlyNpc" name="Kegor">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Buff" id="6286" level="1" />
|
||||
@ -1924,7 +1924,7 @@
|
||||
<height normal="98.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18848" level="85" type="L2QuestGuard" name="Battalion Leader" title="Jinia Guild">
|
||||
<npc id="18848" level="85" type="FriendlyNpc" name="Battalion Leader" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="10" />
|
||||
@ -1963,7 +1963,7 @@
|
||||
<height normal="23.75" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18849" level="85" type="L2QuestGuard" name="Legionnaire" title="Jinia Guild">
|
||||
<npc id="18849" level="85" type="FriendlyNpc" name="Legionnaire" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="10" />
|
||||
@ -2002,7 +2002,7 @@
|
||||
<height normal="30" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18850" level="85" type="L2QuestGuard" name="Jinia">
|
||||
<npc id="18850" level="85" type="FriendlyNpc" name="Jinia">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="6641" level="1" />
|
||||
@ -2042,7 +2042,7 @@
|
||||
<height normal="23.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18851" level="85" type="L2QuestGuard" name="Kegor">
|
||||
<npc id="18851" level="85" type="FriendlyNpc" name="Kegor">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="6643" level="1" />
|
||||
|
@ -1258,7 +1258,7 @@
|
||||
<height normal="13" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18926" level="85" type="L2QuestGuard" name="Mercenary Archer" title="Jinia Guild">
|
||||
<npc id="18926" level="85" type="FriendlyNpc" name="Mercenary Archer" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="9" />
|
||||
|
@ -951,7 +951,7 @@
|
||||
<height normal="0.1" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19126" level="30" type="L2QuestGuard" name="Commando">
|
||||
<npc id="19126" level="30" type="FriendlyNpc" name="Commando">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
@ -977,7 +977,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19127" level="30" type="L2QuestGuard" name="Commando Captain">
|
||||
<npc id="19127" level="30" type="FriendlyNpc" name="Commando Captain">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
@ -1972,7 +1972,7 @@
|
||||
<height normal="22.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19163" level="1" type="L2QuestGuard" name="Wastelands Decoration 1">
|
||||
<npc id="19163" level="1" type="FriendlyNpc" name="Wastelands Decoration 1">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -3829,7 +3829,7 @@
|
||||
<height normal="58.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="32299" level="70" type="L2QuestGuard" name="Quarry Slave">
|
||||
<npc id="32299" level="70" type="FriendlyNpc" name="Quarry Slave">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<race>HUMANOID</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -2189,7 +2189,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="32358" level="70" type="L2QuestGuard" name="Native Prisoner">
|
||||
<npc id="32358" level="70" type="FriendlyNpc" name="Native Prisoner">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -135,7 +135,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33004" level="85" type="L2QuestGuard" name="Toyron" title="Museum Keeper">
|
||||
<npc id="33004" level="85" type="FriendlyNpc" name="Toyron" title="Museum Keeper">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
|
@ -550,7 +550,7 @@
|
||||
<height normal="23" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33516" level="40" type="L2QuestGuard" name="Joel" title="Guard">
|
||||
<npc id="33516" level="40" type="FriendlyNpc" name="Joel" title="Guard">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
@ -584,7 +584,7 @@
|
||||
<height normal="25" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33517" level="40" type="L2QuestGuard" name="Schuazen" title="Guard">
|
||||
<npc id="33517" level="40" type="FriendlyNpc" name="Schuazen" title="Guard">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
|
@ -1044,7 +1044,7 @@
|
||||
<height normal="17" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33735" level="75" type="L2QuestGuard" name="Flame Flower">
|
||||
<npc id="33735" level="75" type="FriendlyNpc" name="Flame Flower">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>CONSTRUCT</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -2098,7 +2098,7 @@
|
||||
<height normal="66" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33993" level="85" type="L2QuestGuard" name="Kain van Halter" title="Mysterious Man">
|
||||
<npc id="33993" level="85" type="FriendlyNpc" name="Kain van Halter" title="Mysterious Man">
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
<equipment rhand="2626" /> <!-- rhand: Samurai Long Sword*Samurai Long Sword -->
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -23,8 +23,8 @@ import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.Id;
|
||||
@ -149,7 +149,7 @@ public final class Wastelands extends AbstractNpcAI
|
||||
if (guard.getId() == SCHUAZEN)
|
||||
{
|
||||
//@formatter:off
|
||||
final L2QuestGuardInstance decoGuard = (L2QuestGuardInstance) L2World.getInstance().getVisibleObjects(guard, L2Npc.class, 500)
|
||||
final FriendlyNpcInstance decoGuard = (FriendlyNpcInstance) L2World.getInstance().getVisibleObjects(guard, L2Npc.class, 500)
|
||||
.stream()
|
||||
.filter(obj -> (obj.getId() == DECO_GUARD2))
|
||||
.findFirst()
|
||||
@ -202,7 +202,7 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
final int guardId = npc.getId() == REGENERATED_KANILOV ? JOEL : SCHUAZEN;
|
||||
//@formatter:off
|
||||
final L2QuestGuardInstance guard = (L2QuestGuardInstance) L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 500)
|
||||
final FriendlyNpcInstance guard = (FriendlyNpcInstance) L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 500)
|
||||
.stream()
|
||||
.filter(obj -> (obj.getId() == guardId))
|
||||
.findFirst()
|
||||
|
@ -30,10 +30,10 @@ import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
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.instance.L2RaidBossInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@ -430,14 +430,14 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
||||
freya.disableCoreAI(false);
|
||||
manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4);
|
||||
|
||||
final L2QuestGuardInstance jinia = (L2QuestGuardInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
|
||||
final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
|
||||
jinia.setIsRunning(true);
|
||||
jinia.setIsInvul(true);
|
||||
jinia.setCanReturnToSpawnPoint(false);
|
||||
jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
|
||||
freya.reduceCurrentHp(1, jinia, null);
|
||||
|
||||
final L2QuestGuardInstance kegor = (L2QuestGuardInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
|
||||
final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
|
||||
kegor.setIsRunning(true);
|
||||
kegor.setIsInvul(true);
|
||||
kegor.setCanReturnToSpawnPoint(false);
|
||||
|
@ -19,8 +19,8 @@ package quests.Q10791_TheManOfMystery;
|
||||
import com.l2jmobius.gameserver.enums.QuestSound;
|
||||
import com.l2jmobius.gameserver.enums.Race;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
import com.l2jmobius.gameserver.model.base.ClassId;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
import com.l2jmobius.gameserver.model.quest.QuestState;
|
||||
@ -187,7 +187,7 @@ public class Q10791_TheManOfMystery extends Quest
|
||||
if (kills >= 5)
|
||||
{
|
||||
final L2Npc monster = addSpawn(NEEDLE_STAKATO_CAPTAIN, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 600000, false);
|
||||
final L2QuestGuardInstance kain = (L2QuestGuardInstance) addSpawn(KAIN_VAN_HALTER, killer.getX() + getRandom(-100, 100), killer.getY() + getRandom(-100, 100), killer.getZ(), 0, true, 300000, false);
|
||||
final FriendlyNpcInstance kain = (FriendlyNpcInstance) addSpawn(KAIN_VAN_HALTER, killer.getX() + getRandom(-100, 100), killer.getY() + getRandom(-100, 100), killer.getZ(), 0, true, 300000, false);
|
||||
kain.setRunning();
|
||||
kain.setIsInvul(true);
|
||||
kain.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
|
@ -1846,7 +1846,7 @@
|
||||
<height normal="0.1" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18846" level="85" type="L2QuestGuard" name="Kegor">
|
||||
<npc id="18846" level="85" type="FriendlyNpc" name="Kegor">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Buff" id="6286" level="1" />
|
||||
@ -1924,7 +1924,7 @@
|
||||
<height normal="98.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18848" level="85" type="L2QuestGuard" name="Battalion Leader" title="Jinia Guild">
|
||||
<npc id="18848" level="85" type="FriendlyNpc" name="Battalion Leader" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="10" />
|
||||
@ -1963,7 +1963,7 @@
|
||||
<height normal="23.75" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18849" level="85" type="L2QuestGuard" name="Legionnaire" title="Jinia Guild">
|
||||
<npc id="18849" level="85" type="FriendlyNpc" name="Legionnaire" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="10" />
|
||||
@ -2002,7 +2002,7 @@
|
||||
<height normal="30" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18850" level="85" type="L2QuestGuard" name="Jinia">
|
||||
<npc id="18850" level="85" type="FriendlyNpc" name="Jinia">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="6641" level="1" />
|
||||
@ -2042,7 +2042,7 @@
|
||||
<height normal="23.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18851" level="85" type="L2QuestGuard" name="Kegor">
|
||||
<npc id="18851" level="85" type="FriendlyNpc" name="Kegor">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="6643" level="1" />
|
||||
|
@ -1258,7 +1258,7 @@
|
||||
<height normal="13" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18926" level="85" type="L2QuestGuard" name="Mercenary Archer" title="Jinia Guild">
|
||||
<npc id="18926" level="85" type="FriendlyNpc" name="Mercenary Archer" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="9" />
|
||||
|
@ -951,7 +951,7 @@
|
||||
<height normal="0.1" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19126" level="30" type="L2QuestGuard" name="Commando" title="">
|
||||
<npc id="19126" level="30" type="FriendlyNpc" name="Commando" title="">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
@ -977,7 +977,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19127" level="30" type="L2QuestGuard" name="Commando Captain" title="">
|
||||
<npc id="19127" level="30" type="FriendlyNpc" name="Commando Captain" title="">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
@ -1972,7 +1972,7 @@
|
||||
<height normal="22.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19163" level="1" type="L2QuestGuard" name="Wastelands Decoration 1" title="">
|
||||
<npc id="19163" level="1" type="FriendlyNpc" name="Wastelands Decoration 1" title="">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -3829,7 +3829,7 @@
|
||||
<height normal="58.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="32299" level="70" type="L2QuestGuard" name="Quarry Slave">
|
||||
<npc id="32299" level="70" type="FriendlyNpc" name="Quarry Slave">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<race>HUMANOID</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -2189,7 +2189,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="32358" level="70" type="L2QuestGuard" name="Native Prisoner">
|
||||
<npc id="32358" level="70" type="FriendlyNpc" name="Native Prisoner">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -135,7 +135,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33004" level="85" type="L2QuestGuard" name="Toyron" title="Museum Keeper">
|
||||
<npc id="33004" level="85" type="FriendlyNpc" name="Toyron" title="Museum Keeper">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
|
@ -550,7 +550,7 @@
|
||||
<height normal="23" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33516" level="40" type="L2QuestGuard" name="Joel" title="Guard">
|
||||
<npc id="33516" level="40" type="FriendlyNpc" name="Joel" title="Guard">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
@ -584,7 +584,7 @@
|
||||
<height normal="25" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33517" level="40" type="L2QuestGuard" name="Schuazen" title="Guard">
|
||||
<npc id="33517" level="40" type="FriendlyNpc" name="Schuazen" title="Guard">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
|
@ -1044,7 +1044,7 @@
|
||||
<height normal="17" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33735" level="75" type="L2QuestGuard" name="Flame Flower" title="">
|
||||
<npc id="33735" level="75" type="FriendlyNpc" name="Flame Flower" title="">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>CONSTRUCT</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -2098,7 +2098,7 @@
|
||||
<height normal="66" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33993" level="85" type="L2QuestGuard" name="Kain van Halter" title="Mysterious Man">
|
||||
<npc id="33993" level="85" type="FriendlyNpc" name="Kain van Halter" title="Mysterious Man">
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
<equipment rhand="2626" /> <!-- rhand: Samurai Long Sword*Samurai Long Sword -->
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -23,8 +23,8 @@ import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.Id;
|
||||
@ -149,7 +149,7 @@ public final class Wastelands extends AbstractNpcAI
|
||||
if (guard.getId() == SCHUAZEN)
|
||||
{
|
||||
//@formatter:off
|
||||
final L2QuestGuardInstance decoGuard = (L2QuestGuardInstance) L2World.getInstance().getVisibleObjects(guard, L2Npc.class, 500)
|
||||
final FriendlyNpcInstance decoGuard = (FriendlyNpcInstance) L2World.getInstance().getVisibleObjects(guard, L2Npc.class, 500)
|
||||
.stream()
|
||||
.filter(obj -> (obj.getId() == DECO_GUARD2))
|
||||
.findFirst()
|
||||
@ -202,7 +202,7 @@ public final class Wastelands extends AbstractNpcAI
|
||||
{
|
||||
final int guardId = npc.getId() == REGENERATED_KANILOV ? JOEL : SCHUAZEN;
|
||||
//@formatter:off
|
||||
final L2QuestGuardInstance guard = (L2QuestGuardInstance) L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 500)
|
||||
final FriendlyNpcInstance guard = (FriendlyNpcInstance) L2World.getInstance().getVisibleObjects(npc, L2Npc.class, 500)
|
||||
.stream()
|
||||
.filter(obj -> (obj.getId() == guardId))
|
||||
.findFirst()
|
||||
|
@ -30,10 +30,10 @@ import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
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.instance.L2RaidBossInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
import com.l2jmobius.gameserver.model.instancezone.Instance;
|
||||
@ -430,14 +430,14 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
||||
freya.disableCoreAI(false);
|
||||
manageScreenMsg(world, NpcStringId.BEGIN_STAGE_4);
|
||||
|
||||
final L2QuestGuardInstance jinia = (L2QuestGuardInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
|
||||
final FriendlyNpcInstance jinia = (FriendlyNpcInstance) addSpawn(SUPP_JINIA, SUPP_JINIA_SPAWN, false, 0, true, world.getId());
|
||||
jinia.setIsRunning(true);
|
||||
jinia.setIsInvul(true);
|
||||
jinia.setCanReturnToSpawnPoint(false);
|
||||
jinia.reduceCurrentHp(1, freya, null); // TODO: Find better way for attack
|
||||
freya.reduceCurrentHp(1, jinia, null);
|
||||
|
||||
final L2QuestGuardInstance kegor = (L2QuestGuardInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
|
||||
final FriendlyNpcInstance kegor = (FriendlyNpcInstance) addSpawn(SUPP_KEGOR, SUPP_KEGOR_SPAWN, false, 0, true, world.getId());
|
||||
kegor.setIsRunning(true);
|
||||
kegor.setIsInvul(true);
|
||||
kegor.setCanReturnToSpawnPoint(false);
|
||||
|
@ -24,8 +24,8 @@ import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventType;
|
||||
import com.l2jmobius.gameserver.model.events.ListenerRegisterType;
|
||||
import com.l2jmobius.gameserver.model.events.annotations.Id;
|
||||
@ -153,7 +153,7 @@ public final class MuseumDungeon extends AbstractInstance
|
||||
if (npc.isScriptValue(0) && (skill == SPOIL.getSkill()) && (caster.getTarget() == npc) && (npc.calculateDistance(caster, false, false) < 200))
|
||||
{
|
||||
final L2Npc toyron = npc.getInstanceWorld().getNpc(TOYRON);
|
||||
((L2QuestGuardInstance) toyron).addDamageHate(npc, 0, 9999); // TODO: Find better way for attack
|
||||
((FriendlyNpcInstance) toyron).addDamageHate(npc, 0, 9999); // TODO: Find better way for attack
|
||||
npc.reduceCurrentHp(1, toyron, null);
|
||||
npc.setScriptValue(1);
|
||||
}
|
||||
@ -277,7 +277,7 @@ public final class MuseumDungeon extends AbstractInstance
|
||||
}
|
||||
|
||||
final L2Npc toyron = instance.getNpc(TOYRON);
|
||||
((L2QuestGuardInstance) toyron).addDamageHate(target, 0, 9999); // TODO: Find better way for attack
|
||||
((FriendlyNpcInstance) toyron).addDamageHate(target, 0, 9999); // TODO: Find better way for attack
|
||||
target.reduceCurrentHp(1, toyron, null);
|
||||
((L2Npc) target).setScriptValue(1);
|
||||
return new DamageReturn(false, true, false, target.getMaxHp() * DAMAGE_BY_SKILL);
|
||||
|
@ -19,8 +19,8 @@ package quests.Q10791_TheManOfMystery;
|
||||
import com.l2jmobius.gameserver.enums.QuestSound;
|
||||
import com.l2jmobius.gameserver.enums.Race;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.FriendlyNpcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
import com.l2jmobius.gameserver.model.base.ClassId;
|
||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
||||
import com.l2jmobius.gameserver.model.quest.QuestState;
|
||||
@ -187,7 +187,7 @@ public class Q10791_TheManOfMystery extends Quest
|
||||
if (kills >= 5)
|
||||
{
|
||||
final L2Npc monster = addSpawn(NEEDLE_STAKATO_CAPTAIN, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 600000, false);
|
||||
final L2QuestGuardInstance kain = (L2QuestGuardInstance) addSpawn(KAIN_VAN_HALTER, killer.getX() + getRandom(-100, 100), killer.getY() + getRandom(-100, 100), killer.getZ(), 0, true, 300000, false);
|
||||
final FriendlyNpcInstance kain = (FriendlyNpcInstance) addSpawn(KAIN_VAN_HALTER, killer.getX() + getRandom(-100, 100), killer.getY() + getRandom(-100, 100), killer.getZ(), 0, true, 300000, false);
|
||||
kain.setRunning();
|
||||
kain.setIsInvul(true);
|
||||
kain.reduceCurrentHp(1, monster, null); // TODO: Find better way for attack
|
||||
|
@ -1846,7 +1846,7 @@
|
||||
<height normal="0.1" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18846" level="85" type="L2QuestGuard" name="Kegor">
|
||||
<npc id="18846" level="85" type="FriendlyNpc" name="Kegor">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Buff" id="6286" level="1" />
|
||||
@ -1924,7 +1924,7 @@
|
||||
<height normal="98.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18848" level="85" type="L2QuestGuard" name="Battalion Leader" title="Jinia Guild">
|
||||
<npc id="18848" level="85" type="FriendlyNpc" name="Battalion Leader" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="10" />
|
||||
@ -1963,7 +1963,7 @@
|
||||
<height normal="23.75" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18849" level="85" type="L2QuestGuard" name="Legionnaire" title="Jinia Guild">
|
||||
<npc id="18849" level="85" type="FriendlyNpc" name="Legionnaire" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="10" />
|
||||
@ -2002,7 +2002,7 @@
|
||||
<height normal="30" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18850" level="85" type="L2QuestGuard" name="Jinia">
|
||||
<npc id="18850" level="85" type="FriendlyNpc" name="Jinia">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="6641" level="1" />
|
||||
@ -2042,7 +2042,7 @@
|
||||
<height normal="23.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18851" level="85" type="L2QuestGuard" name="Kegor">
|
||||
<npc id="18851" level="85" type="FriendlyNpc" name="Kegor">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="6643" level="1" />
|
||||
|
@ -1178,7 +1178,7 @@
|
||||
<height normal="13" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="18926" level="85" type="L2QuestGuard" name="Mercenary Archer" title="Jinia Guild">
|
||||
<npc id="18926" level="85" type="FriendlyNpc" name="Mercenary Archer" title="Jinia Guild">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<parameters>
|
||||
<skill name="Skill01_ID" id="4032" level="9" />
|
||||
|
@ -822,7 +822,7 @@
|
||||
<height normal="0.1" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19126" level="30" type="L2QuestGuard" name="Commando" title="">
|
||||
<npc id="19126" level="30" type="FriendlyNpc" name="Commando" title="">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
@ -848,7 +848,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19127" level="30" type="L2QuestGuard" name="Commando Captain" title="">
|
||||
<npc id="19127" level="30" type="FriendlyNpc" name="Commando Captain" title="">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
@ -1843,7 +1843,7 @@
|
||||
<height normal="22.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="19163" level="1" type="L2QuestGuard" name="Wastelands Decoration 1" title="">
|
||||
<npc id="19163" level="1" type="FriendlyNpc" name="Wastelands Decoration 1" title="">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -3829,7 +3829,7 @@
|
||||
<height normal="58.5" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="32299" level="70" type="L2QuestGuard" name="Quarry Slave">
|
||||
<npc id="32299" level="70" type="FriendlyNpc" name="Quarry Slave">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<race>HUMANOID</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -2189,7 +2189,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="32358" level="70" type="L2QuestGuard" name="Native Prisoner">
|
||||
<npc id="32358" level="70" type="FriendlyNpc" name="Native Prisoner">
|
||||
<!-- Confirmed CT2.5 -->
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -135,7 +135,7 @@
|
||||
<height normal="24" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33004" level="85" type="L2QuestGuard" name="Toyron" title="Museum Keeper">
|
||||
<npc id="33004" level="85" type="FriendlyNpc" name="Toyron" title="Museum Keeper">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
|
@ -550,7 +550,7 @@
|
||||
<height normal="23" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33516" level="40" type="L2QuestGuard" name="Joel" title="Guard">
|
||||
<npc id="33516" level="40" type="FriendlyNpc" name="Joel" title="Guard">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
@ -584,7 +584,7 @@
|
||||
<height normal="25" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33517" level="40" type="L2QuestGuard" name="Schuazen" title="Guard">
|
||||
<npc id="33517" level="40" type="FriendlyNpc" name="Schuazen" title="Guard">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<parameters>
|
||||
<param name="MoveAroundSocial" value="200" />
|
||||
|
@ -1044,7 +1044,7 @@
|
||||
<height normal="17" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33735" level="75" type="L2QuestGuard" name="Flame Flower" title="">
|
||||
<npc id="33735" level="75" type="FriendlyNpc" name="Flame Flower" title="">
|
||||
<!-- AUTO GENERATED NPC TODO: FIX IT -->
|
||||
<race>CONSTRUCT</race>
|
||||
<sex>MALE</sex>
|
||||
|
@ -2098,7 +2098,7 @@
|
||||
<height normal="66" />
|
||||
</collision>
|
||||
</npc>
|
||||
<npc id="33993" level="85" type="L2QuestGuard" name="Kain van Halter" title="Mysterious Man">
|
||||
<npc id="33993" level="85" type="FriendlyNpc" name="Kain van Halter" title="Mysterious Man">
|
||||
<race>HUMAN</race>
|
||||
<sex>MALE</sex>
|
||||
<equipment rhand="2626" /> <!-- rhand: Samurai Long Sword*Samurai Long Sword -->
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user