Partial sync latest Test changes to HighFive.
This commit is contained in:
@@ -27,7 +27,6 @@ import com.l2jmobius.gameserver.model.Location;
|
|||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
|
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
|
||||||
|
|
||||||
import ai.npc.AbstractNpcAI;
|
import ai.npc.AbstractNpcAI;
|
||||||
@@ -308,11 +307,6 @@ public final class TalentShow extends AbstractNpcAI
|
|||||||
startQuestTimer("Start", diff, null, null); // first start
|
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
|
@Override
|
||||||
public String onSpawn(L2Npc npc)
|
public String onSpawn(L2Npc npc)
|
||||||
{
|
{
|
||||||
@@ -322,7 +316,7 @@ public final class TalentShow extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
case 32433:
|
case 32433:
|
||||||
{
|
{
|
||||||
autoChat(npc, MESSAGES[0], ChatType.NPC_SHOUT);
|
npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[0]);
|
||||||
startQuestTimer("1", 30000, npc, null);
|
startQuestTimer("1", 30000, npc, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -384,7 +378,7 @@ public final class TalentShow extends AbstractNpcAI
|
|||||||
// TODO switch on event
|
// TODO switch on event
|
||||||
if (event.equalsIgnoreCase("6"))
|
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.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));
|
npc.broadcastPacket(new PlaySound(1, "NS22_F", 0, 0, 0, 0, 0));
|
||||||
addSpawn(SINGERS[0], -56344, -56328, -2008, 32768, false, 224000);
|
addSpawn(SINGERS[0], -56344, -56328, -2008, 32768, false, 224000);
|
||||||
@@ -402,7 +396,7 @@ public final class TalentShow extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
case 32433:
|
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));
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-56698, -56430, -2008, 32768));
|
||||||
startQuestTimer("8", 12000, npc, null);
|
startQuestTimer("8", 12000, npc, null);
|
||||||
break;
|
break;
|
||||||
@@ -436,7 +430,7 @@ public final class TalentShow extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
case 32433:
|
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));
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-56698, -56430, -2008, 32768));
|
||||||
startQuestTimer("12", 5000, npc, null);
|
startQuestTimer("12", 5000, npc, null);
|
||||||
break;
|
break;
|
||||||
@@ -455,7 +449,7 @@ public final class TalentShow extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("17"))
|
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("social1", 2000, addSpawn(INDIVIDUALS[1], -56700, -56340, -2008, 32768, false, 32000), null);
|
||||||
startQuestTimer("18", 9000, npc, null);
|
startQuestTimer("18", 9000, npc, null);
|
||||||
}
|
}
|
||||||
@@ -476,7 +470,7 @@ public final class TalentShow extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("28"))
|
else if (event.equalsIgnoreCase("28"))
|
||||||
{
|
{
|
||||||
autoChat(npc, MESSAGES[23], ChatType.NPC_GENERAL);
|
npc.broadcastSay(ChatType.NPC_SHOUT, MESSAGES[23]);
|
||||||
startQuestTimer("social1", 1, npc, null);
|
startQuestTimer("social1", 1, npc, null);
|
||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("29"))
|
else if (event.equalsIgnoreCase("29"))
|
||||||
@@ -499,7 +493,7 @@ public final class TalentShow extends AbstractNpcAI
|
|||||||
final ShoutInfo si = TALKS.get(event);
|
final ShoutInfo si = TALKS.get(event);
|
||||||
if (si != null)
|
if (si != null)
|
||||||
{
|
{
|
||||||
autoChat(npc, si.getNpcStringId(), ChatType.NPC_SHOUT);
|
npc.broadcastSay(ChatType.NPC_SHOUT, si.getNpcStringId());
|
||||||
startQuestTimer(si.getNextEvent(), si.getTime(), npc, null);
|
startQuestTimer(si.getNextEvent(), si.getTime(), npc, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -51,11 +51,11 @@ public final class GiantsCave extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (npc.getId() == SCOUTS[0]) // Gamlin
|
if (npc.getId() == SCOUTS[0]) // Gamlin
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.INTRUDER_DETECTED);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.INTRUDER_DETECTED);
|
||||||
}
|
}
|
||||||
else
|
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))
|
for (L2Character characters : npc.getKnownList().getKnownCharactersInRadius(450))
|
||||||
@@ -93,11 +93,11 @@ public final class GiantsCave extends AbstractNpcAI
|
|||||||
npc.setScriptValue(1);
|
npc.setScriptValue(1);
|
||||||
if (getRandomBoolean())
|
if (getRandomBoolean())
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_GUYS_ARE_DETECTED);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_GUYS_ARE_DETECTED);
|
||||||
}
|
}
|
||||||
else
|
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("ATTACK", 6000, npc, player);
|
||||||
startQuestTimer("CLEAR", 120000, npc, null);
|
startQuestTimer("CLEAR", 120000, npc, null);
|
||||||
|
@@ -80,7 +80,7 @@ public final class LairOfAntharas extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
npc.setScriptValue(1);
|
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);
|
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);
|
final L2Npc newKnight = addSpawn(DRAGON_KNIGHT2, npc, false, 0, true);
|
||||||
npc.deleteMe();
|
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);
|
addAttackDesire(newKnight, killer);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -107,7 +107,7 @@ public final class LairOfAntharas extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final L2Npc eliteKnight = addSpawn(ELITE_DRAGON_KNIGHT, npc, false, 0, true);
|
final L2Npc eliteKnight = addSpawn(ELITE_DRAGON_KNIGHT, npc, false, 0, true);
|
||||||
npc.deleteMe();
|
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);
|
addAttackDesire(eliteKnight, killer);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -440,7 +440,7 @@ public final class MinionSpawnManager extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
addMinion((L2MonsterInstance) npc, is.getId());
|
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)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -95,7 +95,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
|
|||||||
if ((character.getId() == CAPTAIN) && (getRandom(100) < 10) && npc.isScriptValue(0))
|
if ((character.getId() == CAPTAIN) && (getRandom(100) < 10) && npc.isScriptValue(0))
|
||||||
{
|
{
|
||||||
final L2Npc captain = (L2Npc) character;
|
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);
|
captain.setScriptValue(1);
|
||||||
startQuestTimer("TIMER", 10000, captain, null);
|
startQuestTimer("TIMER", 10000, captain, null);
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
|
|||||||
npc.doCast(KNIGHT_BLESS.getSkill());
|
npc.doCast(KNIGHT_BLESS.getSkill());
|
||||||
}
|
}
|
||||||
npc.setScriptValue(1);
|
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);
|
addAttackDesire(addSpawn(KNIGHT, npc), player);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -252,7 +252,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
|
|||||||
|
|
||||||
if (!npc.isInCombat())
|
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);
|
addAttackDesire(npc, player);
|
||||||
@@ -269,7 +269,7 @@ public final class MonasteryOfSilence extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (obj.equals(npc))
|
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);
|
addAttackDesire(npc, caster);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -69,11 +69,11 @@ public final class PlainsOfDion extends AbstractNpcAI
|
|||||||
final int i = getRandom(5);
|
final int i = getRandom(5);
|
||||||
if (i < 2)
|
if (i < 2)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, MONSTERS_MSG[i], player.getName());
|
npc.broadcastSay(ChatType.NPC_GENERAL, MONSTERS_MSG[i], player.getName());
|
||||||
}
|
}
|
||||||
else
|
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()))
|
for (L2Character obj : npc.getKnownList().getKnownCharactersInRadius(npc.getTemplate().getClanHelpRange()))
|
||||||
@@ -82,7 +82,7 @@ public final class PlainsOfDion extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
final L2Npc monster = (L2Npc) obj;
|
final L2Npc monster = (L2Npc) obj;
|
||||||
addAttackDesire(monster, player);
|
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);
|
npc.setScriptValue(1);
|
||||||
|
@@ -309,7 +309,7 @@ public final class PrimevalIsle extends AbstractNpcAI
|
|||||||
if (npc.isScriptValue(0))
|
if (npc.isScriptValue(0))
|
||||||
{
|
{
|
||||||
npc.setScriptValue(1);
|
npc.setScriptValue(1);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, "?");
|
npc.broadcastSay(ChatType.NPC_GENERAL, "?");
|
||||||
((L2Attackable) npc).clearAggroList();
|
((L2Attackable) npc).clearAggroList();
|
||||||
startQuestTimer("TREX_ATTACK", 6000, npc, player);
|
startQuestTimer("TREX_ATTACK", 6000, npc, player);
|
||||||
}
|
}
|
||||||
|
@@ -92,7 +92,7 @@ public final class PrisonGuards extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
npc.setTarget(player);
|
npc.setTarget(player);
|
||||||
npc.doCast(STONE.getSkill());
|
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
|
else
|
||||||
@@ -101,7 +101,7 @@ public final class PrisonGuards extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
npc.setTarget(player);
|
npc.setTarget(player);
|
||||||
npc.doCast(STONE.getSkill());
|
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);
|
return super.onAttack(npc, player, damage, isSummon);
|
||||||
|
@@ -242,7 +242,7 @@ public final class SelMahumDrill extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (getRandom(4) < 1)
|
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())
|
if (receiver.canBeAttacked())
|
||||||
{
|
{
|
||||||
@@ -260,7 +260,7 @@ public final class SelMahumDrill extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (Util.contains(MAHUM_CHIEFS, receiver.getId()))
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -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);
|
final L2Npc stove = addSpawn(STOVE, receiver.getX(), receiver.getY(), receiver.getZ() + 100, 0, false, 0);
|
||||||
stove.setSummoner(receiver);
|
stove.setSummoner(receiver);
|
||||||
startQuestTimer("notify_dinner", 2000, receiver, null); // @SCE_DINNER_EAT
|
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;
|
break;
|
||||||
}
|
}
|
||||||
@@ -273,7 +273,7 @@ public final class SelMahumSquad extends AbstractNpcAI
|
|||||||
receiver.setIsNoRndWalk(true); // Moving to fire - i_ai0 = 1
|
receiver.setIsNoRndWalk(true); // Moving to fire - i_ai0 = 1
|
||||||
receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1
|
receiver.getVariables().set("BUSY_STATE", 1); // Eating - i_ai3 = 1
|
||||||
receiver.setIsRunning(true);
|
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);
|
final Location loc = sender.getPointInRange(100, 200);
|
||||||
loc.setHeading(receiver.getHeading());
|
loc.setHeading(receiver.getHeading());
|
||||||
receiver.stopMove(null);
|
receiver.stopMove(null);
|
||||||
|
@@ -102,7 +102,7 @@ public final class SilentValley extends AbstractNpcAI
|
|||||||
if (!isSummon && npc.isScriptValue(0))
|
if (!isSummon && npc.isScriptValue(0))
|
||||||
{
|
{
|
||||||
npc.setScriptValue(1);
|
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.setTarget(player);
|
||||||
npc.doCast(BETRAYAL.getSkill());
|
npc.doCast(BETRAYAL.getSkill());
|
||||||
}
|
}
|
||||||
|
@@ -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))
|
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
|
// 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.disableCoreAI(true); // to avoid attacking behaviour, while flee
|
||||||
npc.setIsRunning(true);
|
npc.setIsRunning(true);
|
||||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getAIValue("fleeX"), npc.getAIValue("fleeY"), npc.getAIValue("fleeZ")));
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(npc.getAIValue("fleeX"), npc.getAIValue("fleeY"), npc.getAIValue("fleeZ")));
|
||||||
|
@@ -90,7 +90,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
final L2PcInstance target = obj.getActingPlayer();
|
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);
|
((L2Attackable) npc).addDamageHate(target, 0, 2000);
|
||||||
npc.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, target);
|
npc.getAI().notifyEvent(CtrlEvent.EVT_ATTACKED, target);
|
||||||
npc.addAttackerToAttackByList(target);
|
npc.addAttackerToAttackByList(target);
|
||||||
@@ -113,7 +113,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (getRandom(100) < CHANCE_TO_SHOUT_ON_ATTACK)
|
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);
|
return super.onAttack(npc, attacker, damage, isSummon);
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
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);
|
cancelQuestTimer("DESPAWN", npc, killer);
|
||||||
return super.onKill(npc, killer, isSummon);
|
return super.onKill(npc, killer, isSummon);
|
||||||
}
|
}
|
||||||
|
@@ -270,7 +270,7 @@ public final class Baium extends AbstractNpcAI
|
|||||||
if ((player != null) && player.isInsideRadius(npc, 16000, true, false))
|
if ((player != null) && player.isInsideRadius(npc, 16000, true, false))
|
||||||
{
|
{
|
||||||
zone.broadcastPacket(new SocialAction(npc.getObjectId(), 1));
|
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.setTarget(player);
|
||||||
npc.doCast(BAIUM_PRESENT.getSkill());
|
npc.doCast(BAIUM_PRESENT.getSkill());
|
||||||
}
|
}
|
||||||
|
@@ -83,7 +83,7 @@ public final class CrimsonHatuOtis extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (npc.isScriptValue(1) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.3)))
|
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);
|
npc.setScriptValue(2);
|
||||||
startQuestTimer("BUFF", 1000, npc, null);
|
startQuestTimer("BUFF", 1000, npc, null);
|
||||||
}
|
}
|
||||||
|
@@ -188,7 +188,7 @@ public class DrChaos extends AbstractNpcAI
|
|||||||
// Make him speak.
|
// Make him speak.
|
||||||
if (_pissedOffTimer == 15)
|
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.
|
// 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)
|
public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
|
||||||
{
|
{
|
||||||
cancelQuestTimer("golem_despawn", npc, null);
|
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)
|
// "lock" Dr. Chaos for regular RB time (36H fixed +- 24H random)
|
||||||
final long respawnTime = (36 + Rnd.get(-24, 24)) * 3600000;
|
final long respawnTime = (36 + Rnd.get(-24, 24)) * 3600000;
|
||||||
@@ -288,7 +288,7 @@ public class DrChaos extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make him speak.
|
// Make him speak.
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, message);
|
npc.broadcastSay(ChatType.NPC_GENERAL, message);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -309,7 +309,7 @@ public class DrChaos extends AbstractNpcAI
|
|||||||
|
|
||||||
// Makes the NPC moves near the Strange Box speaking.
|
// Makes the NPC moves near the Strange Box speaking.
|
||||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(96323, -110914, -3328, 0));
|
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.
|
// Delayed animation timers.
|
||||||
startQuestTimer("1", 2000, npc, null, false); // 2 secs, time to launch dr.C anim 2. Cam 1 on.
|
startQuestTimer("1", 2000, npc, null, false); // 2 secs, time to launch dr.C anim 2. Cam 1 on.
|
||||||
|
@@ -62,7 +62,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
|
|||||||
else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.2)) && npc.isScriptValue(1))
|
else if ((npc.getCurrentHp() < (npc.getMaxHp() * 0.2)) && npc.isScriptValue(1))
|
||||||
{
|
{
|
||||||
startQuestTimer("reward", 10000, npc, attacker);
|
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);
|
npc.setScriptValue(2);
|
||||||
}
|
}
|
||||||
return super.onAttack(npc, attacker, damage, isSummon);
|
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)
|
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;
|
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("say", npc, null);
|
||||||
cancelQuestTimer("reward", npc, player);
|
cancelQuestTimer("reward", npc, player);
|
||||||
return super.onKill(npc, player, isSummon);
|
return super.onKill(npc, player, isSummon);
|
||||||
@@ -91,7 +91,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final NpcStringId msg = getRandomBoolean() ? NpcStringId.I_DON_T_WANT_TO_FIGHT : NpcStringId.IS_THIS_REALLY_NECESSARY;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case "reward":
|
case "reward":
|
||||||
@@ -101,7 +101,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
|
|||||||
if (getRandom(100000) < CHANCE2)
|
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;
|
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.setScriptValue(3);
|
||||||
npc.doCast(SKILL.getSkill());
|
npc.doCast(SKILL.getSkill());
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
@@ -112,7 +112,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
|
|||||||
else if (getRandom(100000) < CHANCE)
|
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;
|
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.setScriptValue(3);
|
||||||
npc.doCast(SKILL.getSkill());
|
npc.doCast(SKILL.getSkill());
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
@@ -122,7 +122,7 @@ public final class FrightenedRagnaOrc extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
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);
|
startQuestTimer("despawn", 1000, npc, null);
|
||||||
}
|
}
|
||||||
|
@@ -71,7 +71,7 @@ public final class QueenShyeed extends AbstractNpcAI
|
|||||||
@Override
|
@Override
|
||||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
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();
|
startRespawn();
|
||||||
PC_BUFF_ZONE.setEnabled(true);
|
PC_BUFF_ZONE.setEnabled(true);
|
||||||
return super.onKill(npc, killer, isSummon);
|
return super.onKill(npc, killer, isSummon);
|
||||||
|
@@ -155,7 +155,7 @@ public final class Venom extends AbstractNpcAI
|
|||||||
if (CastleManager.getInstance().getCastleById(CASTLE).getSiege().getControlTowerCount() <= 1)
|
if (CastleManager.getInstance().getCastleById(CASTLE).getSiege().getControlTowerCount() <= 1)
|
||||||
{
|
{
|
||||||
changeLocation(MoveTo.THRONE);
|
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);
|
cancelQuestTimer("tower_check", npc, null);
|
||||||
startQuestTimer("raid_check", 10000, npc, null, true);
|
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(VENOM_TELEPORT.getSkill(), -1);
|
||||||
_venom.disableSkill(RANGE_TELEPORT.getSkill(), -1);
|
_venom.disableSkill(RANGE_TELEPORT.getSkill(), -1);
|
||||||
_venom.doRevive();
|
_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);
|
((L2Attackable) _venom).setCanReturnToSpawnPoint(false);
|
||||||
if (checkStatus() == DEAD)
|
if (checkStatus() == DEAD)
|
||||||
{
|
{
|
||||||
@@ -335,7 +335,7 @@ public final class Venom extends AbstractNpcAI
|
|||||||
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
|
||||||
{
|
{
|
||||||
updateStatus(DEAD);
|
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())
|
if (!CastleManager.getInstance().getCastleById(CASTLE).getSiege().isInProgress())
|
||||||
{
|
{
|
||||||
final L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);
|
final L2Npc cube = addSpawn(TELEPORT_CUBE, CUBE, false, 0);
|
||||||
|
@@ -16,15 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package ai.npc;
|
package ai.npc;
|
||||||
|
|
||||||
import com.l2jmobius.gameserver.enums.ChatType;
|
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.model.holders.MinionHolder;
|
import com.l2jmobius.gameserver.model.holders.MinionHolder;
|
||||||
import com.l2jmobius.gameserver.model.quest.Quest;
|
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.
|
* Abstract NPC AI class for datapack based AIs.
|
||||||
@@ -70,60 +66,6 @@ public abstract class AbstractNpcAI extends Quest
|
|||||||
addFactionCallId(mobs);
|
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)
|
public void spawnMinions(L2Npc npc, String spawnName)
|
||||||
{
|
{
|
||||||
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList(spawnName))
|
for (MinionHolder is : npc.getTemplate().getParameters().getMinionList(spawnName))
|
||||||
|
@@ -59,19 +59,19 @@ public final class Alarm extends AbstractNpcAI
|
|||||||
case "SELF_DESTRUCT_IN_60":
|
case "SELF_DESTRUCT_IN_60":
|
||||||
{
|
{
|
||||||
startQuestTimer("SELF_DESTRUCT_IN_30", 30000, npc, null);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case "SELF_DESTRUCT_IN_30":
|
case "SELF_DESTRUCT_IN_30":
|
||||||
{
|
{
|
||||||
startQuestTimer("SELF_DESTRUCT_IN_10", 20000, npc, null);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case "SELF_DESTRUCT_IN_10":
|
case "SELF_DESTRUCT_IN_10":
|
||||||
{
|
{
|
||||||
startQuestTimer("RECORDER_CRUSHED", 10000, npc, null);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case "RECORDER_CRUSHED":
|
case "RECORDER_CRUSHED":
|
||||||
@@ -81,7 +81,7 @@ public final class Alarm extends AbstractNpcAI
|
|||||||
npc0.getVariables().set("SPAWNED", false);
|
npc0.getVariables().set("SPAWNED", false);
|
||||||
if (player0 != null)
|
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))
|
if (verifyMemoState(player0, ART_OF_PERSUASION_ID, -1))
|
||||||
{
|
{
|
||||||
setMemoState(player0, ART_OF_PERSUASION_ID, 5);
|
setMemoState(player0, ART_OF_PERSUASION_ID, 5);
|
||||||
@@ -225,7 +225,7 @@ public final class Alarm extends AbstractNpcAI
|
|||||||
public String onSpawn(L2Npc npc)
|
public String onSpawn(L2Npc npc)
|
||||||
{
|
{
|
||||||
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
|
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);
|
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
|
@@ -56,7 +56,7 @@ public final class Dorian extends AbstractNpcAI
|
|||||||
takeItems(pl, SILVER_CROSS, -1);
|
takeItems(pl, SILVER_CROSS, -1);
|
||||||
giveItems(pl, BROKEN_SILVER_CROSS, 1);
|
giveItems(pl, BROKEN_SILVER_CROSS, 1);
|
||||||
qs.setCond(4, true);
|
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);
|
return super.onSeeCreature(npc, creature, isSummon);
|
||||||
|
@@ -94,22 +94,22 @@ public final class Rooney extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HURRY_HURRY);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HURRY_HURRY);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -130,7 +130,7 @@ public final class Rooney extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (creature.isPlayer() && npc.isScriptValue(0))
|
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);
|
startQuestTimer("teleport", 60000, npc, null);
|
||||||
npc.setScriptValue(1);
|
npc.setScriptValue(1);
|
||||||
}
|
}
|
||||||
|
@@ -75,7 +75,7 @@ public final class Katenar extends AbstractNpcAI
|
|||||||
if (!npc.getVariables().getBoolean("SPAWNED", false))
|
if (!npc.getVariables().getBoolean("SPAWNED", false))
|
||||||
{
|
{
|
||||||
npc0.getVariables().set("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();
|
npc.deleteMe();
|
||||||
@@ -130,7 +130,7 @@ public final class Katenar extends AbstractNpcAI
|
|||||||
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
|
final L2PcInstance player = npc.getVariables().getObject("player0", L2PcInstance.class);
|
||||||
if (player != null)
|
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);
|
return super.onSpawn(npc);
|
||||||
}
|
}
|
||||||
|
@@ -191,15 +191,15 @@ public final class MercenaryCaptain extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (TerritoryWarManager.getInstance().isTWInProgress())
|
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)
|
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
|
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;
|
return htmltext;
|
||||||
|
@@ -88,7 +88,7 @@ public final class Minigame extends AbstractNpcAI
|
|||||||
|
|
||||||
takeItems(player, UNLIT_TORCHLIGHT, 1);
|
takeItems(player, UNLIT_TORCHLIGHT, 1);
|
||||||
giveItems(player, 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.getManager().setTarget(player);
|
||||||
room.setParticipant(player);
|
room.setParticipant(player);
|
||||||
@@ -153,7 +153,7 @@ public final class Minigame extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
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();
|
room.burnThemAll();
|
||||||
startQuestTimer("off", 2000, npc, null);
|
startQuestTimer("off", 2000, npc, null);
|
||||||
final ConsumerEventListener listener = new ConsumerEventListener(room.getParticipant(), EventType.ON_CREATURE_SKILL_USE, (OnCreatureSkillUse listenerEvent) -> onSkillUse(listenerEvent), room);
|
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":
|
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);
|
startQuestTimer("hurry_up2", 60000, npc, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "hurry_up2":
|
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);
|
startQuestTimer("expire", 10000, npc, null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "expire":
|
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":
|
case "end":
|
||||||
{
|
{
|
||||||
@@ -284,7 +284,7 @@ public final class Minigame extends AbstractNpcAI
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
addSpawn(TREASURE_BOX, room.getParticipant().getLocation(), true, 0);
|
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.setCurrentPot(0);
|
||||||
room.burnThemAll();
|
room.burnThemAll();
|
||||||
startQuestTimer("off", 2000, room.getManager(), null);
|
startQuestTimer("off", 2000, room.getManager(), null);
|
||||||
@@ -293,7 +293,7 @@ public final class Minigame extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if (room.getAttemptNumber() == MAX_ATTEMPTS)
|
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();
|
room.burnThemAll();
|
||||||
startQuestTimer("off", 2000, room.getManager(), null);
|
startQuestTimer("off", 2000, room.getManager(), null);
|
||||||
room.getParticipant().removeListenerIf(EventType.ON_CREATURE_SKILL_USE, listener -> listener.getOwner() == room);
|
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)
|
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();
|
room.burnThemAll();
|
||||||
startQuestTimer("off", 2000, room.getManager(), null);
|
startQuestTimer("off", 2000, room.getManager(), null);
|
||||||
room.setAttemptNumber(room.getAttemptNumber() + 1);
|
room.setAttemptNumber(room.getAttemptNumber() + 1);
|
||||||
|
@@ -280,11 +280,11 @@ public final class CabaleBuffer extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (chance == -1)
|
if (chance == -1)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, message);
|
npc.broadcastSay(ChatType.NPC_GENERAL, message);
|
||||||
}
|
}
|
||||||
else if (getRandom(10000) < chance)
|
else if (getRandom(10000) < chance)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, message, param);
|
npc.broadcastSay(ChatType.NPC_GENERAL, message, param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -101,7 +101,7 @@ public final class TeleportToFantasy extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
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);
|
player.teleToLocation(RUNE_TOWNSHIP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -95,7 +95,7 @@ public final class TeleportToRaceTrack extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
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);
|
player.teleToLocation(DION_CASTLE_TOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -58,11 +58,11 @@ public final class DevastatedCastle extends ClanHallSiegeEngine
|
|||||||
{
|
{
|
||||||
if (npc.getId() == MIKHAIL)
|
if (npc.getId() == MIKHAIL)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.GLORY_TO_ADEN_THE_KINGDOM_OF_THE_LION_GLORY_TO_SIR_GUSTAV_OUR_IMMORTAL_LORD);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.GLORY_TO_ADEN_THE_KINGDOM_OF_THE_LION_GLORY_TO_SIR_GUSTAV_OUR_IMMORTAL_LORD);
|
||||||
}
|
}
|
||||||
else if (npc.getId() == DIETRICH)
|
else if (npc.getId() == DIETRICH)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.SOLDIERS_OF_GUSTAV_GO_FORTH_AND_DESTROY_THE_INVADERS);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.SOLDIERS_OF_GUSTAV_GO_FORTH_AND_DESTROY_THE_INVADERS);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ public final class DevastatedCastle extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
if ((npc.getCurrentHp() < GUSTAV_TRIGGER_HP) && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST))
|
if ((npc.getCurrentHp() < GUSTAV_TRIGGER_HP) && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THIS_IS_UNBELIEVABLE_HAVE_I_REALLY_BEEN_DEFEATED_I_SHALL_RETURN_AND_TAKE_YOUR_HEAD);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_IS_UNBELIEVABLE_HAVE_I_REALLY_BEEN_DEFEATED_I_SHALL_RETURN_AND_TAKE_YOUR_HEAD);
|
||||||
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, SkillData.getInstance().getSkill(4235, 1), npc);
|
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_CAST, SkillData.getInstance().getSkill(4235, 1), npc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,15 +61,15 @@ public final class FortressOfTheDead extends ClanHallSiegeEngine
|
|||||||
{
|
{
|
||||||
if (npc.getId() == LIDIA)
|
if (npc.getId() == LIDIA)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.HMM_THOSE_WHO_ARE_NOT_OF_THE_BLOODLINE_ARE_COMING_THIS_WAY_TO_TAKE_OVER_THE_CASTLE_HUMPH_THE_BITTER_GRUDGES_OF_THE_DEAD_YOU_MUST_NOT_MAKE_LIGHT_OF_THEIR_POWER);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.HMM_THOSE_WHO_ARE_NOT_OF_THE_BLOODLINE_ARE_COMING_THIS_WAY_TO_TAKE_OVER_THE_CASTLE_HUMPH_THE_BITTER_GRUDGES_OF_THE_DEAD_YOU_MUST_NOT_MAKE_LIGHT_OF_THEIR_POWER);
|
||||||
}
|
}
|
||||||
else if (npc.getId() == ALFRED)
|
else if (npc.getId() == ALFRED)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.HEH_HEH_I_SEE_THAT_THE_FEAST_HAS_BEGUN_BE_WARY_THE_CURSE_OF_THE_HELLMANN_FAMILY_HAS_POISONED_THIS_LAND);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.HEH_HEH_I_SEE_THAT_THE_FEAST_HAS_BEGUN_BE_WARY_THE_CURSE_OF_THE_HELLMANN_FAMILY_HAS_POISONED_THIS_LAND);
|
||||||
}
|
}
|
||||||
else if (npc.getId() == GISELLE)
|
else if (npc.getId() == GISELLE)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.ARISE_MY_FAITHFUL_SERVANTS_YOU_MY_PEOPLE_WHO_HAVE_INHERITED_THE_BLOOD_IT_IS_THE_CALLING_OF_MY_DAUGHTER_THE_FEAST_OF_BLOOD_WILL_NOW_BEGIN);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.ARISE_MY_FAITHFUL_SERVANTS_YOU_MY_PEOPLE_WHO_HAVE_INHERITED_THE_BLOOD_IT_IS_THE_CALLING_OF_MY_DAUGHTER_THE_FEAST_OF_BLOOD_WILL_NOW_BEGIN);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -116,11 +116,11 @@ public final class FortressOfTheDead extends ClanHallSiegeEngine
|
|||||||
|
|
||||||
if ((npcId == ALFRED) || (npcId == GISELLE))
|
if ((npcId == ALFRED) || (npcId == GISELLE))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.AARGH_IF_I_DIE_THEN_THE_MAGIC_FORCE_FIELD_OF_BLOOD_WILL);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.AARGH_IF_I_DIE_THEN_THE_MAGIC_FORCE_FIELD_OF_BLOOD_WILL);
|
||||||
}
|
}
|
||||||
if (npcId == LIDIA)
|
if (npcId == LIDIA)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.GRARR_FOR_THE_NEXT_2_MINUTES_OR_SO_THE_GAME_ARENA_ARE_WILL_BE_CLEANED_THROW_ANY_ITEMS_YOU_DON_T_NEED_TO_THE_FLOOR_NOW);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.GRARR_FOR_THE_NEXT_2_MINUTES_OR_SO_THE_GAME_ARENA_ARE_WILL_BE_CLEANED_THROW_ANY_ITEMS_YOU_DON_T_NEED_TO_THE_FLOOR_NOW);
|
||||||
_missionAccomplished = true;
|
_missionAccomplished = true;
|
||||||
synchronized (this)
|
synchronized (this)
|
||||||
{
|
{
|
||||||
|
@@ -63,13 +63,13 @@ public class Lindvior extends AbstractNpcAI
|
|||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
case "tomaris_shout1":
|
case "tomaris_shout1":
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.HUH_THE_SKY_LOOKS_FUNNY_WHAT_S_THAT);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.HUH_THE_SKY_LOOKS_FUNNY_WHAT_S_THAT);
|
||||||
break;
|
break;
|
||||||
case "artius_shout":
|
case "artius_shout":
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.A_POWERFUL_SUBORDINATE_IS_BEING_HELD_BY_THE_BARRIER_ORB_THIS_REACTION_MEANS);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.A_POWERFUL_SUBORDINATE_IS_BEING_HELD_BY_THE_BARRIER_ORB_THIS_REACTION_MEANS);
|
||||||
break;
|
break;
|
||||||
case "tomaris_shout2":
|
case "tomaris_shout2":
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.BE_CAREFUL_SOMETHING_S_COMING);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.BE_CAREFUL_SOMETHING_S_COMING);
|
||||||
break;
|
break;
|
||||||
case "lindvior_scene":
|
case "lindvior_scene":
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
|
@@ -66,7 +66,7 @@ public final class Seyo extends AbstractNpcAI
|
|||||||
if (npc.isScriptValue(1))
|
if (npc.isScriptValue(1))
|
||||||
{
|
{
|
||||||
npc.setScriptValue(0);
|
npc.setScriptValue(0);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, TEXT[getRandom(TEXT.length)]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, TEXT[getRandom(TEXT.length)]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -87,11 +87,11 @@ public final class Seyo extends AbstractNpcAI
|
|||||||
if (getRandom(100) == 0)
|
if (getRandom(100) == 0)
|
||||||
{
|
{
|
||||||
giveItems(player, STONE_FRAGMENT, 100);
|
giveItems(player, STONE_FRAGMENT, 100);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AMAZING_S1_TOOK_100_OF_THESE_SOUL_STONE_FRAGMENTS_WHAT_A_COMPLETE_SWINDLER, player.getName());
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AMAZING_S1_TOOK_100_OF_THESE_SOUL_STONE_FRAGMENTS_WHAT_A_COMPLETE_SWINDLER, player.getName());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HMM_HEY_DID_YOU_GIVE_S1_SOMETHING_BUT_IT_WAS_JUST_1_HAHA, player.getName());
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_HEY_DID_YOU_GIVE_S1_SOMETHING_BUT_IT_WAS_JUST_1_HAHA, player.getName());
|
||||||
}
|
}
|
||||||
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
|
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
|
||||||
}
|
}
|
||||||
@@ -114,18 +114,18 @@ public final class Seyo extends AbstractNpcAI
|
|||||||
final int chance = getRandom(100);
|
final int chance = getRandom(100);
|
||||||
if (chance < 20)
|
if (chance < 20)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AHEM_S1_HAS_NO_LUCK_AT_ALL_TRY_PRAYING, player.getName());
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AHEM_S1_HAS_NO_LUCK_AT_ALL_TRY_PRAYING, player.getName());
|
||||||
}
|
}
|
||||||
else if (chance < 80)
|
else if (chance < 80)
|
||||||
{
|
{
|
||||||
giveItems(player, STONE_FRAGMENT, 1);
|
giveItems(player, STONE_FRAGMENT, 1);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IT_S_BETTER_THAN_LOSING_IT_ALL_RIGHT_OR_DOES_THIS_FEEL_WORSE);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_BETTER_THAN_LOSING_IT_ALL_RIGHT_OR_DOES_THIS_FEEL_WORSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final int itemCount = getRandom(10, 16);
|
final int itemCount = getRandom(10, 16);
|
||||||
giveItems(player, STONE_FRAGMENT, itemCount);
|
giveItems(player, STONE_FRAGMENT, itemCount);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.S1_PULLED_ONE_WITH_S2_DIGITS_LUCKY_NOT_BAD, player.getName(), String.valueOf(itemCount));
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.S1_PULLED_ONE_WITH_S2_DIGITS_LUCKY_NOT_BAD, player.getName(), String.valueOf(itemCount));
|
||||||
}
|
}
|
||||||
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
|
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
|
||||||
}
|
}
|
||||||
@@ -149,17 +149,17 @@ public final class Seyo extends AbstractNpcAI
|
|||||||
if (chance == 0)
|
if (chance == 0)
|
||||||
{
|
{
|
||||||
giveItems(player, STONE_FRAGMENT, 10000);
|
giveItems(player, STONE_FRAGMENT, 10000);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AH_IT_S_OVER_WHAT_KIND_OF_GUY_IS_THAT_DAMN_FINE_YOU_S1_TAKE_IT_AND_GET_OUTTA_HERE, player.getName());
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AH_IT_S_OVER_WHAT_KIND_OF_GUY_IS_THAT_DAMN_FINE_YOU_S1_TAKE_IT_AND_GET_OUTTA_HERE, player.getName());
|
||||||
}
|
}
|
||||||
else if (chance < 10)
|
else if (chance < 10)
|
||||||
{
|
{
|
||||||
giveItems(player, STONE_FRAGMENT, 1);
|
giveItems(player, STONE_FRAGMENT, 1);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_DON_T_FEEL_BAD_RIGHT_ARE_YOU_SAD_BUT_DON_T_CRY);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_DON_T_FEEL_BAD_RIGHT_ARE_YOU_SAD_BUT_DON_T_CRY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
giveItems(player, STONE_FRAGMENT, getRandom(1, 100));
|
giveItems(player, STONE_FRAGMENT, getRandom(1, 100));
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.A_BIG_PIECE_IS_MADE_UP_OF_LITTLE_PIECES_SO_HERE_S_A_LITTLE_PIECE);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.A_BIG_PIECE_IS_MADE_UP_OF_LITTLE_PIECES_SO_HERE_S_A_LITTLE_PIECE);
|
||||||
}
|
}
|
||||||
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
|
startQuestTimer("TRICKERY_TIMER", 5000, npc, null);
|
||||||
}
|
}
|
||||||
|
@@ -76,7 +76,7 @@ public final class Amaskari extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (event.equalsIgnoreCase("stop_toggle"))
|
if (event.equalsIgnoreCase("stop_toggle"))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[2]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[2]);
|
||||||
((L2MonsterInstance) npc).clearAggroList();
|
((L2MonsterInstance) npc).clearAggroList();
|
||||||
((L2MonsterInstance) npc).getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
((L2MonsterInstance) npc).getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
|
||||||
npc.setIsInvul(false);
|
npc.setIsInvul(false);
|
||||||
@@ -86,11 +86,11 @@ public final class Amaskari extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (getRandom(100) > 20)
|
if (getRandom(100) > 20)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[2]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[2]);
|
||||||
}
|
}
|
||||||
else if (getRandom(100) > 40)
|
else if (getRandom(100) > 40)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[3]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[3]);
|
||||||
}
|
}
|
||||||
startQuestTimer("onspawn_msg", (getRandom(8) + 1) * 30000, npc, null);
|
startQuestTimer("onspawn_msg", (getRandom(8) + 1) * 30000, npc, null);
|
||||||
}
|
}
|
||||||
@@ -102,12 +102,12 @@ public final class Amaskari extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((npc.getId() == AMASKARI) && (getRandom(1000) < 25))
|
if ((npc.getId() == AMASKARI) && (getRandom(1000) < 25))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[0]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[0]);
|
||||||
for (L2MonsterInstance minion : ((L2MonsterInstance) npc).getMinionList().getSpawnedMinions())
|
for (L2MonsterInstance minion : ((L2MonsterInstance) npc).getMinionList().getSpawnedMinions())
|
||||||
{
|
{
|
||||||
if ((minion != null) && !minion.isDead() && (getRandom(10) == 0))
|
if ((minion != null) && !minion.isDead() && (getRandom(10) == 0))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(minion, ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[0]);
|
minion.broadcastSay(ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[0]);
|
||||||
minion.setCurrentHp(minion.getCurrentHp() - (minion.getCurrentHp() / 5));
|
minion.setCurrentHp(minion.getCurrentHp() - (minion.getCurrentHp() / 5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public final class Amaskari extends AbstractNpcAI
|
|||||||
final L2MonsterInstance master = ((L2MonsterInstance) npc).getLeader();
|
final L2MonsterInstance master = ((L2MonsterInstance) npc).getLeader();
|
||||||
if ((master != null) && !master.isDead())
|
if ((master != null) && !master.isDead())
|
||||||
{
|
{
|
||||||
broadcastNpcSay(master, ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[1]);
|
master.broadcastSay(ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[1]);
|
||||||
final BuffInfo info = master.getEffectList().getBuffInfoBySkillId(BUFF_ID);
|
final BuffInfo info = master.getEffectList().getBuffInfoBySkillId(BUFF_ID);
|
||||||
if ((info != null) && (info.getSkill().getAbnormalLvl() == 3) && master.isInvul())
|
if ((info != null) && (info.getSkill().getAbnormalLvl() == 3) && master.isInvul())
|
||||||
{
|
{
|
||||||
@@ -143,7 +143,7 @@ public final class Amaskari extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
broadcastNpcSay(master, ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[3]);
|
master.broadcastSay(ChatType.NPC_GENERAL, AMASKARI_NPCSTRING_ID[3]);
|
||||||
// master.doCast(INVINCIBILITY.getSkill())
|
// master.doCast(INVINCIBILITY.getSkill())
|
||||||
master.setIsInvul(true);
|
master.setIsInvul(true);
|
||||||
startQuestTimer("stop_toggle", 10000, master, null);
|
startQuestTimer("stop_toggle", 10000, master, null);
|
||||||
@@ -159,7 +159,7 @@ public final class Amaskari extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (getRandom(1000) > 300)
|
if (getRandom(1000) > 300)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(minion, ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[1]);
|
minion.broadcastSay(ChatType.NPC_GENERAL, MINIONS_NPCSTRING_ID[1]);
|
||||||
}
|
}
|
||||||
HellboundEngine.getInstance().updateTrust(30, true);
|
HellboundEngine.getInstance().updateTrust(30, true);
|
||||||
minion.deleteMe();
|
minion.deleteMe();
|
||||||
|
@@ -159,7 +159,7 @@ public final class Keltas extends AbstractNpcAI
|
|||||||
final L2Npc keltas = _spawnedKeltas;
|
final L2Npc keltas = _spawnedKeltas;
|
||||||
if ((keltas != null) && !keltas.isDead())
|
if ((keltas != null) && !keltas.isDead())
|
||||||
{
|
{
|
||||||
broadcastNpcSay(keltas, ChatType.NPC_SHOUT, NpcStringId.THAT_IS_IT_FOR_TODAY_LET_S_RETREAT_EVERYONE_PULL_BACK);
|
keltas.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THAT_IS_IT_FOR_TODAY_LET_S_RETREAT_EVERYONE_PULL_BACK);
|
||||||
keltas.deleteMe();
|
keltas.deleteMe();
|
||||||
keltas.getSpawn().decreaseCount(keltas);
|
keltas.getSpawn().decreaseCount(keltas);
|
||||||
despawnMinions();
|
despawnMinions();
|
||||||
@@ -180,7 +180,7 @@ public final class Keltas extends AbstractNpcAI
|
|||||||
public final String onSpawn(L2Npc npc)
|
public final String onSpawn(L2Npc npc)
|
||||||
{
|
{
|
||||||
_spawnedKeltas = (L2MonsterInstance) npc;
|
_spawnedKeltas = (L2MonsterInstance) npc;
|
||||||
broadcastNpcSay(_spawnedKeltas, ChatType.NPC_SHOUT, NpcStringId.GUYS_SHOW_THEM_OUR_POWER);
|
_spawnedKeltas.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.GUYS_SHOW_THEM_OUR_POWER);
|
||||||
spawnMinions();
|
spawnMinions();
|
||||||
startQuestTimer("despawn", 1800000, null, null);
|
startQuestTimer("despawn", 1800000, null, null);
|
||||||
return super.onSpawn(npc);
|
return super.onSpawn(npc);
|
||||||
|
@@ -108,7 +108,7 @@ public final class Natives extends AbstractNpcAI
|
|||||||
if (getQuestItemsCount(player, MARK_OF_BETRAYAL) >= 10)
|
if (getQuestItemsCount(player, MARK_OF_BETRAYAL) >= 10)
|
||||||
{
|
{
|
||||||
takeItems(player, MARK_OF_BETRAYAL, 10);
|
takeItems(player, MARK_OF_BETRAYAL, 10);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.ALRIGHT_NOW_LEODAS_IS_YOURS);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ALRIGHT_NOW_LEODAS_IS_YOURS);
|
||||||
HellboundEngine.getInstance().updateTrust(-50, true);
|
HellboundEngine.getInstance().updateTrust(-50, true);
|
||||||
|
|
||||||
for (int doorId : DOORS)
|
for (int doorId : DOORS)
|
||||||
@@ -146,7 +146,7 @@ public final class Natives extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if ((npc.getId() == NATIVE) && event.equalsIgnoreCase("hungry_death"))
|
else if ((npc.getId() == NATIVE) && event.equalsIgnoreCase("hungry_death"))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HUN_HUNGRY);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HUN_HUNGRY);
|
||||||
npc.doDie(null);
|
npc.doDie(null);
|
||||||
}
|
}
|
||||||
else if (npc.getId() == INCASTLE)
|
else if (npc.getId() == INCASTLE)
|
||||||
|
@@ -101,7 +101,7 @@ public final class Quarry extends AbstractNpcAI
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HUN_HUNGRY);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HUN_HUNGRY);
|
||||||
npc.doDie(npc);
|
npc.doDie(npc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ public final class Quarry extends AbstractNpcAI
|
|||||||
startQuestTimer("DECAY", 1000, npc, null);
|
startQuestTimer("DECAY", 1000, npc, null);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THANK_YOU_FOR_THE_RESCUE_IT_S_A_SMALL_GIFT);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THANK_YOU_FOR_THE_RESCUE_IT_S_A_SMALL_GIFT);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@@ -77,7 +77,7 @@ public final class Ranku extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((minion != null) && !minion.isDead() && !MY_TRACKING_SET.contains(minion.getObjectId()))
|
if ((minion != null) && !minion.isDead() && !MY_TRACKING_SET.contains(minion.getObjectId()))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(minion, ChatType.NPC_GENERAL, NpcStringId.DON_T_KILL_ME_PLEASE_SOMETHING_S_STRANGLING_ME);
|
minion.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DON_T_KILL_ME_PLEASE_SOMETHING_S_STRANGLING_ME);
|
||||||
startQuestTimer("checkup", 1000, npc, null);
|
startQuestTimer("checkup", 1000, npc, null);
|
||||||
MY_TRACKING_SET.add(minion.getObjectId());
|
MY_TRACKING_SET.add(minion.getObjectId());
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,7 @@ public final class Slaves extends AbstractNpcAI
|
|||||||
slave.clearAggroList();
|
slave.clearAggroList();
|
||||||
slave.abortAttack();
|
slave.abortAttack();
|
||||||
slave.abortCast();
|
slave.abortCast();
|
||||||
broadcastNpcSay(slave, ChatType.NPC_GENERAL, NpcStringId.THANK_YOU_FOR_SAVING_ME_FROM_THE_CLUTCHES_OF_EVIL);
|
slave.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THANK_YOU_FOR_SAVING_ME_FROM_THE_CLUTCHES_OF_EVIL);
|
||||||
|
|
||||||
if ((HellboundEngine.getInstance().getLevel() >= 1) && (HellboundEngine.getInstance().getLevel() <= 2))
|
if ((HellboundEngine.getInstance().getLevel() >= 1) && (HellboundEngine.getInstance().getLevel() <= 2))
|
||||||
{
|
{
|
||||||
|
@@ -139,7 +139,7 @@ public final class AnomicFoundry extends AbstractNpcAI
|
|||||||
int atkIndex = _atkIndex.containsKey(npc.getObjectId()) ? _atkIndex.get(npc.getObjectId()) : 0;
|
int atkIndex = _atkIndex.containsKey(npc.getObjectId()) ? _atkIndex.get(npc.getObjectId()) : 0;
|
||||||
if (atkIndex == 0)
|
if (atkIndex == 0)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.ENEMY_INVASION_HURRY_UP);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ENEMY_INVASION_HURRY_UP);
|
||||||
cancelQuestTimer("return_laborer", npc, null);
|
cancelQuestTimer("return_laborer", npc, null);
|
||||||
startQuestTimer("return_laborer", 60000, npc, null);
|
startQuestTimer("return_laborer", 60000, npc, null);
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ public final class AnomicFoundry extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (getRandom(10000) < 8000)
|
if (getRandom(10000) < 8000)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.PROCESS_SHOULDN_T_BE_DELAYED_BECAUSE_OF_ME);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.PROCESS_SHOULDN_T_BE_DELAYED_BECAUSE_OF_ME);
|
||||||
if (respawnTime < respawnMax)
|
if (respawnTime < respawnMax)
|
||||||
{
|
{
|
||||||
respawnTime += 10000;
|
respawnTime += 10000;
|
||||||
|
@@ -586,7 +586,7 @@ public final class TowerOfNaia extends AbstractNpcAI
|
|||||||
MinionList.spawnMinion(_lock, 18493);
|
MinionList.spawnMinion(_lock, 18493);
|
||||||
MinionList.spawnMinion(_lock, 18493);
|
MinionList.spawnMinion(_lock, 18493);
|
||||||
}
|
}
|
||||||
broadcastNpcSay(_controller, ChatType.NPC_GENERAL, NpcStringId.EMERGENCY_EMERGENCY_THE_OUTER_WALL_IS_WEAKENING_RAPIDLY);
|
_controller.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EMERGENCY_EMERGENCY_THE_OUTER_WALL_IS_WEAKENING_RAPIDLY);
|
||||||
_counter -= 10;
|
_counter -= 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -690,7 +690,7 @@ public final class TowerOfNaia extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((spore != null) && !spore.isDead() && (spore.getId() == npcId))
|
if ((spore != null) && !spore.isDead() && (spore.getId() == npcId))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(spore, ChatType.NPC_GENERAL, SPORES_NPCSTRING_ID[getRandom(4)], el);
|
spore.broadcastSay(ChatType.NPC_GENERAL, SPORES_NPCSTRING_ID[getRandom(4)], el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -570,7 +570,7 @@ public final class TullyWorkshop extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if (postMortemSpawn.indexOf(npc) == 11)
|
if (postMortemSpawn.indexOf(npc) == 11)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HA_HA_YOU_WERE_SO_AFRAID_OF_DEATH_LET_ME_SEE_IF_YOU_FIND_ME_IN_TIME_MAYBE_YOU_CAN_FIND_A_WAY);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HA_HA_YOU_WERE_SO_AFRAID_OF_DEATH_LET_ME_SEE_IF_YOU_FIND_ME_IN_TIME_MAYBE_YOU_CAN_FIND_A_WAY);
|
||||||
npc.deleteMe();
|
npc.deleteMe();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -744,7 +744,7 @@ public final class TullyWorkshop extends AbstractNpcAI
|
|||||||
|
|
||||||
if (event.equalsIgnoreCase("repair_device"))
|
if (event.equalsIgnoreCase("repair_device"))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.DE_ACTIVATE_THE_ALARM);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.DE_ACTIVATE_THE_ALARM);
|
||||||
brokenContraptions.remove(npc.getObjectId());
|
brokenContraptions.remove(npc.getObjectId());
|
||||||
}
|
}
|
||||||
else if (event.equalsIgnoreCase("despawn_servant") && !npc.isDead())
|
else if (event.equalsIgnoreCase("despawn_servant") && !npc.isDead())
|
||||||
@@ -1221,7 +1221,7 @@ public final class TullyWorkshop extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((_npc != null) && (_npc.getId() == INGENIOUS_CONTRAPTION))
|
if ((_npc != null) && (_npc.getId() == INGENIOUS_CONTRAPTION))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(_npc, ChatType.NPC_SHOUT, NpcStringId.S1_MINUTE_S_ARE_REMAINING, Integer.toString((countdownTime / 60000)));
|
_npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.S1_MINUTE_S_ARE_REMAINING, Integer.toString((countdownTime / 60000)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1255,35 +1255,35 @@ public final class TullyWorkshop extends AbstractNpcAI
|
|||||||
{
|
{
|
||||||
if ((_npc != null) && (_npc.getId() == INGENIOUS_CONTRAPTION))
|
if ((_npc != null) && (_npc.getId() == INGENIOUS_CONTRAPTION))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(_npc, ChatType.NPC_SHOUT, NpcStringId.S1_SECOND_S_REMAINING, Integer.toString((countdownTime / 1000)));
|
_npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.S1_SECOND_S_REMAINING, Integer.toString((countdownTime / 1000)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 60000, 10000);
|
}, 60000, 10000);
|
||||||
broadcastNpcSay(postMortemSpawn.get(0), ChatType.NPC_SHOUT, NpcStringId.DETONATOR_INITIALIZATION_TIME_SET_FOR_S1_MINUTE_S_FROM_NOW, Integer.toString((countdownTime / 60000)));
|
postMortemSpawn.get(0).broadcastSay(ChatType.NPC_SHOUT, NpcStringId.DETONATOR_INITIALIZATION_TIME_SET_FOR_S1_MINUTE_S_FROM_NOW, Integer.toString((countdownTime / 60000)));
|
||||||
}
|
}
|
||||||
else if ((npcId == TIMETWISTER_GOLEM) && (_countdown != null))
|
else if ((npcId == TIMETWISTER_GOLEM) && (_countdown != null))
|
||||||
{
|
{
|
||||||
if (getRandom(1000) >= 700)
|
if (getRandom(1000) >= 700)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.A_FATAL_ERROR_HAS_OCCURRED);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.A_FATAL_ERROR_HAS_OCCURRED);
|
||||||
if (countdownTime > 180000)
|
if (countdownTime > 180000)
|
||||||
{
|
{
|
||||||
countdownTime = Math.max(countdownTime - 180000, 60000);
|
countdownTime = Math.max(countdownTime - 180000, 60000);
|
||||||
if ((postMortemSpawn != null) && (postMortemSpawn.size() > 0) && (postMortemSpawn.get(0) != null) && (postMortemSpawn.get(0).getId() == INGENIOUS_CONTRAPTION))
|
if ((postMortemSpawn != null) && (postMortemSpawn.size() > 0) && (postMortemSpawn.get(0) != null) && (postMortemSpawn.get(0).getId() == INGENIOUS_CONTRAPTION))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(postMortemSpawn.get(0), ChatType.NPC_SHOUT, NpcStringId.ZZZZ_CITY_INTERFERENCE_ERROR_FORWARD_EFFECT_CREATED);
|
postMortemSpawn.get(0).broadcastSay(ChatType.NPC_SHOUT, NpcStringId.ZZZZ_CITY_INTERFERENCE_ERROR_FORWARD_EFFECT_CREATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.TIME_RIFT_DEVICE_ACTIVATION_SUCCESSFUL);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TIME_RIFT_DEVICE_ACTIVATION_SUCCESSFUL);
|
||||||
if ((countdownTime > 0) && (countdownTime <= 420000))
|
if ((countdownTime > 0) && (countdownTime <= 420000))
|
||||||
{
|
{
|
||||||
countdownTime += 180000;
|
countdownTime += 180000;
|
||||||
if ((postMortemSpawn != null) && (postMortemSpawn.size() > 0) && (postMortemSpawn.get(0) != null) && (postMortemSpawn.get(0).getId() == INGENIOUS_CONTRAPTION))
|
if ((postMortemSpawn != null) && (postMortemSpawn.size() > 0) && (postMortemSpawn.get(0) != null) && (postMortemSpawn.get(0).getId() == INGENIOUS_CONTRAPTION))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(postMortemSpawn.get(0), ChatType.NPC_SHOUT, NpcStringId.ZZZZ_CITY_INTERFERENCE_ERROR_RECURRENCE_EFFECT_CREATED);
|
postMortemSpawn.get(0).broadcastSay(ChatType.NPC_SHOUT, NpcStringId.ZZZZ_CITY_INTERFERENCE_ERROR_RECURRENCE_EFFECT_CREATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1365,11 +1365,11 @@ public final class TullyWorkshop extends AbstractNpcAI
|
|||||||
|
|
||||||
if (((npc.getId() - 22404) == 3) || ((npc.getId() - 22404) == 6))
|
if (((npc.getId() - 22404) == 3) || ((npc.getId() - 22404) == 6))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.I_FAILED_PLEASE_FORGIVE_ME_DARION);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.I_FAILED_PLEASE_FORGIVE_ME_DARION);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.S1_I_LL_BE_BACK_DON_T_GET_COMFORTABLE, killer.getName());
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.S1_I_LL_BE_BACK_DON_T_GET_COMFORTABLE, killer.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (((npcId == TEMENIR) || (npcId == DRAXIUS) || (npcId == KIRETCENAH)) && spawnedFollowers.contains(npc))
|
else if (((npcId == TEMENIR) || (npcId == DRAXIUS) || (npcId == KIRETCENAH)) && spawnedFollowers.contains(npc))
|
||||||
@@ -1444,7 +1444,7 @@ public final class TullyWorkshop extends AbstractNpcAI
|
|||||||
}
|
}
|
||||||
else if ((npcId >= SERVANT_FIRST) && (npcId <= SERVANT_LAST) && (skillId == 5392))
|
else if ((npcId >= SERVANT_FIRST) && (npcId <= SERVANT_LAST) && (skillId == 5392))
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.S1_THANK_YOU_FOR_GIVING_ME_YOUR_LIFE, player.getName());
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.S1_THANK_YOU_FOR_GIVING_ME_YOUR_LIFE, player.getName());
|
||||||
final int dmg = (int) (player.getCurrentHp() / (npc.getId() - 22404));
|
final int dmg = (int) (player.getCurrentHp() / (npc.getId() - 22404));
|
||||||
player.reduceCurrentHp(dmg, null, null);
|
player.reduceCurrentHp(dmg, null, null);
|
||||||
npc.setCurrentHp((npc.getCurrentHp() + 10) - (npc.getId() - 22404));
|
npc.setCurrentHp((npc.getCurrentHp() + 10) - (npc.getId() - 22404));
|
||||||
|
@@ -198,8 +198,8 @@ public final class UrbanArea extends AbstractInstance
|
|||||||
{
|
{
|
||||||
if (!npc.isAffectedBySkill(STONE.getSkillId()) || world.isAmaskariDead)
|
if (!npc.isAffectedBySkill(STONE.getSkillId()) || world.isAmaskariDead)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[0]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[0]);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[2]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[2]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -209,8 +209,8 @@ public final class UrbanArea extends AbstractInstance
|
|||||||
npc.stopSkillEffects(false, STONE.getSkillId());
|
npc.stopSkillEffects(false, STONE.getSkillId());
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[0]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[0]);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[1]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NATIVES_NPCSTRING_ID[1]);
|
||||||
HellboundEngine.getInstance().updateTrust(10, true);
|
HellboundEngine.getInstance().updateTrust(10, true);
|
||||||
npc.scheduleDespawn(3000);
|
npc.scheduleDespawn(3000);
|
||||||
// Try to call Amaskari
|
// Try to call Amaskari
|
||||||
@@ -258,7 +258,7 @@ public final class UrbanArea extends AbstractInstance
|
|||||||
|
|
||||||
if (!npc.isBusy())
|
if (!npc.isBusy())
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPCSTRING_ID[0]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NPCSTRING_ID[0]);
|
||||||
npc.setBusy(true);
|
npc.setBusy(true);
|
||||||
|
|
||||||
if ((world.spawnedAmaskari != null) && !world.spawnedAmaskari.isDead() && (getRandom(1000) < 25) && Util.checkIfInRange(1000, npc, world.spawnedAmaskari, false))
|
if ((world.spawnedAmaskari != null) && !world.spawnedAmaskari.isDead() && (getRandom(1000) < 25) && Util.checkIfInRange(1000, npc, world.spawnedAmaskari, false))
|
||||||
@@ -302,7 +302,7 @@ public final class UrbanArea extends AbstractInstance
|
|||||||
}
|
}
|
||||||
if (msgId >= 0)
|
if (msgId >= 0)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPCSTRING_ID[msgId], range);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NPCSTRING_ID[msgId], range);
|
||||||
}
|
}
|
||||||
npc.setBusy(true);
|
npc.setBusy(true);
|
||||||
npc.setBusyMessage("atk");
|
npc.setBusyMessage("atk");
|
||||||
|
@@ -102,7 +102,7 @@ public final class IceQueensCastle extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "TIMER_BLIZZARD":
|
case "TIMER_BLIZZARD":
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_CAN_NO_LONGER_STAND_BY);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_NO_LONGER_STAND_BY);
|
||||||
npc.stopMove(null);
|
npc.stopMove(null);
|
||||||
npc.setTarget(player);
|
npc.setTarget(player);
|
||||||
npc.doCast(ETHERNAL_BLIZZARD.getSkill());
|
npc.doCast(ETHERNAL_BLIZZARD.getSkill());
|
||||||
@@ -152,7 +152,7 @@ public final class IceQueensCastle extends AbstractInstance
|
|||||||
startQuestTimer("ATTACK_KNIGHT", 5000, npc, null);
|
startQuestTimer("ATTACK_KNIGHT", 5000, npc, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.S1_MAY_THE_PROTECTION_OF_THE_GODS_BE_UPON_YOU, creature.getName());
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.S1_MAY_THE_PROTECTION_OF_THE_GODS_BE_UPON_YOU, creature.getName());
|
||||||
}
|
}
|
||||||
return super.onSeeCreature(npc, creature, isSummon);
|
return super.onSeeCreature(npc, creature, isSummon);
|
||||||
}
|
}
|
||||||
|
@@ -688,22 +688,22 @@ public final class IceQueensCastleNormalBattle extends AbstractInstance
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.SHOUT, NpcStringId.ARCHER_GIVE_YOUR_BREATH_FOR_THE_INTRUDER);
|
npc.broadcastSay(ChatType.SHOUT, NpcStringId.ARCHER_GIVE_YOUR_BREATH_FOR_THE_INTRUDER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.SHOUT, NpcStringId.MY_KNIGHTS_SHOW_YOUR_LOYALTY);
|
npc.broadcastSay(ChatType.SHOUT, NpcStringId.MY_KNIGHTS_SHOW_YOUR_LOYALTY);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.SHOUT, NpcStringId.I_CAN_TAKE_IT_NO_LONGER);
|
npc.broadcastSay(ChatType.SHOUT, NpcStringId.I_CAN_TAKE_IT_NO_LONGER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.SHOUT, NpcStringId.ARCHER_HEED_MY_CALL);
|
npc.broadcastSay(ChatType.SHOUT, NpcStringId.ARCHER_HEED_MY_CALL);
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getInstanceId());
|
final L2Attackable breath = (L2Attackable) addSpawn(BREATH, npc.getLocation(), true, 0, false, world.getInstanceId());
|
||||||
|
@@ -96,7 +96,7 @@ public final class LibraryOfSages extends AbstractInstance
|
|||||||
{
|
{
|
||||||
npc.setIsRunning(true);
|
npc.setIsRunning(true);
|
||||||
npc.getAI().startFollow(player);
|
npc.getAI().startFollow(player);
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
|
||||||
startQuestTimer("FOLLOW", 10000, npc, player);
|
startQuestTimer("FOLLOW", 10000, npc, player);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -118,7 +118,7 @@ public final class MithrilMine extends AbstractInstance
|
|||||||
kegor.setWalking();
|
kegor.setWalking();
|
||||||
kegor.setTarget(player);
|
kegor.setTarget(player);
|
||||||
kegor.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
kegor.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, player);
|
||||||
broadcastNpcSay(kegor, ChatType.NPC_GENERAL, NpcStringId.I_CAN_FINALLY_TAKE_A_BREATHER_BY_THE_WAY_WHO_ARE_YOU_HMM_I_THINK_I_KNOW_WHO_SENT_YOU);
|
kegor.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_CAN_FINALLY_TAKE_A_BREATHER_BY_THE_WAY_WHO_ARE_YOU_HMM_I_THINK_I_KNOW_WHO_SENT_YOU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(3000);
|
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(3000);
|
||||||
@@ -161,7 +161,7 @@ public final class MithrilMine extends AbstractInstance
|
|||||||
|
|
||||||
if (npc.getId() == KEGOR)
|
if (npc.getId() == KEGOR)
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HOW_COULD_I_FALL_IN_A_PLACE_LIKE_THIS);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_COULD_I_FALL_IN_A_PLACE_LIKE_THIS);
|
||||||
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(1000);
|
InstanceManager.getInstance().getInstance(world.getInstanceId()).setDuration(1000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -169,13 +169,13 @@ public final class MonasteryOfSilence1 extends AbstractInstance
|
|||||||
npc.getAI().startFollow(player);
|
npc.getAI().startFollow(player);
|
||||||
if (player.isInCombat())
|
if (player.isInCombat())
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOUR_WORK_HERE_IS_DONE_SO_RETURN_TO_THE_CENTRAL_GUARDIAN);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOUR_WORK_HERE_IS_DONE_SO_RETURN_TO_THE_CENTRAL_GUARDIAN);
|
||||||
npc.setTarget(player);
|
npc.setTarget(player);
|
||||||
npc.doCast(BUFFS[getRandom(BUFFS.length)].getSkill());
|
npc.doCast(BUFFS[getRandom(BUFFS.length)].getSkill());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
|
npc.broadcastSay(ChatType.NPC_GENERAL, ELCADIA_DIALOGS[getRandom(ELCADIA_DIALOGS.length)]);
|
||||||
}
|
}
|
||||||
startQuestTimer("FOLLOW", 10000, npc, player);
|
startQuestTimer("FOLLOW", 10000, npc, player);
|
||||||
break;
|
break;
|
||||||
|
@@ -85,7 +85,7 @@ public final class PailakaSongOfIceAndFire extends AbstractInstance
|
|||||||
}
|
}
|
||||||
case "GARGOS_LAUGH":
|
case "GARGOS_LAUGH":
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.OHH_OH_OH);
|
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.OHH_OH_OH);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "TELEPORT":
|
case "TELEPORT":
|
||||||
|
@@ -113,17 +113,17 @@ public final class SanctumOftheLordsOfDawn extends AbstractInstance
|
|||||||
{
|
{
|
||||||
case GUARDS_OF_THE_DAWN:
|
case GUARDS_OF_THE_DAWN:
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.INTRUDER_PROTECT_THE_PRIESTS_OF_DAWN);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_PROTECT_THE_PRIESTS_OF_DAWN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GUARDS_OF_THE_DAWN_2:
|
case GUARDS_OF_THE_DAWN_2:
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HOW_DARE_YOU_INTRUDE_WITH_THAT_TRANSFORMATION_GET_LOST);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HOW_DARE_YOU_INTRUDE_WITH_THAT_TRANSFORMATION_GET_LOST);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GUARDS_OF_THE_DAWN_3:
|
case GUARDS_OF_THE_DAWN_3:
|
||||||
{
|
{
|
||||||
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WHO_ARE_YOU_A_NEW_FACE_LIKE_YOU_CAN_T_APPROACH_THIS_PLACE);
|
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHO_ARE_YOU_A_NEW_FACE_LIKE_YOU_CAN_T_APPROACH_THIS_PLACE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,8 +40,6 @@ import com.l2jmobius.gameserver.model.events.EventDispatcher;
|
|||||||
import com.l2jmobius.gameserver.model.events.impl.character.npc.OnNpcMoveNodeArrived;
|
import com.l2jmobius.gameserver.model.events.impl.character.npc.OnNpcMoveNodeArrived;
|
||||||
import com.l2jmobius.gameserver.model.holders.NpcRoutesHolder;
|
import com.l2jmobius.gameserver.model.holders.NpcRoutesHolder;
|
||||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
|
|
||||||
import com.l2jmobius.gameserver.util.Broadcast;
|
|
||||||
import com.l2jmobius.util.data.xml.IXmlReader;
|
import com.l2jmobius.util.data.xml.IXmlReader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -413,11 +411,11 @@ public final class WalkingManager implements IXmlReader
|
|||||||
|
|
||||||
if (node.getNpcString() != null)
|
if (node.getNpcString() != null)
|
||||||
{
|
{
|
||||||
Broadcast.toKnownPlayers(npc, new NpcSay(npc, ChatType.NPC_GENERAL, node.getNpcString()));
|
npc.broadcastSay(ChatType.NPC_GENERAL, node.getNpcString());
|
||||||
}
|
}
|
||||||
else if (!node.getChatText().isEmpty())
|
else if (!node.getChatText().isEmpty())
|
||||||
{
|
{
|
||||||
Broadcast.toKnownPlayers(npc, new NpcSay(npc, ChatType.NPC_GENERAL, node.getChatText()));
|
npc.broadcastSay(ChatType.NPC_GENERAL, node.getChatText());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (npc.isDebug())
|
if (npc.isDebug())
|
||||||
|
@@ -36,6 +36,7 @@ import com.l2jmobius.gameserver.datatables.ItemTable;
|
|||||||
import com.l2jmobius.gameserver.datatables.NpcPersonalAIData;
|
import com.l2jmobius.gameserver.datatables.NpcPersonalAIData;
|
||||||
import com.l2jmobius.gameserver.enums.AISkillScope;
|
import com.l2jmobius.gameserver.enums.AISkillScope;
|
||||||
import com.l2jmobius.gameserver.enums.AIType;
|
import com.l2jmobius.gameserver.enums.AIType;
|
||||||
|
import com.l2jmobius.gameserver.enums.ChatType;
|
||||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||||
import com.l2jmobius.gameserver.enums.Race;
|
import com.l2jmobius.gameserver.enums.Race;
|
||||||
@@ -84,12 +85,14 @@ import com.l2jmobius.gameserver.model.olympiad.Olympiad;
|
|||||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||||
import com.l2jmobius.gameserver.model.variables.NpcVariables;
|
import com.l2jmobius.gameserver.model.variables.NpcVariables;
|
||||||
import com.l2jmobius.gameserver.model.zone.type.L2TownZone;
|
import com.l2jmobius.gameserver.model.zone.type.L2TownZone;
|
||||||
|
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.AbstractNpcInfo;
|
import com.l2jmobius.gameserver.network.serverpackets.AbstractNpcInfo;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.ExChangeNpcState;
|
import com.l2jmobius.gameserver.network.serverpackets.ExChangeNpcState;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
|
import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||||
|
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.ServerObjectInfo;
|
import com.l2jmobius.gameserver.network.serverpackets.ServerObjectInfo;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
import com.l2jmobius.gameserver.network.serverpackets.SocialAction;
|
||||||
import com.l2jmobius.gameserver.taskmanager.DecayTaskManager;
|
import com.l2jmobius.gameserver.taskmanager.DecayTaskManager;
|
||||||
@@ -1946,6 +1949,60 @@ public class L2Npc extends L2Character
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Broadcasts NpcSay packet to all known players.
|
||||||
|
* @param chatType the chat type
|
||||||
|
* @param text the text
|
||||||
|
*/
|
||||||
|
public void broadcastSay(ChatType chatType, String text)
|
||||||
|
{
|
||||||
|
Broadcast.toKnownPlayers(this, new NpcSay(this, chatType, text));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Broadcasts NpcSay packet to all known players with NPC string id.
|
||||||
|
* @param chatType the chat type
|
||||||
|
* @param npcStringId the NPC string id
|
||||||
|
* @param parameters the NPC string id parameters
|
||||||
|
*/
|
||||||
|
public void broadcastSay(ChatType chatType, NpcStringId npcStringId, String... parameters)
|
||||||
|
{
|
||||||
|
final NpcSay npcSay = new NpcSay(this, chatType, npcStringId);
|
||||||
|
if (parameters != null)
|
||||||
|
{
|
||||||
|
for (String parameter : parameters)
|
||||||
|
{
|
||||||
|
if (parameter != null)
|
||||||
|
{
|
||||||
|
npcSay.addStringParameter(parameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Broadcast.toKnownPlayers(this, npcSay);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Broadcasts NpcSay packet to all known players with custom string in specific radius.
|
||||||
|
* @param chatType the chat type
|
||||||
|
* @param text the text
|
||||||
|
* @param radius the radius
|
||||||
|
*/
|
||||||
|
public void broadcastSay(ChatType chatType, String text, int radius)
|
||||||
|
{
|
||||||
|
Broadcast.toKnownPlayersInRadius(this, new NpcSay(this, chatType, text), radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Broadcasts NpcSay packet to all known players with NPC string id in specific radius.
|
||||||
|
* @param chatType the chat type
|
||||||
|
* @param npcStringId the NPC string id
|
||||||
|
* @param radius the radius
|
||||||
|
*/
|
||||||
|
public void broadcastSay(ChatType chatType, NpcStringId npcStringId, int radius)
|
||||||
|
{
|
||||||
|
Broadcast.toKnownPlayersInRadius(this, new NpcSay(this, chatType, npcStringId), radius);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinShopDistance()
|
public int getMinShopDistance()
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,6 @@ import com.l2jmobius.gameserver.enums.ChatType;
|
|||||||
import com.l2jmobius.gameserver.model.L2Spawn;
|
import com.l2jmobius.gameserver.model.L2Spawn;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||||
import com.l2jmobius.gameserver.network.NpcStringId;
|
import com.l2jmobius.gameserver.network.NpcStringId;
|
||||||
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DS
|
* @author DS
|
||||||
@@ -78,16 +77,12 @@ public final class OlympiadAnnouncer implements Runnable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
L2Npc manager;
|
|
||||||
NpcSay packet;
|
|
||||||
for (L2Spawn spawn : _managers)
|
for (L2Spawn spawn : _managers)
|
||||||
{
|
{
|
||||||
manager = spawn.getLastSpawn();
|
final L2Npc manager = spawn.getLastSpawn();
|
||||||
if (manager != null)
|
if (manager != null)
|
||||||
{
|
{
|
||||||
packet = new NpcSay(manager.getObjectId(), ChatType.NPC_SHOUT, manager.getId(), npcString);
|
manager.broadcastSay(ChatType.NPC_SHOUT, npcString, arenaId);
|
||||||
packet.addStringParameter(arenaId);
|
|
||||||
manager.broadcastPacket(packet);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of the L2J Mobius project.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.l2jmobius.gameserver.script;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Luis Arias
|
|
||||||
*/
|
|
||||||
public class IntList
|
|
||||||
{
|
|
||||||
public static int[] parse(String range)
|
|
||||||
{
|
|
||||||
if (range.contains("-"))
|
|
||||||
{
|
|
||||||
return getIntegerRange(range.split("-"));
|
|
||||||
}
|
|
||||||
else if (range.contains(","))
|
|
||||||
{
|
|
||||||
return getIntegerList(range.split(","));
|
|
||||||
}
|
|
||||||
|
|
||||||
final int[] list =
|
|
||||||
{
|
|
||||||
getInt(range)
|
|
||||||
};
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int getInt(String number)
|
|
||||||
{
|
|
||||||
return Integer.parseInt(number);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int[] getIntegerList(String[] numbers)
|
|
||||||
{
|
|
||||||
final int[] list = new int[numbers.length];
|
|
||||||
for (int i = 0; i < list.length; i++)
|
|
||||||
{
|
|
||||||
list[i] = getInt(numbers[i]);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static int[] getIntegerRange(String[] numbers)
|
|
||||||
{
|
|
||||||
final int min = getInt(numbers[0]);
|
|
||||||
final int max = getInt(numbers[1]);
|
|
||||||
final int[] list = new int[(max - min) + 1];
|
|
||||||
for (int i = 0; i < list.length; i++)
|
|
||||||
{
|
|
||||||
list[i] = min + i;
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,130 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of the L2J Mobius project.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.l2jmobius.gameserver.script;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Enumeration;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import java.util.zip.ZipEntry;
|
|
||||||
import java.util.zip.ZipFile;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Luis Arias
|
|
||||||
*/
|
|
||||||
public class ScriptPackage
|
|
||||||
{
|
|
||||||
private static final Logger _log = Logger.getLogger(ScriptPackage.class.getName());
|
|
||||||
|
|
||||||
private final List<ScriptDocument> _scriptFiles = new ArrayList<>();
|
|
||||||
private final List<String> _otherFiles = new ArrayList<>();
|
|
||||||
private final String _name;
|
|
||||||
|
|
||||||
public ScriptPackage(ZipFile pack)
|
|
||||||
{
|
|
||||||
_name = pack.getName();
|
|
||||||
addFiles(pack);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Returns the otherFiles.
|
|
||||||
*/
|
|
||||||
public List<String> getOtherFiles()
|
|
||||||
{
|
|
||||||
return _otherFiles;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Returns the scriptFiles.
|
|
||||||
*/
|
|
||||||
public List<ScriptDocument> getScriptFiles()
|
|
||||||
{
|
|
||||||
return _scriptFiles;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param pack
|
|
||||||
*/
|
|
||||||
private void addFiles(ZipFile pack)
|
|
||||||
{
|
|
||||||
for (Enumeration<? extends ZipEntry> e = pack.entries(); e.hasMoreElements();)
|
|
||||||
{
|
|
||||||
final ZipEntry entry = e.nextElement();
|
|
||||||
if (entry.getName().endsWith(".xml"))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_scriptFiles.add(new ScriptDocument(entry.getName(), pack.getInputStream(entry)));
|
|
||||||
}
|
|
||||||
catch (IOException io)
|
|
||||||
{
|
|
||||||
_log.warning(getClass().getSimpleName() + ": " + io.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!entry.isDirectory())
|
|
||||||
{
|
|
||||||
_otherFiles.add(entry.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Returns the name.
|
|
||||||
*/
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return _name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
if (getScriptFiles().isEmpty() && getOtherFiles().isEmpty())
|
|
||||||
{
|
|
||||||
return "Empty Package.";
|
|
||||||
}
|
|
||||||
|
|
||||||
final StringBuilder out = new StringBuilder();
|
|
||||||
out.append("Package Name: ");
|
|
||||||
out.append(getName());
|
|
||||||
out.append(Config.EOL);
|
|
||||||
|
|
||||||
if (!getScriptFiles().isEmpty())
|
|
||||||
{
|
|
||||||
out.append("Xml Script Files..." + Config.EOL);
|
|
||||||
for (ScriptDocument script : getScriptFiles())
|
|
||||||
{
|
|
||||||
out.append(script.getName());
|
|
||||||
out.append(Config.EOL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getOtherFiles().isEmpty())
|
|
||||||
{
|
|
||||||
out.append("Other Files..." + Config.EOL);
|
|
||||||
for (String fileName : getOtherFiles())
|
|
||||||
{
|
|
||||||
out.append(fileName);
|
|
||||||
out.append(Config.EOL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return out.toString();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of the L2J Mobius project.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.l2jmobius.gameserver.script;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author -Nemesiss-
|
|
||||||
*/
|
|
||||||
public class ShortList
|
|
||||||
{
|
|
||||||
public static short[] parse(String range)
|
|
||||||
{
|
|
||||||
if (range.contains("-"))
|
|
||||||
{
|
|
||||||
return getShortList(range.split("-"));
|
|
||||||
}
|
|
||||||
else if (range.contains(","))
|
|
||||||
{
|
|
||||||
return getShortList(range.split(","));
|
|
||||||
}
|
|
||||||
|
|
||||||
final short[] list =
|
|
||||||
{
|
|
||||||
getShort(range)
|
|
||||||
};
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static short getShort(String number)
|
|
||||||
{
|
|
||||||
return Short.parseShort(number);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static short[] getShortList(String[] numbers)
|
|
||||||
{
|
|
||||||
final short[] list = new short[numbers.length];
|
|
||||||
for (int i = 0; i < list.length; i++)
|
|
||||||
{
|
|
||||||
list[i] = getShort(numbers[i]);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user