New addAttackDesire method.
This commit is contained in:
@@ -476,7 +476,7 @@ public final class CavernOfThePirateCaptain extends AbstractInstance
|
||||
if ((player != null) && (npcId != ZAKEN_60) && (npcId != ZAKEN_83))
|
||||
{
|
||||
final L2Attackable mob = (L2Attackable) addSpawn(npcId, ROOM_DATA[roomId - 1][0] + getRandom(350), ROOM_DATA[roomId - 1][1] + getRandom(350), ROOM_DATA[roomId - 1][2], 0, false, 0, false, world.getInstanceId());
|
||||
addAttackPlayerDesire(mob, player);
|
||||
addAttackDesire(mob, player);
|
||||
return mob;
|
||||
}
|
||||
return (L2Attackable) addSpawn(npcId, ROOM_DATA[roomId - 1][0], ROOM_DATA[roomId - 1][1], ROOM_DATA[roomId - 1][2], 0, false, 0, false, world.getInstanceId());
|
||||
|
@@ -34,7 +34,6 @@ import com.l2jmobius.gameserver.model.L2Party;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.PcCondOverride;
|
||||
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.L2Summon;
|
||||
@@ -1101,9 +1100,7 @@ public final class CrystalCaverns extends AbstractInstance
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
final L2Npc copy = addSpawn(TEARS_COPY, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0, false, attacker.getInstanceId());
|
||||
copy.setRunning();
|
||||
((L2Attackable) copy).addDamageHate(target, 0, 99999);
|
||||
copy.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
addAttackDesire(copy, target);
|
||||
copy.setCurrentHp(nowHp);
|
||||
world.copys.add(copy);
|
||||
}
|
||||
|
@@ -286,7 +286,7 @@ public final class HarnakUndergroundRuins extends AbstractInstance
|
||||
world.waveNpcId = npcId;
|
||||
for (L2Npc spawnedNpc : spawnedNpcs)
|
||||
{
|
||||
addAttackPlayerDesire(spawnedNpc, player);
|
||||
addAttackDesire(spawnedNpc, player);
|
||||
}
|
||||
world.wave++;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ public final class HarnakUndergroundRuins extends AbstractInstance
|
||||
world.spawnedNpc.addAll(spawnedNpcs);
|
||||
for (L2Npc spawnedNpc : spawnedNpcs)
|
||||
{
|
||||
addAttackPlayerDesire(spawnedNpc, player);
|
||||
addAttackDesire(spawnedNpc, player);
|
||||
}
|
||||
world.wave++;
|
||||
}
|
||||
@@ -320,7 +320,7 @@ public final class HarnakUndergroundRuins extends AbstractInstance
|
||||
world.spawnedNpc.addAll(spawnedNpcs);
|
||||
for (L2Npc spawnedNpc : spawnedNpcs)
|
||||
{
|
||||
addAttackPlayerDesire(spawnedNpc, player);
|
||||
addAttackDesire(spawnedNpc, player);
|
||||
}
|
||||
final List<L2Npc> powersources = spawnGroup("power_source", world.getInstanceId());
|
||||
for (L2Npc powersource : powersources)
|
||||
@@ -395,7 +395,7 @@ public final class HarnakUndergroundRuins extends AbstractInstance
|
||||
List<L2Npc> spawnedNpcs = spawnGroup("third_room_" + world.waveNpcId, world.getInstanceId());
|
||||
for (L2Npc spawnedNpc : spawnedNpcs)
|
||||
{
|
||||
addAttackPlayerDesire(spawnedNpc, player);
|
||||
addAttackDesire(spawnedNpc, player);
|
||||
}
|
||||
spawnedNpcs = spawnGroup("seal", world.getInstanceId());
|
||||
for (L2Npc spawnedNpc : spawnedNpcs)
|
||||
@@ -712,7 +712,7 @@ public final class HarnakUndergroundRuins extends AbstractInstance
|
||||
{
|
||||
for (L2Npc livingNpc : world.spawnedNpc)
|
||||
{
|
||||
addAttackPlayerDesire(livingNpc, player);
|
||||
addAttackDesire(livingNpc, player);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -84,9 +84,7 @@ public final class IceQueensCastle extends AbstractInstance
|
||||
{
|
||||
if ((character.getId() == ARCHERY_KNIGHT) && !character.isDead() && !((L2Attackable) character).isDecayed())
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character);
|
||||
((L2Attackable) npc).addDamageHate(character, 0, 999999);
|
||||
addAttackDesire(npc, character, 99999);
|
||||
}
|
||||
}
|
||||
startQuestTimer("ATTACK_KNIGHT", 3000, npc, null);
|
||||
@@ -145,9 +143,7 @@ public final class IceQueensCastle extends AbstractInstance
|
||||
{
|
||||
if ((character.getId() == ARCHERY_KNIGHT) && !character.isDead() && !((L2Attackable) character).isDecayed())
|
||||
{
|
||||
npc.setIsRunning(true);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character);
|
||||
((L2Attackable) npc).addDamageHate(character, 0, 999999);
|
||||
addAttackDesire(npc, character, 99999);
|
||||
npc.setScriptValue(1);
|
||||
startQuestTimer("ATTACK_KNIGHT", 5000, npc, null);
|
||||
}
|
||||
|
@@ -706,9 +706,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getInstanceId());
|
||||
breath.setIsRunning(true);
|
||||
breath.addDamageHate(mob.getMostHated(), 0, 999);
|
||||
breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, mob.getMostHated());
|
||||
addAttackDesire(breath, mob.getMostHated());
|
||||
startQuestTimer("BLIZZARD", 20000, breath, null);
|
||||
world.spawnedMobs.add(breath);
|
||||
}
|
||||
@@ -1098,9 +1096,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
||||
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), false, 0, false, world.getInstanceId());
|
||||
if (player != null)
|
||||
{
|
||||
breath.setIsRunning(true);
|
||||
breath.addDamageHate(player, 0, 999);
|
||||
breath.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
addAttackDesire(breath, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1344,9 +1340,7 @@ public final class IceQueensCastleBattle extends AbstractInstance
|
||||
final L2PcInstance target = (!players.isEmpty()) ? players.get(0) : null;
|
||||
if (target != null)
|
||||
{
|
||||
mob.addDamageHate(target, 0, 999);
|
||||
mob.setIsRunning(true);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
addAttackDesire(mob, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -100,9 +100,7 @@ public final class MithrilMine extends AbstractInstance
|
||||
{
|
||||
final L2Attackable spawnedMob = (L2Attackable) addSpawn(MITHRIL_MILLIPEDE, loc, false, 0, false, world.getInstanceId());
|
||||
spawnedMob.setScriptValue(1);
|
||||
spawnedMob.setIsRunning(true);
|
||||
spawnedMob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc);
|
||||
spawnedMob.addDamageHate(npc, 0, 999999);
|
||||
addAttackDesire(spawnedMob, npc, 99999);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -147,7 +147,7 @@ public final class MuseumDungeon extends AbstractInstance
|
||||
}
|
||||
world.toyron.setIsRunning(true);
|
||||
world.thiefSpawns = spawnGroup("thiefs", world.getInstanceId());
|
||||
((L2MonsterInstance) world.thiefSpawns.get(0)).addDamage(player, 1, null);
|
||||
addAttackDesire(world.thiefSpawns.get(0), player);
|
||||
startQuestTimer("assist_player", 2000, world.toyron, player);
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public final class MuseumDungeon extends AbstractInstance
|
||||
qs.setCond(2);
|
||||
giveItems(player, THE_WAR_OF_GODS_AND_GIANTS, 1);
|
||||
world.thiefSpawns = spawnGroup("thiefs", world.getInstanceId());
|
||||
((L2MonsterInstance) world.thiefSpawns.get(0)).addDamage(player, 1, null);
|
||||
addAttackDesire(world.thiefSpawns.get(0), player);
|
||||
showOnScreenMsg(player, NpcStringId.WATCH_OUT_YOU_ARE_BEING_ATTACKED, ExShowScreenMessage.TOP_CENTER, 5000);
|
||||
startQuestTimer("assist_player", 2000, world.toyron, player);
|
||||
htmltext = "desk_correct.html";
|
||||
|
Reference in New Issue
Block a user