New addAttackDesire method.
This commit is contained in:
@@ -22,7 +22,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.datatables.SkillData;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@@ -297,9 +296,7 @@ final class BeastFarm extends AbstractNpcAI
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
addAttackDesire(nextNpc, player);
|
||||
|
||||
player.setTarget(nextNpc);
|
||||
}
|
||||
@@ -363,9 +360,7 @@ final class BeastFarm extends AbstractNpcAI
|
||||
if (growthLevel == 0)
|
||||
{
|
||||
FEED_INFO.remove(objectId);
|
||||
npc.setRunning();
|
||||
((L2Attackable) npc).addDamageHate(caster, 0, 1);
|
||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, caster);
|
||||
addAttackDesire(npc, caster);
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
|
@@ -174,7 +174,7 @@ final class DragonValley extends AbstractNpcAI
|
||||
{
|
||||
final L2Playable playable = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
final L2Npc minion = addSpawn(DRAKOS_ASSASSIN, npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), true, 0, true);
|
||||
addAttackPlayerDesire(minion, playable);
|
||||
addAttackDesire(minion, playable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,12 +283,12 @@ final class DragonValley extends AbstractNpcAI
|
||||
final L2Playable attacker = isSummon ? player.getServitors().values().stream().findFirst().orElse(player.getPet()) : player;
|
||||
final L2Npc ghost1 = addSpawn(EXPLODING_ORC_GHOST, npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);
|
||||
ghost1.getVariables().set("playable", attacker);
|
||||
addAttackPlayerDesire(ghost1, attacker);
|
||||
addAttackDesire(ghost1, attacker);
|
||||
val++;
|
||||
if ((val < 2) && (getRandomBoolean()))
|
||||
{
|
||||
final L2Npc ghost2 = addSpawn(WRATHFUL_ORC_GHOST, npc.getX(), npc.getY(), npc.getZ() + 20, npc.getHeading(), false, 0, false);
|
||||
addAttackPlayerDesire(ghost2, attacker);
|
||||
addAttackDesire(ghost2, attacker);
|
||||
val++;
|
||||
}
|
||||
npc.setScriptValue(val);
|
||||
|
@@ -62,7 +62,7 @@ final class FairyTrees extends AbstractNpcAI
|
||||
{
|
||||
final L2Npc guardian = addSpawn(SOUL_GUARDIAN, npc, false, 30000);
|
||||
final L2Playable attacker = isSummon ? killer.getServitors().values().stream().findFirst().orElse(killer.getPet()) : killer;
|
||||
addAttackPlayerDesire(guardian, attacker);
|
||||
addAttackDesire(guardian, attacker);
|
||||
if (getRandomBoolean())
|
||||
{
|
||||
guardian.setTarget(attacker);
|
||||
|
@@ -20,7 +20,6 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@@ -476,9 +475,7 @@ final class FeedableBeasts extends AbstractNpcAI
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
addAttackDesire(nextNpc, player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -501,9 +498,7 @@ final class FeedableBeasts extends AbstractNpcAI
|
||||
|
||||
// register the player in the feedinfo for the mob that just spawned
|
||||
FEED_INFO.put(nextNpc.getObjectId(), player.getObjectId());
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
addAttackDesire(nextNpc, player);
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
|
@@ -53,7 +53,7 @@ final class FrozenLabyrinth extends AbstractNpcAI
|
||||
final int y = diff >= 60 ? npc.getY() + (diff - 40) : npc.getY();
|
||||
|
||||
final L2Npc monster = addSpawn(spawnId, x, y, npc.getZ(), npc.getHeading(), false, 0);
|
||||
addAttackPlayerDesire(monster, attacker);
|
||||
addAttackDesire(monster, attacker);
|
||||
diff += 20;
|
||||
}
|
||||
npc.setScriptValue(1);
|
||||
|
@@ -62,7 +62,7 @@ final class GiantsCave extends AbstractNpcAI
|
||||
{
|
||||
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
||||
{
|
||||
addAttackPlayerDesire((L2Npc) characters, player);
|
||||
addAttackDesire((L2Npc) characters, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,7 +18,6 @@ package ai.group_template;
|
||||
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
import ai.npc.AbstractNpcAI;
|
||||
@@ -70,7 +69,7 @@ final class HillsOfGold extends AbstractNpcAI
|
||||
}
|
||||
if (nearby.isMonster() && ((nearby.getId() == GOLEM_OF_REPAIRS) || (nearby.getId() == EXCAVATOR_GOLEM) || (nearby.getId() == DRILL_GOLEM)))
|
||||
{
|
||||
((L2MonsterInstance) npc).addDamage(nearby, 1, null);
|
||||
addAttackDesire(npc, nearby);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -83,13 +82,13 @@ final class HillsOfGold extends AbstractNpcAI
|
||||
public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
|
||||
{
|
||||
final L2Npc mob1 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
((L2MonsterInstance) mob1).addDamage(attacker, 1, null);
|
||||
addAttackDesire(mob1, attacker);
|
||||
final L2Npc mob2 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
((L2MonsterInstance) mob2).addDamage(attacker, 1, null);
|
||||
addAttackDesire(mob2, attacker);
|
||||
final L2Npc mob3 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
((L2MonsterInstance) mob3).addDamage(attacker, 1, null);
|
||||
addAttackDesire(mob3, attacker);
|
||||
final L2Npc mob4 = addSpawn(SPICULA_ELITE_GUARD, npc.getX(), npc.getY(), npc.getZ(), attacker.getHeading() + 32500, true, npc.getSpawn().getRespawnDelay());
|
||||
((L2MonsterInstance) mob4).addDamage(attacker, 1, null);
|
||||
addAttackDesire(mob4, attacker);
|
||||
npc.deleteMe();
|
||||
return super.onAttack(npc, attacker, damage, isSummon);
|
||||
}
|
||||
|
@@ -97,7 +97,7 @@ final class LairOfAntharas extends AbstractNpcAI
|
||||
final L2Npc newKnight = addSpawn(DRAGON_KNIGHT2, npc, false, 0, true);
|
||||
npc.deleteMe();
|
||||
broadcastNpcSay(newKnight, ChatType.NPC_SHOUT, NpcStringId.THOSE_WHO_SET_FOOT_IN_THIS_PLACE_SHALL_NOT_LEAVE_ALIVE);
|
||||
addAttackPlayerDesire(newKnight, killer);
|
||||
addAttackDesire(newKnight, killer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ final class LairOfAntharas extends AbstractNpcAI
|
||||
final L2Npc eliteKnight = addSpawn(ELITE_DRAGON_KNIGHT, npc, false, 0, true);
|
||||
npc.deleteMe();
|
||||
broadcastNpcSay(eliteKnight, ChatType.NPC_SHOUT, NpcStringId.IF_YOU_WISH_TO_SEE_HELL_I_WILL_GRANT_YOU_YOUR_WISH);
|
||||
addAttackPlayerDesire(eliteKnight, killer);
|
||||
addAttackDesire(eliteKnight, killer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
package ai.group_template;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
@@ -101,9 +100,7 @@ final class MonasteryOfSilence extends AbstractNpcAI
|
||||
}
|
||||
else if (character.getId() == KNIGHT)
|
||||
{
|
||||
character.setRunning();
|
||||
((L2Attackable) character).addDamageHate(npc, 0, 100);
|
||||
character.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, npc, null);
|
||||
addAttackDesire((L2Npc) character, npc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,7 +158,7 @@ final class MonasteryOfSilence extends AbstractNpcAI
|
||||
}
|
||||
npc.setScriptValue(1);
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.FOR_THE_GLORY_OF_SOLINA);
|
||||
addAttackPlayerDesire(addSpawn(KNIGHT, npc), player);
|
||||
addAttackDesire(addSpawn(KNIGHT, npc), player);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -255,7 +252,7 @@ final class MonasteryOfSilence extends AbstractNpcAI
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_CANNOT_CARRY_A_WEAPON_WITHOUT_AUTHORIZATION);
|
||||
}
|
||||
|
||||
addAttackPlayerDesire(npc, player);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
return super.onAggroRangeEnter(npc, player, isSummon);
|
||||
}
|
||||
@@ -270,7 +267,7 @@ final class MonasteryOfSilence extends AbstractNpcAI
|
||||
if (obj.equals(npc))
|
||||
{
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, DIVINITY_MSG[getRandom(DIVINITY_MSG.length)], caster.getName());
|
||||
addAttackPlayerDesire(npc, caster);
|
||||
addAttackDesire(npc, caster);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -45,10 +45,10 @@ final class PavelArchaic extends AbstractNpcAI
|
||||
if (getRandom(100) < 70)
|
||||
{
|
||||
final L2Npc golem1 = addSpawn(PINCER_GOLEM2, npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, false);
|
||||
addAttackPlayerDesire(golem1, killer);
|
||||
addAttackDesire(golem1, killer);
|
||||
|
||||
final L2Npc golem2 = addSpawn(PINCER_GOLEM3, npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, false);
|
||||
addAttackPlayerDesire(golem2, killer);
|
||||
addAttackDesire(golem2, killer);
|
||||
}
|
||||
return super.onKill(npc, killer, isSummon);
|
||||
}
|
||||
|
@@ -81,7 +81,7 @@ final class PlainsOfDion extends AbstractNpcAI
|
||||
if (obj.isMonster() && Util.contains(DELU_LIZARDMEN, obj.getId()) && !obj.isAttackingNow() && !obj.isDead() && GeoData.getInstance().canSeeTarget(npc, obj))
|
||||
{
|
||||
final L2Npc monster = (L2Npc) obj;
|
||||
addAttackPlayerDesire(monster, player);
|
||||
addAttackDesire(monster, player);
|
||||
broadcastNpcSay(monster, ChatType.NPC_GENERAL, MONSTERS_ASSIST_MSG[getRandom(3)]);
|
||||
}
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ final class PlainsOfLizardman extends AbstractNpcAI
|
||||
final L2Npc monster = (L2Npc) target;
|
||||
npc.setTarget(monster);
|
||||
npc.doCast(STUN_EFFECT.getSkill());
|
||||
addAttackPlayerDesire(monster, player);
|
||||
addAttackDesire(monster, player);
|
||||
}
|
||||
}
|
||||
npc.doDie(player);
|
||||
@@ -174,7 +174,7 @@ final class PlainsOfLizardman extends AbstractNpcAI
|
||||
// Tanta Guard
|
||||
if (getRandom(1000) == 0)
|
||||
{
|
||||
addAttackPlayerDesire(addSpawn(TANTA_GUARD, npc), killer);
|
||||
addAttackDesire(addSpawn(TANTA_GUARD, npc), killer);
|
||||
}
|
||||
|
||||
// Invisible buff npc
|
||||
|
@@ -21,7 +21,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Attackable;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
@@ -102,9 +101,7 @@ final class PolymorphingOnAttack extends AbstractNpcAI
|
||||
npc.deleteMe();
|
||||
final L2Attackable newNpc = (L2Attackable) addSpawn(tmp.get(0), npc.getX(), npc.getY(), npc.getZ() + 10, npc.getHeading(), false, 0, true);
|
||||
final L2Character originalAttacker = isSummon ? attacker.getServitors().values().stream().findFirst().orElse(attacker.getPet()) : attacker;
|
||||
newNpc.setRunning();
|
||||
newNpc.addDamageHate(originalAttacker, 0, 500);
|
||||
newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, originalAttacker);
|
||||
addAttackDesire(newNpc, originalAttacker);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -132,8 +132,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
}
|
||||
if (npc.isInCombat())
|
||||
{
|
||||
final L2Attackable mob = (L2Attackable) npc;
|
||||
final L2Character target = mob.getMostHated();
|
||||
final L2Character target = ((L2Attackable) npc).getMostHated();
|
||||
if (((npc.getCurrentHp() / npc.getMaxHp()) * 100) < 60)
|
||||
{
|
||||
if (skill.getId() == SELFBUFF1.getSkillId())
|
||||
@@ -142,9 +141,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
if ((target != null))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
mob.setIsRunning(true);
|
||||
mob.addDamageHate(target, 0, 555);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,9 +153,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
if ((target != null))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
mob.setIsRunning(true);
|
||||
mob.addDamageHate(target, 0, 555);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
else if (skill.getId() == SELFBUFF2.getSkillId())
|
||||
@@ -167,9 +162,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
if ((target != null))
|
||||
{
|
||||
npc.setTarget(target);
|
||||
mob.setIsRunning(true);
|
||||
mob.addDamageHate(target, 0, 555);
|
||||
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,7 +208,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(LONGRANGEDMAGIC1.getSkill());
|
||||
addAttackPlayerDesire(npc, player);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -330,7 +323,7 @@ final class PrimevalIsle extends AbstractNpcAI
|
||||
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
|
||||
{
|
||||
final L2Attackable monster = (L2Attackable) characters;
|
||||
addAttackPlayerDesire(monster, playable);
|
||||
addAttackDesire(monster, playable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@ 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.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.util.Util;
|
||||
@@ -209,7 +208,7 @@ final class SelMahumDrill extends AbstractNpcAI
|
||||
{
|
||||
if (!ch.isInCombat() && ch.isMonster() && (((L2Npc) ch).getSpawn().getName() == npc.getSpawn().getName()))
|
||||
{
|
||||
((L2MonsterInstance) ch).addDamageHate(attacker, 0, 1000);
|
||||
addAttackDesire((L2Npc) ch, attacker);
|
||||
}
|
||||
}
|
||||
if ((getRandom(10) < 1) && (Util.contains(MAHUM_SOLDIERS, npc.getId())))
|
||||
|
@@ -107,7 +107,7 @@ final class SelMahumSquad extends AbstractNpcAI
|
||||
npc.getVariables().remove("INVUL_REMOVE_TIMER_STARTED");
|
||||
if ((player != null) && !player.isDead() && npc.getKnownList().knowsThePlayer(player))
|
||||
{
|
||||
addAttackPlayerDesire(npc, player);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -126,14 +126,14 @@ final class SilentValley extends AbstractNpcAI
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(BLAZE.getSkill());
|
||||
addAttackPlayerDesire(npc, player);
|
||||
addAttackDesire(npc, player);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (isSummon)
|
||||
{
|
||||
addAttackPlayerDesire(npc, player);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,11 +164,11 @@ final class SilentValley extends AbstractNpcAI
|
||||
{
|
||||
npc.setTarget(player);
|
||||
npc.doCast(BLAZE.getSkill());
|
||||
addAttackPlayerDesire(npc, player);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
else if (creature.isAffectedBySkill(BETRAYAL.getSkillId()))
|
||||
{
|
||||
addAttackPlayerDesire(npc, player);
|
||||
addAttackDesire(npc, player);
|
||||
}
|
||||
}
|
||||
return super.onSeeCreature(npc, creature, isSummon);
|
||||
|
@@ -129,7 +129,7 @@ final class StakatoNest extends AbstractNpcAI
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
final L2Npc spawned = addSpawn(STAKATO_CAPTAIN, monster, true);
|
||||
addAttackPlayerDesire(spawned, killer);
|
||||
addAttackDesire(spawned, killer);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -152,7 +152,7 @@ final class StakatoNest extends AbstractNpcAI
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
final L2Npc spawned = addSpawn(STAKATO_GUARD, monster, true);
|
||||
addAttackPlayerDesire(spawned, killer);
|
||||
addAttackDesire(spawned, killer);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -193,7 +193,7 @@ final class StakatoNest extends AbstractNpcAI
|
||||
{
|
||||
npc.doDie(caster);
|
||||
final L2Npc spawned = addSpawn(STAKATO_CHIEF, npc.getX(), npc.getY(), npc.getZ(), Util.calculateHeadingFrom(npc, caster), false, 0, true);
|
||||
addAttackPlayerDesire(spawned, caster);
|
||||
addAttackDesire(spawned, caster);
|
||||
}
|
||||
return super.onSkillSee(npc, caster, skill, targets, isSummon);
|
||||
}
|
||||
@@ -225,7 +225,7 @@ final class StakatoNest extends AbstractNpcAI
|
||||
npc.getSpawn().decreaseCount(npc);
|
||||
npc.deleteMe();
|
||||
final L2Npc spawned = addSpawn(npcId, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, true);
|
||||
addAttackPlayerDesire(spawned, player);
|
||||
addAttackDesire(spawned, player);
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.model.L2World;
|
||||
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.L2MonsterInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
@@ -106,9 +105,7 @@ final class TurekOrcs extends AbstractNpcAI
|
||||
if (eventName.equals("WARNING") && !receiver.isDead() && (receiver.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK) && (reference != null) && (reference.getActingPlayer() != null) && !reference.getActingPlayer().isDead())
|
||||
{
|
||||
receiver.getVariables().set("state", 3);
|
||||
receiver.setIsRunning(true);
|
||||
((L2Attackable) receiver).addDamageHate(reference.getActingPlayer(), 0, 99999);
|
||||
receiver.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, reference.getActingPlayer());
|
||||
addAttackDesire(receiver, reference.getActingPlayer());
|
||||
}
|
||||
return super.onEventReceived(eventName, sender, receiver, reference);
|
||||
}
|
||||
@@ -117,7 +114,7 @@ final class TurekOrcs extends AbstractNpcAI
|
||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||
{
|
||||
final L2Npc newSpawn = addSpawn(getRandomBoolean() ? CHERTUBA_MIRAGE : CHERTUBA_ILLUSION, 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);
|
||||
}
|
||||
|
@@ -16,10 +16,8 @@
|
||||
*/
|
||||
package ai.group_template;
|
||||
|
||||
import com.l2jmobius.gameserver.ai.CtrlEvent;
|
||||
import com.l2jmobius.gameserver.enums.ChatType;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
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.network.NpcStringId;
|
||||
@@ -91,9 +89,7 @@ final class WarriorFishingBlock extends AbstractNpcAI
|
||||
{
|
||||
final L2PcInstance target = obj.getActingPlayer();
|
||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_SPAWN[getRandom(NPC_STRINGS_ON_SPAWN.length)], target.getName());
|
||||
((L2Attackable) npc).addDamageHate(target, 0, 2000);
|
||||
npc.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, target);
|
||||
npc.addAttackerToAttackByList(target);
|
||||
addAttackDesire(npc, target);
|
||||
|
||||
startQuestTimer("DESPAWN", DESPAWN_TIME * 1000, npc, target);
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ package ai.group_template;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
|
||||
import ai.npc.AbstractNpcAI;
|
||||
|
||||
@@ -53,7 +52,7 @@ final class Wasteland extends AbstractNpcAI
|
||||
}
|
||||
if (nearby.isMonster())
|
||||
{
|
||||
((L2QuestGuardInstance) npc).addDamage(nearby, 1, null);
|
||||
addAttackDesire(npc, nearby);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,6 @@ package ai.group_template;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
|
||||
|
||||
import ai.npc.AbstractNpcAI;
|
||||
|
||||
@@ -52,7 +51,7 @@ final class YeSagira extends AbstractNpcAI
|
||||
}
|
||||
if (nearby.isMonster())
|
||||
{
|
||||
((L2QuestGuardInstance) npc).addDamage(nearby, 1, null);
|
||||
addAttackDesire(npc, nearby);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user