New addAttackDesire method.
This commit is contained in:
@@ -21,7 +21,6 @@ import java.util.Map;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@@ -100,9 +99,7 @@ final class Anais extends AbstractNpcAI
|
||||
b.setDisplayEffect(1);
|
||||
b.setIsRunning(false);
|
||||
final L2Npc ward = addSpawn(GRAIL_WARD, new Location(b.getX(), b.getY(), b.getZ()), true, 0);
|
||||
((L2Attackable) ward).addDamageHate(_nextTarget, 0, 999);
|
||||
ward.setIsRunning(true);
|
||||
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget, null);
|
||||
addAttackDesire(ward, _nextTarget);
|
||||
startQuestTimer("GUARD_ATTACK", 1000, ward, _nextTarget, true);
|
||||
startQuestTimer("SUICIDE", 20000, ward, null);
|
||||
ward.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _nextTarget);
|
||||
|
@@ -28,7 +28,6 @@ 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.L2Playable;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2GrandBossInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.holders.SkillHolder;
|
||||
@@ -299,14 +298,14 @@ public final class Baium extends AbstractNpcAI
|
||||
|
||||
if ((player != null) && !player.isDead())
|
||||
{
|
||||
addAttackPlayerDesire(npc, player);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2PcInstance randomPlayer = getRandomPlayer(npc);
|
||||
if (randomPlayer != null)
|
||||
{
|
||||
addAttackPlayerDesire(npc, randomPlayer);
|
||||
addAttackDesire(npc, randomPlayer);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -330,7 +329,7 @@ public final class Baium extends AbstractNpcAI
|
||||
{
|
||||
mob.clearAggroList();
|
||||
}
|
||||
addAttackPlayerDesire(mob, (L2Playable) mostHated);
|
||||
addAttackDesire(mob, mostHated);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -343,7 +342,7 @@ public final class Baium extends AbstractNpcAI
|
||||
{
|
||||
mob.clearAggroList();
|
||||
}
|
||||
addAttackPlayerDesire(mob, (L2Playable) creature);
|
||||
addAttackDesire(mob, creature);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@@ -357,9 +356,7 @@ public final class Baium extends AbstractNpcAI
|
||||
{
|
||||
mob.clearAggroList();
|
||||
}
|
||||
mob.setIsRunning(true);
|
||||
mob.addDamageHate(_baium, 0, 999);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, _baium);
|
||||
addAttackDesire(mob, _baium);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -20,7 +20,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
@@ -233,9 +232,7 @@ final class DarkWaterDragon extends AbstractNpcAI
|
||||
public void spawnShade(L2Character attacker, int npcId, int x, int y, int z)
|
||||
{
|
||||
final L2Npc shade = addSpawn(npcId, x, y, z, 0, false, 0);
|
||||
shade.setRunning();
|
||||
((L2Attackable) shade).addDamageHate(attacker, 0, 999);
|
||||
shade.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, attacker);
|
||||
addAttackDesire(shade, attacker);
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
|
@@ -43,7 +43,7 @@ final class Gordon extends AbstractNpcAI
|
||||
{
|
||||
if (creature.isPlayer() && ((L2PcInstance) creature).isCursedWeaponEquipped())
|
||||
{
|
||||
addAttackPlayerDesire(npc, (L2PcInstance) creature);
|
||||
addAttackDesire(npc, creature);
|
||||
}
|
||||
return super.onSeeCreature(npc, creature, isSummon);
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
@@ -69,7 +68,7 @@ final class LeopardDragonHachling extends AbstractNpcAI
|
||||
{
|
||||
final L2Npc leopard = addSpawn(LEOPARD_DRAGON, npc.getLocation(), true, 300000); // 5 minute despawn time
|
||||
leopard.broadcastPacket(new NpcSay(leopard.getObjectId(), ChatType.NPC_GENERAL, LEOPARD_DRAGON, NpcStringId.I_M_GOING_TO_TRANSFORM_WITH_THE_POWER_OF_THE_VORTEX_YOU_JUST_WATCH));
|
||||
((L2MonsterInstance) leopard).addDamage(player, 1, null);
|
||||
addAttackDesire(leopard, player);
|
||||
}
|
||||
cancelQuestTimer("MOVE_TO_TRANSFORM", npc, player);
|
||||
npc.deleteMe();
|
||||
|
@@ -289,7 +289,7 @@ final class Sailren extends AbstractNpcAI
|
||||
if (_killCount == 3)
|
||||
{
|
||||
final L2Npc pterosaur = addSpawn(PTEROSAUR, 27313, -6766, -1975, 0, false, 0);
|
||||
addAttackPlayerDesire(pterosaur, killer);
|
||||
addAttackDesire(pterosaur, killer);
|
||||
_killCount = 0;
|
||||
}
|
||||
break;
|
||||
@@ -297,7 +297,7 @@ final class Sailren extends AbstractNpcAI
|
||||
case PTEROSAUR:
|
||||
{
|
||||
final L2Npc trex = addSpawn(TREX, 27313, -6766, -1975, 0, false, 0);
|
||||
addAttackPlayerDesire(trex, killer);
|
||||
addAttackDesire(trex, killer);
|
||||
break;
|
||||
}
|
||||
case TREX:
|
||||
|
@@ -17,7 +17,6 @@
|
||||
package ai.individual;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
@@ -44,7 +43,7 @@ final class WindVortex extends AbstractNpcAI
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
final L2Npc newSpawn = addSpawn(getRandomBoolean() ? IMMENSE_WINDIMA : GIANT_WINDIMA, npc.getLocation(), false, 300000); // 5 minute despawn time
|
||||
((L2MonsterInstance) newSpawn).addDamage(killer, 1, null);
|
||||
addAttackDesire(newSpawn, killer);
|
||||
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 4500);
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
Reference in New Issue
Block a user