New addAttackDesire method.

This commit is contained in:
MobiusDev 2016-02-07 13:15:29 +00:00
parent e08de63a5c
commit fff8cd473b
48 changed files with 100 additions and 187 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -62,7 +62,7 @@ final class GiantsCave extends AbstractNpcAI
{
if ((characters != null) && (characters.isAttackable()) && (getRandomBoolean()))
{
addAttackPlayerDesire((L2Npc) characters, player);
addAttackDesire((L2Npc) characters, player);
}
}
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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);
}

View File

@ -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)]);
}
}

View File

@ -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

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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())))

View File

@ -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;

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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
{

View File

@ -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)

View File

@ -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);
}

View File

@ -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();

View File

@ -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:

View File

@ -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);
}

View File

@ -16,8 +16,6 @@
*/
package ai.npc.ForgeOfTheGods;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@ -167,8 +165,7 @@ final class ForgeOfTheGods extends AbstractNpcAI
}
if (mob != null)
{
((L2Attackable) mob).addDamageHate(killer, 0, 9999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK);
addAttackDesire(mob, killer);
}
return super.onKill(npc, killer, isSummon);
}

View File

@ -21,7 +21,6 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
import com.l2jmobius.gameserver.data.xml.impl.NpcData;
import com.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
@ -338,9 +337,7 @@ public class EnergySeeds extends AbstractNpcAI
if (getRandom(100) < 50)
{
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[0][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[0].length)]);
mob.setRunning();
mob.addDamageHate(player, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
addAttackDesire(mob, player);
}
break;
}
@ -349,9 +346,7 @@ public class EnergySeeds extends AbstractNpcAI
if (getRandom(100) < 50)
{
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[1][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[1].length)]);
mob.setRunning();
mob.addDamageHate(player, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
addAttackDesire(mob, player);
}
break;
}
@ -360,9 +355,7 @@ public class EnergySeeds extends AbstractNpcAI
if (getRandom(100) < 50)
{
final L2MonsterInstance mob = spawnSupriseMob(seedEnergy, ANNIHILATION_SUPRISE_MOB_IDS[2][getRandom(ANNIHILATION_SUPRISE_MOB_IDS[2].length)]);
mob.setRunning();
mob.addDamageHate(player, 0, 999);
mob.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
addAttackDesire(mob, player);
}
break;
}

View File

@ -16,7 +16,6 @@
*/
package gracia.AI.NPC.ZealotOfShilen;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.model.actor.L2Attackable;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@ -61,9 +60,7 @@ public final class ZealotOfShilen extends AbstractNpcAI
{
if (character.isMonster() && !character.isDead() && !((L2Attackable) character).isDecayed())
{
npc.setRunning();
((L2Attackable) npc).addDamageHate(character, 0, 999);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, character, null);
addAttackDesire(npc, character);
}
}
}

View File

@ -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());

View File

@ -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);
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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
{

View File

@ -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;

View File

@ -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";

View File

@ -16,7 +16,6 @@
*/
package quests.Q00114_ResurrectionOfAnOldManager;
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;
@ -193,9 +192,7 @@ public class Q00114_ResurrectionOfAnOldManager extends Quest
{
golem = (L2Attackable) addSpawn(GUARDIAN, 96977, -110625, -3280, 0, false, 0);
golem.broadcastPacket(new NpcSay(golem.getObjectId(), ChatType.NPC_GENERAL, golem.getId(), NpcStringId.YOU_S1_YOU_ATTACKED_WENDY_PREPARE_TO_DIE).addStringParameter(player.getName()));
golem.setRunning();
golem.addDamageHate(player, 0, 999);
golem.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
addAttackDesire(golem, player);
st.set("spawned", "1");
startQuestTimer("golem_despawn", 300000, null, player);
}

View File

@ -16,7 +16,6 @@
*/
package quests.Q00193_SevenSignsDyingMessage;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@ -164,9 +163,7 @@ public final class Q00193_SevenSignsDyingMessage extends Quest
startQuestTimer("heal", 30000 - getRandom(20000), npc, player);
final L2MonsterInstance monster = (L2MonsterInstance) addSpawn(SHILENS_EVIL_THOUGHTS, 82425, 47232, -3216, 0, false, 0, false);
monster.broadcastPacket(new NpcSay(monster.getObjectId(), ChatType.NPC_GENERAL, monster.getId(), NpcStringId.YOU_ARE_NOT_THE_OWNER_OF_THAT_ITEM));
monster.setRunning();
monster.addDamageHate(player, 0, 999);
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
addAttackDesire(monster, player);
startQuestTimer("despawn", 300000, monster, null);
}
break;

View File

@ -16,7 +16,6 @@
*/
package quests.Q00197_SevenSignsTheSacredBookOfSeal;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@ -171,9 +170,7 @@ public final class Q00197_SevenSignsTheSacredBookOfSeal extends Quest
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.S1_THAT_STRANGER_MUST_BE_DEFEATED_HERE_IS_THE_ULTIMATE_HELP).addStringParameter(player.getName()));
final L2MonsterInstance monster = (L2MonsterInstance) addSpawn(SHILENS_EVIL_THOUGHTS, 152520, -57502, -3408, 0, false, 0, false);
monster.broadcastPacket(new NpcSay(monster.getObjectId(), ChatType.NPC_GENERAL, monster.getId(), NpcStringId.YOU_ARE_NOT_THE_OWNER_OF_THAT_ITEM));
monster.setRunning();
monster.addDamageHate(player, 0, 999);
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
addAttackDesire(monster, player);
startQuestTimer("despawn", 300000, monster, null);
}
break;

View File

@ -16,7 +16,6 @@
*/
package quests.Q00198_SevenSignsEmbryo;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
@ -110,9 +109,7 @@ public final class Q00198_SevenSignsEmbryo extends Quest
startQuestTimer("heal", 30000 - getRandom(20000), npc, player);
final L2MonsterInstance monster = (L2MonsterInstance) addSpawn(SHILENS_EVIL_THOUGHTS, -23734, -9184, -5384, 0, false, 0, false, npc.getInstanceId());
monster.broadcastPacket(new NpcSay(monster.getObjectId(), ChatType.NPC_GENERAL, monster.getId(), NpcStringId.YOU_ARE_NOT_THE_OWNER_OF_THAT_ITEM));
monster.setRunning();
monster.addDamageHate(player, 0, 999);
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
addAttackDesire(monster, player);
startQuestTimer("despawn", 300000, monster, null);
}
break;

View File

@ -161,9 +161,7 @@ public class Q00450_GraveRobberRescue extends Quest
htmltext = null;
final L2Attackable monster = (L2Attackable) addSpawn(WARRIOR_MON, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 600000);
monster.setRunning();
monster.addDamageHate(player, 0, 999);
monster.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
addAttackDesire(monster, player);
showOnScreenMsg(player, NpcStringId.THE_GRAVE_ROBBER_WARRIOR_HAS_BEEN_FILLED_WITH_DARK_ENERGY_AND_IS_ATTACKING_YOU, 5, 5000);
}
}

View File

@ -182,15 +182,15 @@ public final class Q00503_PursuitOfClanAmbition extends Quest
{
giveItems(player, BLITZ_WYRM_EGG, 3);
qs.setMemoState(qs.getMemoState() + 100);
addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
startQuestTimer("DESPAWN", 10000, npc, player);
htmltext = event;
}
else if (qs.isMemoState(2100) || qs.isMemoState(2111) || qs.isMemoState(2110) || qs.isMemoState(2101))
{
addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
startQuestTimer("DESPAWN", 10000, npc, player);
htmltext = "30761-03.html";
}
@ -203,15 +203,15 @@ public final class Q00503_PursuitOfClanAmbition extends Quest
giveItems(player, BLITZ_WYRM_EGG, 3);
giveItems(player, MIST_DRAKES_EGG, 4);
qs.setMemoState(qs.getMemoState() + 10);
addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
startQuestTimer("DESPAWN", 10000, npc, player);
htmltext = event;
}
else if (qs.isMemoState(2100) || qs.isMemoState(2111) || qs.isMemoState(2011) || qs.isMemoState(2110))
{
addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
addAttackDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player);
startQuestTimer("DESPAWN", 10000, npc, player);
htmltext = "30762-03.html";
}

View File

@ -189,7 +189,7 @@ public class Q10742_AFurryFriend extends Quest
{
if (getRandomBoolean())
{
addAttackPlayerDesire(addSpawn(KIKU, player.getLocation(), true, 120000), player);
addAttackDesire(addSpawn(KIKU, player.getLocation(), true, 120000), player);
showOnScreenMsg(player, NpcStringId.RICKY_IS_NOT_HERE_NTRY_SEARCHING_ANOTHER_KIKU_S_CAVE, ExShowScreenMessage.TOP_CENTER, 4500);
htmltext = "33995-02.html";
}

View File

@ -147,7 +147,7 @@ public class Q10743_StrangeFungus extends Quest
final int killCount = qs.getInt(KILL_VAR) + 1;
if (killCount >= 3)
{
addAttackPlayerDesire(addSpawn(EVOLVED_GROWLER, npc.getLocation()), killer);
addAttackDesire(addSpawn(EVOLVED_GROWLER, npc.getLocation()), killer);
qs.set(KILL_VAR, 0);
}
else

View File

@ -3181,13 +3181,13 @@ public abstract class AbstractScript implements INamable
}
/**
* Monster is running and attacking the playable.
* Monster is running and attacking the character.
* @param npc the NPC that performs the attack
* @param playable the player
* @param target the target of the attack
*/
protected void addAttackPlayerDesire(L2Npc npc, L2Playable playable)
protected void addAttackDesire(L2Npc npc, L2Character target)
{
addAttackPlayerDesire(npc, playable, 999);
addAttackDesire(npc, target, 999);
}
/**
@ -3196,7 +3196,7 @@ public abstract class AbstractScript implements INamable
* @param target the target of the attack
* @param desire the desire to perform the attack
*/
protected void addAttackPlayerDesire(L2Npc npc, L2Playable target, int desire)
protected void addAttackDesire(L2Npc npc, L2Character target, int desire)
{
if (npc instanceof L2Attackable)
{