Partial sync latest Test changes to HighFive.

This commit is contained in:
MobiusDev
2016-10-28 08:59:28 +00:00
parent 01a48c62cd
commit 2555bab9e7
56 changed files with 212 additions and 480 deletions

View File

@@ -27,7 +27,6 @@ import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.npc.AbstractNpcAI;
@@ -308,11 +307,6 @@ public final class TalentShow extends AbstractNpcAI
startQuestTimer("Start", diff, null, null); // first start
}
private void autoChat(L2Npc npc, NpcStringId npcString, ChatType type)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), type, npc.getId(), npcString));
}
@Override
public String onSpawn(L2Npc npc)
{
@@ -322,7 +316,7 @@ public final class TalentShow extends AbstractNpcAI
{
case 32433:
{
autoChat(npc, MESSAGES[0], ChatType.NPC_SHOUT);
npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[0]);
startQuestTimer("1", 30000, npc, null);
break;
}
@@ -384,7 +378,7 @@ public final class TalentShow extends AbstractNpcAI
// TODO switch on event
if (event.equalsIgnoreCase("6"))
{
autoChat(npc, MESSAGES[6], ChatType.NPC_SHOUT);
npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[6]);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-56511, -56647, -2008, 36863));
npc.broadcastPacket(new PlaySound(1, "NS22_F", 0, 0, 0, 0, 0));
addSpawn(SINGERS[0], -56344, -56328, -2008, 32768, false, 224000);
@@ -402,7 +396,7 @@ public final class TalentShow extends AbstractNpcAI
{
case 32433:
{
autoChat(npc, MESSAGES[7], ChatType.NPC_SHOUT);
npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[7]);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-56698, -56430, -2008, 32768));
startQuestTimer("8", 12000, npc, null);
break;
@@ -436,7 +430,7 @@ public final class TalentShow extends AbstractNpcAI
{
case 32433:
{
autoChat(npc, MESSAGES[11], ChatType.NPC_SHOUT);
npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[11]);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-56698, -56430, -2008, 32768));
startQuestTimer("12", 5000, npc, null);
break;
@@ -455,7 +449,7 @@ public final class TalentShow extends AbstractNpcAI
}
else if (event.equalsIgnoreCase("17"))
{
autoChat(npc, MESSAGES[16], ChatType.NPC_SHOUT);
npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[16]);
startQuestTimer("social1", 2000, addSpawn(INDIVIDUALS[1], -56700, -56340, -2008, 32768, false, 32000), null);
startQuestTimer("18", 9000, npc, null);
}
@@ -476,7 +470,7 @@ public final class TalentShow extends AbstractNpcAI
}
else if (event.equalsIgnoreCase("28"))
{
autoChat(npc, MESSAGES[23], ChatType.NPC_GENERAL);
npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[23]);
startQuestTimer("social1", 1, npc, null);
}
else if (event.equalsIgnoreCase("29"))
@@ -499,7 +493,7 @@ public final class TalentShow extends AbstractNpcAI
final ShoutInfo si = TALKS.get(event);
if (si != null)
{
autoChat(npc, si.getNpcStringId(), ChatType.NPC_SHOUT);
npc.broadcastSay(ChatType.NPC_SHOUT, si.getNpcStringId());
startQuestTimer(si.getNextEvent(), si.getTime(), npc, null);
}
}

View File

@@ -51,11 +51,11 @@ public final class GiantsCave extends AbstractNpcAI
{
if (npc.getId() == SCOUTS[0]) // Gamlin
{
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.INTRUDER_DETECTED);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.INTRUDER_DETECTED);
}
else
{
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.OH_GIANTS_AN_INTRUDER_HAS_BEEN_DISCOVERED);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.OH_GIANTS_AN_INTRUDER_HAS_BEEN_DISCOVERED);
}
for (L2Character characters : npc.getKnownList().getKnownCharactersInRadius(450))
@@ -93,11 +93,11 @@ public final class GiantsCave extends AbstractNpcAI
npc.setScriptValue(1);
if (getRandomBoolean())
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_GUYS_ARE_DETECTED);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_GUYS_ARE_DETECTED);
}
else
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WHAT_KIND_OF_CREATURES_ARE_YOU);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHAT_KIND_OF_CREATURES_ARE_YOU);
}
startQuestTimer("ATTACK", 6000, npc, player);
startQuestTimer("CLEAR", 120000, npc, null);

View File

@@ -80,7 +80,7 @@ public final class LairOfAntharas extends AbstractNpcAI
{
npc.setScriptValue(1);
}
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.WHO_S_THERE_IF_YOU_DISTURB_THE_TEMPER_OF_THE_GREAT_LAND_DRAGON_ANTHARAS_I_WILL_NEVER_FORGIVE_YOU);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.WHO_S_THERE_IF_YOU_DISTURB_THE_TEMPER_OF_THE_GREAT_LAND_DRAGON_ANTHARAS_I_WILL_NEVER_FORGIVE_YOU);
}
return super.onAggroRangeEnter(npc, player, isSummon);
}
@@ -96,7 +96,7 @@ public 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);
newKnight.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THOSE_WHO_SET_FOOT_IN_THIS_PLACE_SHALL_NOT_LEAVE_ALIVE);
addAttackDesire(newKnight, killer);
}
break;
@@ -107,7 +107,7 @@ public 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);
eliteKnight.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.IF_YOU_WISH_TO_SEE_HELL_I_WILL_GRANT_YOU_YOUR_WISH);
addAttackDesire(eliteKnight, killer);
}
break;

View File

@@ -440,7 +440,7 @@ public final class MinionSpawnManager extends AbstractNpcAI
{
addMinion((L2MonsterInstance) npc, is.getId());
}
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]);
npc.broadcastSay(ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]);
}
}
}

View File

@@ -95,7 +95,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
if ((character.getId() == CAPTAIN) && (getRandom(100) < 10) && npc.isScriptValue(0))
{
final L2Npc captain = (L2Npc) character;
broadcastNpcSay(captain, ChatType.NPC_GENERAL, SOLINA_KNIGHTS_MSG[getRandom(SOLINA_KNIGHTS_MSG.length)]);
captain.broadcastSay(ChatType.NPC_GENERAL, SOLINA_KNIGHTS_MSG[getRandom(SOLINA_KNIGHTS_MSG.length)]);
captain.setScriptValue(1);
startQuestTimer("TIMER", 10000, captain, null);
}
@@ -160,7 +160,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
npc.doCast(KNIGHT_BLESS.getSkill());
}
npc.setScriptValue(1);
broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.FOR_THE_GLORY_OF_SOLINA);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.FOR_THE_GLORY_OF_SOLINA);
addAttackDesire(addSpawn(KNIGHT, npc), player);
}
break;
@@ -252,7 +252,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
if (!npc.isInCombat())
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_CANNOT_CARRY_A_WEAPON_WITHOUT_AUTHORIZATION);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CANNOT_CARRY_A_WEAPON_WITHOUT_AUTHORIZATION);
}
addAttackDesire(npc, player);
@@ -269,7 +269,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
{
if (obj.equals(npc))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, DIVINITY_MSG[getRandom(DIVINITY_MSG.length)], caster.getName());
npc.broadcastSay(ChatType.NPC_GENERAL, DIVINITY_MSG[getRandom(DIVINITY_MSG.length)], caster.getName());
addAttackDesire(npc, caster);
break;
}

View File

@@ -69,11 +69,11 @@ public final class PlainsOfDion extends AbstractNpcAI
final int i = getRandom(5);
if (i < 2)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, MONSTERS_MSG[i], player.getName());
npc.broadcastSay(ChatType.NPC_GENERAL, MONSTERS_MSG[i], player.getName());
}
else
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, MONSTERS_MSG[i]);
npc.broadcastSay(ChatType.NPC_GENERAL, MONSTERS_MSG[i]);
}
for (L2Character obj : npc.getKnownList().getKnownCharactersInRadius(npc.getTemplate().getClanHelpRange()))
@@ -82,7 +82,7 @@ public final class PlainsOfDion extends AbstractNpcAI
{
final L2Npc monster = (L2Npc) obj;
addAttackDesire(monster, player);
broadcastNpcSay(monster, ChatType.NPC_GENERAL, MONSTERS_ASSIST_MSG[getRandom(3)]);
monster.broadcastSay(ChatType.NPC_GENERAL, MONSTERS_ASSIST_MSG[getRandom(3)]);
}
}
npc.setScriptValue(1);

View File

@@ -309,7 +309,7 @@ public final class PrimevalIsle extends AbstractNpcAI
if (npc.isScriptValue(0))
{
npc.setScriptValue(1);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, "?");
npc.broadcastSay(ChatType.NPC_GENERAL, "?");
((L2Attackable) npc).clearAggroList();
startQuestTimer("TREX_ATTACK", 6000, npc, player);
}

View File

@@ -92,7 +92,7 @@ public final class PrisonGuards extends AbstractNpcAI
{
npc.setTarget(player);
npc.doCast(STONE.getSkill());
broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN);
}
}
else
@@ -101,7 +101,7 @@ public final class PrisonGuards extends AbstractNpcAI
{
npc.setTarget(player);
npc.doCast(STONE.getSkill());
broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE);
}
}
return super.onAttack(npc, player, damage, isSummon);

View File

@@ -242,7 +242,7 @@ public final class SelMahumDrill extends AbstractNpcAI
{
if (getRandom(4) < 1)
{
broadcastNpcSay(receiver, ChatType.NPC_GENERAL, SOLDIER_FSTRINGS[getRandom(2)]);
receiver.broadcastSay(ChatType.NPC_GENERAL, SOLDIER_FSTRINGS[getRandom(2)]);
}
if (receiver.canBeAttacked())
{
@@ -260,7 +260,7 @@ public final class SelMahumDrill extends AbstractNpcAI
{
if (Util.contains(MAHUM_CHIEFS, receiver.getId()))
{
broadcastNpcSay(receiver, ChatType.NPC_GENERAL, CHIEF_FSTRINGS[getRandom(2)]);
receiver.broadcastSay(ChatType.NPC_GENERAL, CHIEF_FSTRINGS[getRandom(2)]);
}
break;
}

View File

@@ -228,7 +228,7 @@ public final class SelMahumSquad extends AbstractNpcAI
final L2Npc stove = addSpawn(STOVE, receiver.getX(), receiver.getY(), receiver.getZ() + 100, 0, false, 0);
stove.setSummoner(receiver);
startQuestTimer("notify_dinner", 2000, receiver, null); // @SCE_DINNER_EAT
broadcastNpcSay(sender, ChatType.NPC_GENERAL, CHEF_FSTRINGS[getRandom(2)], 1250);
sender.broadcastSay(ChatType.NPC_GENERAL, CHEF_FSTRINGS[getRandom(2)], 1250);
}
break;
}
@@ -273,7 +273,7 @@ public final class SelMahumSquad extends AbstractNpcAI
receiver.setIsNoRndWalk(true); // Moving to fire - i_ai0 = 1
receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1
receiver.setIsRunning(true);
broadcastNpcSay(receiver, ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT);
receiver.broadcastSay(ChatType.NPC_GENERAL, (getRandom(3) < 1) ? NpcStringId.LOOKS_DELICIOUS : NpcStringId.LET_S_GO_EAT);
final Location loc = sender.getPointInRange(100, 200);
loc.setHeading(receiver.getHeading());
receiver.stopMove(null);

View File

@@ -102,7 +102,7 @@ public final class SilentValley extends AbstractNpcAI
if (!isSummon && npc.isScriptValue(0))
{
npc.setScriptValue(1);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_WILL_BE_CURSED_FOR_SEEKING_THE_TREASURE);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WILL_BE_CURSED_FOR_SEEKING_THE_TREASURE);
npc.setTarget(player);
npc.doCast(BETRAYAL.getSkill());
}

View File

@@ -82,7 +82,7 @@ public final class TurekOrcs extends AbstractNpcAI
else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.5)) && (npc.getCurrentHp() > (npc.getMaxHp() * 0.3)) && (attacker.getCurrentHp() > (attacker.getMaxHp() * 0.25)) && npc.hasAIValue("fleeX") && npc.hasAIValue("fleeY") && npc.hasAIValue("fleeZ") && (npc.getVariables().getInt("state") == 0) && (getRandom(100) < 10))
{
// Say and flee
broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.getNpcStringId(getRandom(1000007, 1000027)));
npc.broadcastSay(ChatType.GENERAL, NpcStringId.getNpcStringId(getRandom(1000007, 1000027)));
npc.disableCoreAI(true); // to avoid attacking behaviour, while flee
npc.setIsRunning(true);
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getAIValue("fleeX"), npc.getAIValue("fleeY"), npc.getAIValue("fleeZ")));

View File

@@ -90,7 +90,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
else
{
final L2PcInstance target = obj.getActingPlayer();
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_SPAWN[getRandom(NPC_STRINGS_ON_SPAWN.length)], target.getName());
npc.broadcastSay(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);
@@ -113,7 +113,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
{
if (getRandom(100) < CHANCE_TO_SHOUT_ON_ATTACK)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_ATTACK[getRandom(NPC_STRINGS_ON_ATTACK.length)]);
npc.broadcastSay(ChatType.NPC_GENERAL, NPC_STRINGS_ON_ATTACK[getRandom(NPC_STRINGS_ON_ATTACK.length)]);
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -121,7 +121,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_KILL[getRandom(NPC_STRINGS_ON_KILL.length)]);
npc.broadcastSay(ChatType.NPC_GENERAL, NPC_STRINGS_ON_KILL[getRandom(NPC_STRINGS_ON_KILL.length)]);
cancelQuestTimer("DESPAWN", npc, killer);
return super.onKill(npc, killer, isSummon);
}

View File

@@ -270,7 +270,7 @@ public final class Baium extends AbstractNpcAI
if ((player != null) && player.isInsideRadius(npc, 16000, true, false))
{
zone.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HOW_DARE_YOU_WAKE_ME_NOW_YOU_SHALL_DIE, player.getName());
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_DARE_YOU_WAKE_ME_NOW_YOU_SHALL_DIE, player.getName());
npc.setTarget(player);
npc.doCast(BAIUM_PRESENT.getSkill());
}

View File

@@ -83,7 +83,7 @@ public final class CrimsonHatuOtis extends AbstractNpcAI
}
else if (npc.isScriptValue(1) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.3)))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_VE_HAD_IT_UP_TO_HERE_WITH_YOU_I_LL_TAKE_CARE_OF_YOU);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_VE_HAD_IT_UP_TO_HERE_WITH_YOU_I_LL_TAKE_CARE_OF_YOU);
npc.setScriptValue(2);
startQuestTimer("BUFF", 1000, npc, null);
}

View File

@@ -188,7 +188,7 @@ public class DrChaos extends AbstractNpcAI
// Make him speak.
if (_pissedOffTimer == 15)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, "How dare you trespass into my territory! Have you no fear?");
npc.broadcastSay(ChatType.NPC_GENERAL, "How dare you trespass into my territory! Have you no fear?");
}
// That was "too much" for that time.
@@ -249,7 +249,7 @@ public class DrChaos extends AbstractNpcAI
public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
{
cancelQuestTimer("golem_despawn", npc, null);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, "Urggh! You will pay dearly for this insult.");
npc.broadcastSay(ChatType.NPC_GENERAL, "Urggh! You will pay dearly for this insult.");
// "lock" Dr. Chaos for regular RB time (36H fixed +- 24H random)
final long respawnTime = (36 + Rnd.get(-24, 24)) * 3600000;
@@ -288,7 +288,7 @@ public class DrChaos extends AbstractNpcAI
}
// Make him speak.
broadcastNpcSay(npc, ChatType.NPC_GENERAL, message);
npc.broadcastSay(ChatType.NPC_GENERAL, message);
}
return null;
}
@@ -309,7 +309,7 @@ public class DrChaos extends AbstractNpcAI
// Makes the NPC moves near the Strange Box speaking.
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(96323, -110914, -3328, 0));
broadcastNpcSay(npc, ChatType.NPC_GENERAL, "Fools! Why haven't you fled yet? Prepare to learn a lesson!");
npc.broadcastSay(ChatType.NPC_GENERAL, "Fools! Why haven't you fled yet? Prepare to learn a lesson!");
// Delayed animation timers.
startQuestTimer("1", 2000, npc, null, false); // 2 secs, time to launch dr.C anim 2. Cam 1 on.

View File

@@ -62,7 +62,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.2)) && npc.isScriptValue(1))
{
startQuestTimer("reward", 10000, npc, attacker);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WAIT_WAIT_STOP_SAVE_ME_AND_I_LL_GIVE_YOU_10_000_000_ADENA);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WAIT_WAIT_STOP_SAVE_ME_AND_I_LL_GIVE_YOU_10_000_000_ADENA);
npc.setScriptValue(2);
}
return super.onAttack(npc, attacker, damage, isSummon);
@@ -72,7 +72,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final NpcStringId msg = getRandomBoolean() ? NpcStringId.UGH_A_CURSE_UPON_YOU : NpcStringId.I_REALLY_DIDN_T_WANT_TO_FIGHT;
broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg);
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
cancelQuestTimer("say", npc, null);
cancelQuestTimer("reward", npc, player);
return super.onKill(npc, player, isSummon);
@@ -91,7 +91,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
return null;
}
final NpcStringId msg = getRandomBoolean() ? NpcStringId.I_DON_T_WANT_TO_FIGHT : NpcStringId.IS_THIS_REALLY_NECESSARY;
broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg);
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
break;
}
case "reward":
@@ -101,7 +101,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
if (getRandom(100000) < CHANCE2)
{
final NpcStringId msg = getRandomBoolean() ? NpcStringId.TH_THANKS_I_COULD_HAVE_BECOME_GOOD_FRIENDS_WITH_YOU : NpcStringId.I_LL_GIVE_YOU_10_000_000_ADENA_LIKE_I_PROMISED_I_MIGHT_BE_AN_ORC_WHO_KEEPS_MY_PROMISES;
broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg);
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
npc.setScriptValue(3);
npc.doCast(SKILL.getSkill());
for (int i = 0; i < 10; i++)
@@ -112,7 +112,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
else if (getRandom(100000) < CHANCE)
{
final NpcStringId msg = getRandomBoolean() ? NpcStringId.TH_THANKS_I_COULD_HAVE_BECOME_GOOD_FRIENDS_WITH_YOU : NpcStringId.SORRY_BUT_THIS_IS_ALL_I_HAVE_GIVE_ME_A_BREAK;
broadcastNpcSay(npc, ChatType.NPC_GENERAL, msg);
npc.broadcastSay(ChatType.NPC_GENERAL, msg);
npc.setScriptValue(3);
npc.doCast(SKILL.getSkill());
for (int i = 0; i < 10; i++)
@@ -122,7 +122,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
}
else
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME);
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomBoolean() ? NpcStringId.THANKS_BUT_THAT_THING_ABOUT_10_000_000_ADENA_WAS_A_LIE_SEE_YA : NpcStringId.YOU_RE_PRETTY_DUMB_TO_BELIEVE_ME);
}
startQuestTimer("despawn", 1000, npc, null);
}

View File

@@ -71,7 +71,7 @@ public final class QueenShyeed extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.SHYEED_S_CRY_IS_STEADILY_DYING_DOWN);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SHYEED_S_CRY_IS_STEADILY_DYING_DOWN);
startRespawn();
PC_BUFF_ZONE.setEnabled(true);
return super.onKill(npc, killer, isSummon);

View File

@@ -155,7 +155,7 @@ public final class Venom extends AbstractNpcAI
if (CastleManager.getInstance().getCastleById(CASTLE).getSiege().getControlTowerCount() <= 1)
{
changeLocation(MoveTo.THRONE);
broadcastNpcSay(_massymore, ChatType.NPC_SHOUT, NpcStringId.OH_NO_THE_DEFENSES_HAVE_FAILED_IT_IS_TOO_DANGEROUS_TO_REMAIN_INSIDE_THE_CASTLE_FLEE_EVERY_MAN_FOR_HIMSELF);
_massymore.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.OH_NO_THE_DEFENSES_HAVE_FAILED_IT_IS_TOO_DANGEROUS_TO_REMAIN_INSIDE_THE_CASTLE_FLEE_EVERY_MAN_FOR_HIMSELF);
cancelQuestTimer("tower_check", npc, null);
startQuestTimer("raid_check", 10000, npc, null, true);
}
@@ -284,7 +284,7 @@ public final class Venom extends AbstractNpcAI
_venom.disableSkill(VENOM_TELEPORT.getSkill(), -1);
_venom.disableSkill(RANGE_TELEPORT.getSkill(), -1);
_venom.doRevive();
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.WHO_DARES_TO_COVET_THE_THRONE_OF_OUR_CASTLE_LEAVE_IMMEDIATELY_OR_YOU_WILL_PAY_THE_PRICE_OF_YOUR_AUDACITY_WITH_YOUR_VERY_OWN_BLOOD);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.WHO_DARES_TO_COVET_THE_THRONE_OF_OUR_CASTLE_LEAVE_IMMEDIATELY_OR_YOU_WILL_PAY_THE_PRICE_OF_YOUR_AUDACITY_WITH_YOUR_VERY_OWN_BLOOD);
((L2Attackable) _venom).setCanReturnToSpawnPoint(false);
if (checkStatus() == DEAD)
{
@@ -335,7 +335,7 @@ public final class Venom extends AbstractNpcAI
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
updateStatus(DEAD);
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.IT_S_NOT_OVER_YET_IT_WON_T_BE_OVER_LIKE_THIS_NEVER);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.IT_S_NOT_OVER_YET_IT_WON_T_BE_OVER_LIKE_THIS_NEVER);
if (!CastleManager.getInstance().getCastleById(CASTLE).getSiege().isInProgress())
{
final L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);

View File

@@ -16,15 +16,11 @@
*/
package ai.npc;
import com.l2jmobius.gameserver.enums.ChatType;
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.holders.MinionHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.util.Broadcast;
/**
* Abstract NPC AI class for datapack based AIs.
@@ -70,60 +66,6 @@ public abstract class AbstractNpcAI extends Quest
addFactionCallId(mobs);
}
/**
* Broadcasts NpcSay packet to all known players with custom string.
* @param npc
* @param type
* @param text
*/
protected void broadcastNpcSay(L2Npc npc, ChatType type, String text)
{
Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), text));
}
/**
* Broadcasts NpcSay packet to all known players with npc string id.
* @param npc
* @param type
* @param stringId
*/
protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId)
{
Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId));
}
/**
* Broadcasts NpcSay packet to all known players with npc string id.
* @param npc
* @param type
* @param stringId
* @param parameters
*/
protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId, String... parameters)
{
final NpcSay say = new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId);
if (parameters != null)
{
for (String parameter : parameters)
{
say.addStringParameter(parameter);
}
}
Broadcast.toKnownPlayers(npc, say);
}
/**
* Broadcasts NpcSay packet to all known players with npc string id in specific radius.
* @param npc
* @param type
* @param stringId
* @param radius
*/
protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId, int radius)
{
Broadcast.toKnownPlayersInRadius(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId), radius);
}
public void spawnMinions(L2Npc npc, String spawnName)
{
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList(spawnName))

View File

@@ -59,19 +59,19 @@ public final class Alarm extends AbstractNpcAI
case "SELF_DESTRUCT_IN_60":
{
startQuestTimer("SELF_DESTRUCT_IN_30", 30000, npc, null);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_60_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_60_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "SELF_DESTRUCT_IN_30":
{
startQuestTimer("SELF_DESTRUCT_IN_10", 20000, npc, null);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_30_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_30_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "SELF_DESTRUCT_IN_10":
{
startQuestTimer("RECORDER_CRUSHED", 10000, npc, null);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "RECORDER_CRUSHED":
@@ -81,7 +81,7 @@ public final class Alarm extends AbstractNpcAI
npc0.getVariables().set("SPAWNED", false);
if (player0 != null)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED);
if (verifyMemoState(player0, ART_OF_PERSUASION_ID, -1))
{
setMemoState(player0, ART_OF_PERSUASION_ID, 5);
@@ -225,7 +225,7 @@ public final class Alarm extends AbstractNpcAI
public String onSpawn(L2Npc npc)
{
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
if (player != null)
{

View File

@@ -56,7 +56,7 @@ public final class Dorian extends AbstractNpcAI
takeItems(pl, SILVER_CROSS, -1);
giveItems(pl, BROKEN_SILVER_CROSS, 1);
qs.setCond(4, true);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THAT_SIGN);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THAT_SIGN);
}
}
return super.onSeeCreature(npc, creature, isSummon);

View File

@@ -94,22 +94,22 @@ public final class Rooney extends AbstractNpcAI
{
case 1:
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HURRY_HURRY);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HURRY_HURRY);
break;
}
case 2:
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_AM_NOT_THAT_TYPE_OF_PERSON_WHO_STAYS_IN_ONE_PLACE_FOR_A_LONG_TIME);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_AM_NOT_THAT_TYPE_OF_PERSON_WHO_STAYS_IN_ONE_PLACE_FOR_A_LONG_TIME);
break;
}
case 3:
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IT_S_HARD_FOR_ME_TO_KEEP_STANDING_LIKE_THIS);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_HARD_FOR_ME_TO_KEEP_STANDING_LIKE_THIS);
break;
}
case 4:
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WHY_DON_T_I_GO_THAT_WAY_THIS_TIME);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHY_DON_T_I_GO_THAT_WAY_THIS_TIME);
break;
}
default:
@@ -130,7 +130,7 @@ public final class Rooney extends AbstractNpcAI
{
if (creature.isPlayer() && npc.isScriptValue(0))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WELCOME);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WELCOME);
startQuestTimer("teleport", 60000, npc, null);
npc.setScriptValue(1);
}

View File

@@ -75,7 +75,7 @@ public final class Katenar extends AbstractNpcAI
if (!npc.getVariables().getBoolean("SPAWNED", false))
{
npc0.getVariables().set("SPAWNED", false);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.GOOD_LUCK);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.GOOD_LUCK);
}
}
npc.deleteMe();
@@ -130,7 +130,7 @@ public final class Katenar extends AbstractNpcAI
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
if (player != null)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_AM_LATE);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_AM_LATE);
}
return super.onSpawn(npc);
}

View File

@@ -191,15 +191,15 @@ public final class MercenaryCaptain extends AbstractNpcAI
{
if (TerritoryWarManager.getInstance().isTWInProgress())
{
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.CHARGE_CHARGE_CHARGE);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.CHARGE_CHARGE_CHARGE);
}
else if (getRandom(2) == 0)
{
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.COURAGE_AMBITION_PASSION_MERCENARIES_WHO_WANT_TO_REALIZE_THEIR_DREAM_OF_FIGHTING_IN_THE_TERRITORY_WAR_COME_TO_ME_FORTUNE_AND_GLORY_ARE_WAITING_FOR_YOU);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.COURAGE_AMBITION_PASSION_MERCENARIES_WHO_WANT_TO_REALIZE_THEIR_DREAM_OF_FIGHTING_IN_THE_TERRITORY_WAR_COME_TO_ME_FORTUNE_AND_GLORY_ARE_WAITING_FOR_YOU);
}
else
{
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.DO_YOU_WISH_TO_FIGHT_ARE_YOU_AFRAID_NO_MATTER_HOW_HARD_YOU_TRY_YOU_HAVE_NOWHERE_TO_RUN_BUT_IF_YOU_FACE_IT_HEAD_ON_OUR_MERCENARY_TROOP_WILL_HELP_YOU_OUT);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.DO_YOU_WISH_TO_FIGHT_ARE_YOU_AFRAID_NO_MATTER_HOW_HARD_YOU_TRY_YOU_HAVE_NOWHERE_TO_RUN_BUT_IF_YOU_FACE_IT_HEAD_ON_OUR_MERCENARY_TROOP_WILL_HELP_YOU_OUT);
}
}
return htmltext;

View File

@@ -88,7 +88,7 @@ public final class Minigame extends AbstractNpcAI
takeItems(player, UNLIT_TORCHLIGHT, 1);
giveItems(player, TORCHLIGHT, 1);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_FURNACE_WILL_GO_OUT_WATCH_AND_SEE);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_FURNACE_WILL_GO_OUT_WATCH_AND_SEE);
room.getManager().setTarget(player);
room.setParticipant(player);
@@ -153,7 +153,7 @@ public final class Minigame extends AbstractNpcAI
}
else
{
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.NOW_LIGHT_THE_FURNACE_S_FIRE);
room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.NOW_LIGHT_THE_FURNACE_S_FIRE);
room.burnThemAll();
startQuestTimer("off", 2000, npc, null);
final ConsumerEventListener listener = new ConsumerEventListener(room.getParticipant(), EventType.ON_CREATURE_SKILL_USE, (OnCreatureSkillUse listenerEvent) -> onSkillUse(listenerEvent), room);
@@ -164,19 +164,19 @@ public final class Minigame extends AbstractNpcAI
}
case "hurry_up":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THERE_S_ABOUT_1_MINUTE_LEFT);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THERE_S_ABOUT_1_MINUTE_LEFT);
startQuestTimer("hurry_up2", 60000, npc, null);
break;
}
case "hurry_up2":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THERE_S_JUST_10_SECONDS_LEFT);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THERE_S_JUST_10_SECONDS_LEFT);
startQuestTimer("expire", 10000, npc, null);
break;
}
case "expire":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.TIME_IS_UP_AND_YOU_HAVE_FAILED_ANY_MORE_WILL_BE_DIFFICULT);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TIME_IS_UP_AND_YOU_HAVE_FAILED_ANY_MORE_WILL_BE_DIFFICULT);
}
case "end":
{
@@ -284,7 +284,7 @@ public final class Minigame extends AbstractNpcAI
else
{
addSpawn(TREASURE_BOX, room.getParticipant().getLocation(), true, 0);
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.OH_YOU_VE_SUCCEEDED);
room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.OH_YOU_VE_SUCCEEDED);
room.setCurrentPot(0);
room.burnThemAll();
startQuestTimer("off", 2000, room.getManager(), null);
@@ -293,7 +293,7 @@ public final class Minigame extends AbstractNpcAI
}
else if (room.getAttemptNumber() == MAX_ATTEMPTS)
{
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.AH_I_VE_FAILED_GOING_FURTHER_WILL_BE_DIFFICULT);
room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AH_I_VE_FAILED_GOING_FURTHER_WILL_BE_DIFFICULT);
room.burnThemAll();
startQuestTimer("off", 2000, room.getManager(), null);
room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room);
@@ -301,7 +301,7 @@ public final class Minigame extends AbstractNpcAI
}
else if (room.getAttemptNumber() < MAX_ATTEMPTS)
{
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.AH_IS_THIS_FAILURE_BUT_IT_LOOKS_LIKE_I_CAN_KEEP_GOING);
room.getManager().broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AH_IS_THIS_FAILURE_BUT_IT_LOOKS_LIKE_I_CAN_KEEP_GOING);
room.burnThemAll();
startQuestTimer("off", 2000, room.getManager(), null);
room.setAttemptNumber(room.getAttemptNumber() + 1);

View File

@@ -280,11 +280,11 @@ public final class CabaleBuffer extends AbstractNpcAI
{
if (chance == -1)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, message);
npc.broadcastSay(ChatType.NPC_GENERAL, message);
}
else if (getRandom(10000) < chance)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, message, param);
npc.broadcastSay(ChatType.NPC_GENERAL, message, param);
}
}

View File

@@ -101,7 +101,7 @@ public final class TeleportToFantasy extends AbstractNpcAI
}
else
{
broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(RUNE_TOWNSHIP);
}
}

View File

@@ -95,7 +95,7 @@ public final class TeleportToRaceTrack extends AbstractNpcAI
}
else
{
broadcastNpcSay(npc, ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN);
npc.broadcastSay(ChatType.GENERAL, NpcStringId.IF_YOUR_MEANS_OF_ARRIVAL_WAS_A_BIT_UNCONVENTIONAL_THEN_I_LL_BE_SENDING_YOU_BACK_TO_RUNE_TOWNSHIP_WHICH_IS_THE_NEAREST_TOWN);
player.teleToLocation(DION_CASTLE_TOWN);
}
}