Partial sync L2jUnity free release Feb 20th 2015.

This commit is contained in:
MobiusDev
2016-10-28 08:58:02 +00:00
parent 4628bd3d86
commit 01a48c62cd
219 changed files with 1825 additions and 2935 deletions

View File

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

View File

@@ -51,19 +51,19 @@ public final class AdenReconstructorManager extends AbstractNpcAI
{
case "SPAM_TEXT":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_LAND_OF_ADEN_IS_IN_NEED_OF_MATERIALS_TO_REBUILD_FROM_SHILEN_S_DESTRUCTION);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_LAND_OF_ADEN_IS_IN_NEED_OF_MATERIALS_TO_REBUILD_FROM_SHILEN_S_DESTRUCTION);
startQuestTimer("SPAM_TEXT2", 1000, npc, null);
break;
}
case "SPAM_TEXT2":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.PLEASE_DONATE_ANY_UNUSED_MATERIALS_YOU_HAVE_TO_HELP_REBUILD_ADEN);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.PLEASE_DONATE_ANY_UNUSED_MATERIALS_YOU_HAVE_TO_HELP_REBUILD_ADEN);
startQuestTimer("SPAM_TEXT3", 1000, npc, null);
break;
}
case "SPAM_TEXT3":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_LL_RECEIVE_A_GIFT_FOR_ANY_APPLICABLE_DONATION);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_LL_RECEIVE_A_GIFT_FOR_ANY_APPLICABLE_DONATION);
break;
}
}

View File

@@ -28,7 +28,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2TamedBeastInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.util.Util;
import ai.AbstractNpcAI;
@@ -430,13 +429,8 @@ public final class FeedableBeasts extends AbstractNpcAI
// also, perform a rare random chat
if (getRandom(20) == 0)
{
final NpcStringId message = NpcStringId.getNpcStringId(getRandom(2024, 2029));
final NpcSay packet = new NpcSay(nextNpc, ChatType.NPC_GENERAL, message);
if (message.getParamCount() > 0) // player name, $s1
{
packet.addStringParameter(player.getName());
}
npc.broadcastPacket(packet);
NpcStringId message = NpcStringId.getNpcStringId(getRandom(2024, 2029));
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? player.getName() : null);
}
// @formatter:off
/*
@@ -546,13 +540,8 @@ public final class FeedableBeasts extends AbstractNpcAI
// rare random talk...
if (getRandom(20) == 0)
{
final NpcStringId message = TEXT[growthLevel][getRandom(TEXT[growthLevel].length)];
final NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
if (message.getParamCount() > 0) // player name, $s1
{
packet.addStringParameter(caster.getName());
}
npc.broadcastPacket(packet);
NpcStringId message = TEXT[growthLevel][getRandom(TEXT[growthLevel].length)];
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? caster.getName() : null);
}
if ((growthLevel > 0) && (FEED_INFO.get(objectId) != caster.getObjectId()))
@@ -574,13 +563,8 @@ public final class FeedableBeasts extends AbstractNpcAI
if (skillId == beast.getFoodType())
{
beast.onReceiveFood();
final NpcStringId message = TAMED_TEXT[getRandom(TAMED_TEXT.length)];
final NpcSay packet = new NpcSay(npc, ChatType.NPC_GENERAL, message);
if (message.getParamCount() > 0)
{
packet.addStringParameter(caster.getName());
}
beast.broadcastPacket(packet);
NpcStringId message = TAMED_TEXT[getRandom(TAMED_TEXT.length)];
npc.broadcastSay(ChatType.NPC_GENERAL, message, message.getParamCount() > 0 ? caster.getName() : null);
}
}
return super.onSkillSee(npc, caster, skill, targets, isSummon);

View File

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

View File

@@ -80,7 +80,7 @@ public final class LairOfAntharas extends AbstractNpcAI
{
npc.setScriptValue(1);
}
broadcastNpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.WHO_S_THERE_IF_YOU_DISTURB_THE_TEMPER_OF_THE_GREAT_LAND_DRAGON_ANTHARAS_I_WILL_NEVER_FORGIVE_YOU);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.WHO_S_THERE_IF_YOU_DISTURB_THE_TEMPER_OF_THE_GREAT_LAND_DRAGON_ANTHARAS_I_WILL_NEVER_FORGIVE_YOU);
}
return super.onAggroRangeEnter(npc, player, isSummon);
}
@@ -96,7 +96,7 @@ public final class LairOfAntharas extends AbstractNpcAI
{
final L2Npc newKnight = addSpawn(DRAGON_KNIGHT2, npc, false, 0, true);
npc.deleteMe();
broadcastNpcSay(newKnight, ChatType.NPC_SHOUT, NpcStringId.THOSE_WHO_SET_FOOT_IN_THIS_PLACE_SHALL_NOT_LEAVE_ALIVE);
newKnight.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THOSE_WHO_SET_FOOT_IN_THIS_PLACE_SHALL_NOT_LEAVE_ALIVE);
addAttackDesire(newKnight, killer);
}
break;
@@ -107,7 +107,7 @@ public final class LairOfAntharas extends AbstractNpcAI
{
final L2Npc eliteKnight = addSpawn(ELITE_DRAGON_KNIGHT, npc, false, 0, true);
npc.deleteMe();
broadcastNpcSay(eliteKnight, ChatType.NPC_SHOUT, NpcStringId.IF_YOU_WISH_TO_SEE_HELL_I_WILL_GRANT_YOU_YOUR_WISH);
eliteKnight.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.IF_YOU_WISH_TO_SEE_HELL_I_WILL_GRANT_YOU_YOUR_WISH);
addAttackDesire(eliteKnight, killer);
}
break;

View File

@@ -438,7 +438,7 @@ public final class MinionSpawnManager extends AbstractNpcAI
{
addMinion((L2MonsterInstance) npc, is.getId());
}
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]);
npc.broadcastSay(ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]);
}
return super.onAttack(npc, attacker, damage, isSummon);
}

View File

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

View File

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

View File

@@ -89,14 +89,14 @@ public final class PrisonGuards extends AbstractNpcAI
{
npc.setTarget(player);
npc.doCast(STONE.getSkill());
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IT_S_NOT_EASY_TO_OBTAIN);
}
}
else if (!player.isAffectedBySkill(TIMER) && (npc.calculateDistance(npc.getSpawn().getLocation(), false, false) < 2000))
{
npc.setTarget(player);
npc.doCast(STONE.getSkill());
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_RE_OUT_OF_YOUR_MIND_COMING_HERE);
}
return super.onAttack(npc, player, damage, isSummon);
}

View File

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

View File

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

View File

@@ -88,7 +88,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
else
{
final L2PcInstance target = obj.getActingPlayer();
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_SPAWN[getRandom(NPC_STRINGS_ON_SPAWN.length)], target.getName());
npc.broadcastSay(ChatType.NPC_GENERAL, NPC_STRINGS_ON_SPAWN[getRandom(NPC_STRINGS_ON_SPAWN.length)], target.getName());
addAttackDesire(npc, target);
startQuestTimer("DESPAWN", DESPAWN_TIME * 1000, npc, target);
@@ -109,7 +109,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
{
if (getRandom(100) < CHANCE_TO_SHOUT_ON_ATTACK)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_ATTACK[getRandom(NPC_STRINGS_ON_ATTACK.length)]);
npc.broadcastSay(ChatType.NPC_GENERAL, NPC_STRINGS_ON_ATTACK[getRandom(NPC_STRINGS_ON_ATTACK.length)]);
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@@ -117,7 +117,7 @@ public final class WarriorFishingBlock extends AbstractNpcAI
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NPC_STRINGS_ON_KILL[getRandom(NPC_STRINGS_ON_KILL.length)]);
npc.broadcastSay(ChatType.NPC_GENERAL, NPC_STRINGS_ON_KILL[getRandom(NPC_STRINGS_ON_KILL.length)]);
cancelQuestTimer("DESPAWN", npc, killer);
return super.onKill(npc, killer, isSummon);
}

View File

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

View File

@@ -28,7 +28,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2GrandBossInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI;
@@ -163,14 +162,14 @@ public final class Core extends AbstractNpcAI
{
if (getRandom(100) == 0)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.REMOVING_INTRUDERS));
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.REMOVING_INTRUDERS);
}
}
else
{
_firstAttacked = true;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_NON_PERMITTED_TARGET_HAS_BEEN_DISCOVERED));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.INTRUDER_REMOVAL_SYSTEM_INITIATED));
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.A_NON_PERMITTED_TARGET_HAS_BEEN_DISCOVERED);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.INTRUDER_REMOVAL_SYSTEM_INITIATED);
}
}
return super.onAttack(npc, attacker, damage, isSummon);
@@ -181,11 +180,10 @@ public final class Core extends AbstractNpcAI
{
if (npc.getId() == CORE)
{
final int objId = npc.getObjectId();
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_FATAL_ERROR_HAS_OCCURRED));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.EMPTY));
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.A_FATAL_ERROR_HAS_OCCURRED);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EMPTY);
_firstAttacked = false;
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);

View File

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

View File

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

View File

@@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.Skill;
import com.l2jmobius.gameserver.model.zone.type.L2BossZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI;
@@ -245,9 +244,7 @@ public final class Orfen extends AbstractNpcAI
final L2Character originalCaster = isSummon ? caster.getServitors().values().stream().findFirst().orElse(caster.getPet()) : caster;
if ((skill.getEffectPoint() > 0) && (getRandom(5) == 0) && npc.isInsideRadius(originalCaster, 1000, false, false))
{
final NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), TEXT[getRandom(4)]);
packet.addStringParameter(caster.getName().toString());
npc.broadcastPacket(packet);
npc.broadcastSay(ChatType.NPC_GENERAL, TEXT[getRandom(4)], caster.getName());
originalCaster.teleToLocation(npc.getLocation());
npc.setTarget(originalCaster);
npc.doCast(SkillData.getInstance().getSkill(4064, 1));
@@ -300,9 +297,7 @@ public final class Orfen extends AbstractNpcAI
}
else if (npc.isInsideRadius(attacker, 1000, false, false) && !npc.isInsideRadius(attacker, 300, false, false) && (getRandom(10) == 0))
{
final NpcSay packet = new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npcId, TEXT[getRandom(3)]);
packet.addStringParameter(attacker.getName().toString());
npc.broadcastPacket(packet);
npc.broadcastSay(ChatType.NPC_GENERAL, TEXT[getRandom(3)], attacker.getName());
attacker.teleToLocation(npc.getLocation());
npc.setTarget(attacker);
npc.doCast(SkillData.getInstance().getSkill(4064, 1));

View File

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

View File

@@ -24,7 +24,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
@@ -73,7 +72,7 @@ public final class SinWardens extends AbstractNpcAI
if (killedCount == 5)
{
master.broadcastPacket(new NpcSay(master.getObjectId(), ChatType.NPC_GENERAL, master.getId(), NpcStringId.WE_MIGHT_NEED_NEW_SLAVES_I_LL_BE_BACK_SOON_SO_WAIT));
master.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WE_MIGHT_NEED_NEW_SLAVES_I_LL_BE_BACK_SOON_SO_WAIT);
master.doDie(killer);
killedMinionsCount.remove(master.getObjectId());
}

View File

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

View File

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

View File

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

View File

@@ -85,19 +85,19 @@ public final class LaVieEnRose extends AbstractNpcAI
}
case "SPAM_TEXT":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_BEAUTY_SHOP_IS_OPEN_COME_ON_IN);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_BEAUTY_SHOP_IS_OPEN_COME_ON_IN);
startQuestTimer("SPAM_TEXT2", 2500, npc, null);
break;
}
case "SPAM_TEXT2":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_LOOK_GOOD_TOO_BUDDY_COME_ON_COME_ON);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_LOOK_GOOD_TOO_BUDDY_COME_ON_COME_ON);
startQuestTimer("SPAM_TEXT3", 2500, npc, null);
break;
}
case "SPAM_TEXT3":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.EVERYONE_COME_ON_LET_S_GO_GANGNAM_STYLE);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVERYONE_COME_ON_LET_S_GO_GANGNAM_STYLE);
break;
}
case "cancel":

View File

@@ -119,7 +119,7 @@ public final class Mammons extends AbstractNpcAI
if (blacksmith != null)
{
broadcastNpcSay(blacksmith, ChatType.NPC_GENERAL, NpcStringId.I_HAVE_SOME_EXCELLENT_WEAPONS_TO_SHOW_YOU);
blacksmith.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAVE_SOME_EXCELLENT_WEAPONS_TO_SHOW_YOU);
}
if (Config.ANNOUNCE_MAMMON_SPAWN)

View File

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

View File

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

View File

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

View File

@@ -21,7 +21,6 @@ import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.itemcontainer.Inventory;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
@@ -215,7 +214,7 @@ public final class WeaverOlf extends AbstractNpcAI
}
else
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.WHAT_A_PREDICAMENT_MY_ATTEMPTS_WERE_UNSUCCESSFUL));
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.WHAT_A_PREDICAMENT_MY_ATTEMPTS_WERE_UNSUCCESSFUL);
}
}
else

View File

@@ -613,7 +613,7 @@ public final class AteliaManager extends AbstractNpcAI
}
else if (Util.contains(FLOOR_MOBS, npc.getId()) && (chance > 90))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ATELIA_MSG[getRandom(1)], attacker.getName());
npc.broadcastSay(ChatType.NPC_GENERAL, ATELIA_MSG[getRandom(1)], attacker.getName());
}
return super.onAttack(npc, attacker, damage, isSummon);
}

View File

@@ -44,7 +44,7 @@ public final class MercenaryCaptain extends AbstractNpcAI
{
if (event.equals("BROADCAST_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_SOUTHERN_PART_OF_DRAGON_VALLEY_IS_MUCH_MORE_DANGEROUS_THAN_THE_NORTH_BE_CAREFUL, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THE_SOUTHERN_PART_OF_DRAGON_VALLEY_IS_MUCH_MORE_DANGEROUS_THAN_THE_NORTH_BE_CAREFUL, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -44,7 +44,7 @@ public final class Namo extends AbstractNpcAI
{
if (event.equals("BROADCAST_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THIS_PLACE_SWARMS_WITH_DRAGONS_BY_DAY_AND_UNDEAD_BY_NIGHT, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_PLACE_SWARMS_WITH_DRAGONS_BY_DAY_AND_UNDEAD_BY_NIGHT, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -44,7 +44,7 @@ public final class Rakun extends AbstractNpcAI
{
if (event.equals("BROADCAST_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THIS_PLACE_SWARMS_WITH_DRAGONS_BY_DAY_AND_UNDEAD_BY_NIGHT, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.THIS_PLACE_SWARMS_WITH_DRAGONS_BY_DAY_AND_UNDEAD_BY_NIGHT, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

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

View File

@@ -43,7 +43,7 @@ public final class Lailly extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -0,0 +1,62 @@
/*
* 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 ai.zones.Gracia.npcs;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* El AI.
* @author St3eT
*/
public final class El extends AbstractNpcAI
{
// NPCs
private static final int EL = 32556;
private El()
{
super(El.class.getSimpleName(), "ai/zones/Gracia/npcs");
addSpawnId(EL);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_USE_THE_JUMP_BOARD_TO_GET_STRAIGHT_TO_THE_2ND_FLOOR, 1000);
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSpawn(L2Npc npc)
{
startQuestTimer("SPAM_TEXT", 10000, npc, null, true);
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new El();
}
}

View File

@@ -25,7 +25,6 @@ import com.l2jmobius.gameserver.model.L2Spawn;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import ai.AbstractNpcAI;
@@ -68,13 +67,13 @@ public final class GeneralDilios extends AbstractNpcAI
int value = Integer.parseInt(event.substring(8));
if (value < 6)
{
_general.broadcastPacket(new NpcSay(_general.getObjectId(), ChatType.NPC_GENERAL, GENERAL_ID, NpcStringId.STABBING_THREE_TIMES));
_general.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.STABBING_THREE_TIMES);
startQuestTimer("guard_animation_0", 3400, null, null);
}
else
{
value = -1;
_general.broadcastPacket(new NpcSay(_general.getObjectId(), ChatType.NPC_SHOUT, GENERAL_ID, DILIOS_TEXT[getRandom(DILIOS_TEXT.length)]));
_general.broadcastSay(ChatType.NPC_SHOUT, DILIOS_TEXT[getRandom(DILIOS_TEXT.length)]);
}
startQuestTimer("command_" + (value + 1), 60000, null, null);
}

View File

@@ -1,7 +1,7 @@
<html><body>Engineer Lekon:<br>
Airship, eh? If you want board an Airship, you need to first register for a Summon License. There's a switch on the Airship controls that proves your qualifications to summon and pilot it. Unless you obtain that license, you won't be allowed to fly.<br>
Only <font color="LEVEL">clan lords whose clan is level 5 or higher</font> may earn the license. There is also a limit on the number of Airships.<br>
Only <font color="LEVEL">Clan Leaders whose clan is level 5 or above</font> may earn the license. There is also a limit on the number of Airships.<br>
If you meet the requirements, you can obtain a Airship Summon License in exchange for <font color="LEVEL">10 Energy Star Stones</font>.<br>
An Energy Star Stone can be made by assembling Star Stones found floating in the skies over Gracia. If you thinkk this is too time-consuming, you can also buy them from Officer Tolonis right over there..<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lekon licence">Obtain the Airship Summon License.</Button>
An Energy Star Stone can be made by assembling Star Stones found floating in the skies over Gracia. If you think this is too time-consuming, you can also buy them from Officer Tolonis right over there..<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lekon licence">Obtain an Airship Summon License </Button>
</body></html>

View File

@@ -1,3 +1,3 @@
<html><body>Engineer Lekon:<br>
Only a clan lord whose clan is level 5 or above can be issued an Airship Summon License.
Only a Clan Leader whose clan is level 5 or above can be issued an Airship Summon License.
</body></html>

View File

@@ -64,17 +64,17 @@ public class Lindvior extends AbstractNpcAI
{
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;
}
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;
}
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;
}
case "lindvior_scene":

View File

@@ -1,9 +1,9 @@
<html><body>Mage Notingale:<br>
<html><body>Mage Nottingale:<br>
Welcome to Gracia! I am here to guide adventures who come from Aden.<br>
It is impossible to walk around in Gracia because of the contamination caused by the Seeds. Most move via Airship, but that is also difficult -- there simply aren't enough for everyone.<br>
The magicians of Aden crafted an alternative plan. It is called an <font color="LEVEL">Aurabird</font>. I think it is the better solution for you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Nottingale 32627-02.html">Ask what to do.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Nottingale 32627-03.html">Ask about Aerial Raid Monsters.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Nottingale 32627-04.html">Ask about major hunting grounds.</Button>
The magicians of Aden crafted an alternative plan. It is called an <font color="LEVEL">Aura Bird</font>. I think it is the better solution for you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Nottingale 32627-02.html">"What should I do?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Nottingale 32627-03.html">"Can you tell me about Aerial Raid Monsters?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Nottingale 32627-04.html">"Any there any major hunting grounds nearby?"</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -0,0 +1,62 @@
/*
* 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 ai.zones.Gracia.npcs;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import ai.AbstractNpcAI;
/**
* Plenos AI.
* @author St3eT
*/
public final class Plenos extends AbstractNpcAI
{
// NPCs
private static final int PLENOS = 32563;
private Plenos()
{
super(Plenos.class.getSimpleName(), "ai/zones/Gracia/npcs");
addSpawnId(PLENOS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_BE_TELEPORTED_TO_EACH_SEED_IF_YOU_VOLUNTEER_WHY_NOT_TRY, 1000);
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSpawn(L2Npc npc)
{
startQuestTimer("SPAM_TEXT", 10000, npc, null, true);
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new Plenos();
}
}

View File

@@ -0,0 +1,7 @@
<html><head><body>Seed Teleport Device:<br>
Let me guide you to the Seeds.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest SeedTeleportDevice seedOfAnnihilation">"I want to go to the Seed of Annihilation (Lv.85)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest SeedTeleportDevice seedOfDestruction">"I want to go to the Seed of Destruction (Lv.93)."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest SeedTeleportDevice seedOfInfinity">"Can I go to the Seed of Infinity (Lv.95)?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest SeedTeleportDevice seedOfHellfire">"Teleport me to the Seed of Hellfire (Lv.97)."</Button>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><head><body>Seed Teleport Device:<br>
You must be Lv. <font color="LEVEL">97</font> or above to use the Seed of Teleport Device to the <font color="LEVEL">Seed of Hellfire</font>.
</body></html>

View File

@@ -0,0 +1,87 @@
/*
* 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 ai.zones.Gracia.npcs.SeedTeleportDevice;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import ai.AbstractNpcAI;
/**
* Seed Teleport Device AI.
* @author St3eT
*/
public final class SeedTeleportDevice extends AbstractNpcAI
{
// NPCs
private static final int SEED_TELEPORT_DEVICE = 15929;
// Locations
private static final Location SOA = new Location(-175572, 154572, 2712);
private static final Location SOD = new Location(-247024, 251794, 4336);
private static final Location SOI = new Location(-213699, 210686, 4408);
private static final Location SOH = new Location(-147354, 152581, -14048);
// Misc
private static final int SOH_MIN_LV = 97;
private SeedTeleportDevice()
{
super(SeedTeleportDevice.class.getSimpleName(), "ai/zones/Gracia/npcs");
addStartNpc(SEED_TELEPORT_DEVICE);
addFirstTalkId(SEED_TELEPORT_DEVICE);
addTalkId(SEED_TELEPORT_DEVICE);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
switch (event)
{
case "seedOfAnnihilation":
{
player.teleToLocation(SOA);
break;
}
case "seedOfDestruction":
{
player.teleToLocation(SOD);
break;
}
case "seedOfInfinity":
{
player.teleToLocation(SOI);
break;
}
case "seedOfHellfire":
{
if (player.getLevel() < SOH_MIN_LV)
{
return "SeedOfHellfire-noLv.html";
}
player.teleToLocation(SOH);
break;
}
}
return super.onAdvEvent(event, npc, player);
}
public static void main(String[] args)
{
new SeedTeleportDevice();
}
}

View File

@@ -66,7 +66,7 @@ public final class Seyo extends AbstractNpcAI
if (npc.isScriptValue(1))
{
npc.setScriptValue(0);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, TEXT[getRandom(TEXT.length)]);
npc.broadcastSay(ChatType.NPC_GENERAL, TEXT[getRandom(TEXT.length)]);
}
break;
}
@@ -87,11 +87,11 @@ public final class Seyo extends AbstractNpcAI
if (getRandom(100) == 0)
{
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
{
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);
}
@@ -114,18 +114,18 @@ public final class Seyo extends AbstractNpcAI
final int chance = getRandom(100);
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)
{
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
{
final int itemCount = getRandom(10, 16);
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);
}
@@ -149,17 +149,17 @@ public final class Seyo extends AbstractNpcAI
if (chance == 0)
{
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)
{
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
{
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);
}

View File

@@ -37,7 +37,6 @@ import com.l2jmobius.gameserver.model.zone.L2ZoneType;
import com.l2jmobius.gameserver.model.zone.type.L2ScriptZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
public abstract class AirShipController extends Quest
@@ -101,7 +100,6 @@ public abstract class AirShipController extends Quest
private Future<?> _departSchedule = null;
private NpcSay _arrivalMessage = null;
private static final int DEPART_INTERVAL = 300000; // 5 min
private static final int LICENSE = 13559;
@@ -164,12 +162,7 @@ public abstract class AirShipController extends Quest
ship.executePath(_arrivalPath);
}
if (_arrivalMessage == null)
{
_arrivalMessage = new NpcSay(npc.getObjectId(), ChatType.NPC_SHOUT, npc.getId(), NpcStringId.THE_AIRSHIP_HAS_BEEN_SUMMONED_IT_WILL_AUTOMATICALLY_DEPART_IN_5_MINUTES);
}
npc.broadcastPacket(_arrivalMessage);
npc.broadcastSay(ChatType.NPC_SHOUT, NpcStringId.THE_AIRSHIP_HAS_BEEN_SUMMONED_IT_WILL_AUTOMATICALLY_DEPART_IN_5_MINUTES);
}
else
{

View File

@@ -1,6 +1,5 @@
<html><body>Airship Controller:<br>
You see a floating piece of stone filled with a mysterious power. The green light is flashing, so there doesn't appear to be anything wrong with its function.<br>
Using this should allow you to board the Airship headed for the continent of Gracia.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AirShipGludioGracia board">Board the Airship.</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
<html><body>Flight Device:<br>
A floating shard of powered stone. The steady blue light appears to mean the device in functioning within normal limits.<br>
This device grants you control of the airship.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest AirShipGludioGracia board">Board the airship</Button>
</body></html>

View File

@@ -29,7 +29,6 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
/**
* @author DS
@@ -129,7 +128,7 @@ public final class AirShipGludioGracia extends Quest implements Runnable
}
if (_atcGludio != null)
{
_atcGludio.broadcastPacket(new NpcSay(_atcGludio.getObjectId(), ChatType.NPC_SHOUT, _atcGludio.getId(), npcString));
_atcGludio.broadcastSay(ChatType.NPC_SHOUT, npcString);
}
}
@@ -142,7 +141,7 @@ public final class AirShipGludioGracia extends Quest implements Runnable
}
if (_atcGracia != null)
{
_atcGracia.broadcastPacket(new NpcSay(_atcGracia.getObjectId(), ChatType.NPC_SHOUT, _atcGracia.getId(), npcStringId));
_atcGracia.broadcastSay(ChatType.NPC_SHOUT, npcStringId);
}
}

View File

@@ -1,8 +1,9 @@
<html><body>Airship Controller:<br>
You see a floating piece of stone filled with a mysterious power. The green light is flashing, so there doesn't appear to be anything wrong with its function.<br><br>
By manipulating this, you should be able to control the Airship.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusNorthController board">Board the Airship.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusNorthController summon">Summon the Airship.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusNorthController register">Register summoning license.</Button>
<html><body>Flight Device:<br>
A floating fragment of stone hovers in front of you, glowing in a pale blue light. It appears to be functioning and undamaged.<br>
You have gained access to the flight controls.<br>
You can only go to the Seed through a <font color="LEVEL">Seed Teleport Device</font>.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusNorthController board">Board the airship</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusNorthController summon">Summon the airship</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusNorthController register">Request permission to summon the airship (Airship Summoning Permit required)</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -1,8 +1,9 @@
<html><body>Airship Controller:<br>
You see a floating piece of stone filled with a mysterious power. The green light is flashing, so there doesn't appear to be anything wrong with its function.<br><br>
By manipulating this, you should be able to control the Airship.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusSouthController board">Board the Airship.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusSouthController summon">Summon the Airship.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusSouthController register">Register summoning license.</Button>
<html><body>Flight Device:<br>
A floating fragment of stone hovers in front of you, glowing in a pale blue light. It appears to be functioning and undamaged.<br>
You have gained access to the flight controls.<br>
You can only go to the Seed through a <font color="LEVEL">Seed Teleport Device</font>.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusSouthController board">Board the airship</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusSouthController summon">Summon the airship</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KeucereusSouthController register">Request permission to summon the airship (Airship Summoning Permit required)</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

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

View File

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

View File

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

View File

@@ -55,12 +55,12 @@ public final class Apprentice extends AbstractNpcAI
}
else
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_T_RIDE_A_KUKURI_NOW);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_T_RIDE_A_KUKURI_NOW);
}
}
else if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.TRY_RIDING_A_KUKURI, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TRY_RIDING_A_KUKURI, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -50,7 +50,7 @@ public final class Banette extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, BANETTE_SHOUT[getRandom(3)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, BANETTE_SHOUT[getRandom(3)], 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -43,7 +43,7 @@ public final class Bink extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.TALKING_ISLAND_VILLAGE_IS_REALLY_BEAUTIFUL, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.TALKING_ISLAND_VILLAGE_IS_REALLY_BEAUTIFUL, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -64,7 +64,7 @@ public final class Devno extends AbstractNpcAI
{
if (event.equalsIgnoreCase("npc_move") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, DEVNO_SHOUT[getRandom(3)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, DEVNO_SHOUT[getRandom(3)], 1000);
if (getRandom(100) > 40)
{
addMoveToDesire(npc, DEVNO_LOC[getRandom(10)], 0);

View File

@@ -63,7 +63,7 @@ public final class Eleve extends AbstractNpcAI
{
if (event.equalsIgnoreCase("npc_move") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, ELEVE_SHOUT[getRandom(2)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, ELEVE_SHOUT[getRandom(2)], 1000);
if (getRandom(100) > 40)
{
addMoveToDesire(npc, ELEVE_LOC[getRandom(10)], 0);

View File

@@ -49,7 +49,7 @@ public final class Gagabu extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, GAGABU_SHOUT[getRandom(2)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, GAGABU_SHOUT[getRandom(2)], 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -50,7 +50,7 @@ public final class Heymond extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, HEYMOND_SHOUT[getRandom(3)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, HEYMOND_SHOUT[getRandom(3)], 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -65,12 +65,12 @@ public final class Karonf extends AbstractNpcAI
{
if (getRandom(100) > 40)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, KARONF_SHOUT[getRandom(2)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, KARONF_SHOUT[getRandom(2)], 1000);
addMoveToDesire(npc, KARONF_LOC[getRandom(10)], 0);
}
else
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, KARONF_SHOUT[getRandom(2)]);
npc.broadcastSay(ChatType.NPC_GENERAL, KARONF_SHOUT[getRandom(2)]);
}
}
return null;

View File

@@ -50,7 +50,7 @@ public final class Lumi extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, LUMI_SHOUT[getRandom(3)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, LUMI_SHOUT[getRandom(3)], 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -43,7 +43,7 @@ public final class Mahram extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.ALCHEMY_IS_A_SCIENCE_AND_AN_ART, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ALCHEMY_IS_A_SCIENCE_AND_AN_ART, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -43,7 +43,7 @@ public final class Mai extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.EVERY_RACE_BUILT_A_PIECE_OF_THIS_VILLAGE, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.EVERY_RACE_BUILT_A_PIECE_OF_THIS_VILLAGE, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -43,7 +43,7 @@ public final class MarinSmith extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HMM_IS_THIS_STILL_A_DECENT_WEAPON, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.HMM_IS_THIS_STILL_A_DECENT_WEAPON, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -52,7 +52,7 @@ public final class Milia extends AbstractNpcAI
}
else if (event.equals("TEXT_SPAM") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.SPEAK_WITH_ME_ABOUT_TRAVELING_AROUND_ADEN, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.SPEAK_WITH_ME_ABOUT_TRAVELING_AROUND_ADEN, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -43,7 +43,7 @@ public final class Oris extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_HAVEN_T_FELT_THIS_GOOD_IN_AGES, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_HAVEN_T_FELT_THIS_GOOD_IN_AGES, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -74,7 +74,7 @@ public final class Pantheon extends AbstractNpcAI
{
if (npc != null)
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IS_IT_BETTER_TO_END_DESTINY_OR_START_DESTINY);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.IS_IT_BETTER_TO_END_DESTINY_OR_START_DESTINY);
}
break;
}

View File

@@ -43,7 +43,7 @@ public final class Shannon extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.LOOK_AT_ALL_THE_NEWBIES_HA_HA_HA, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.LOOK_AT_ALL_THE_NEWBIES_HA_HA_HA, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -49,7 +49,7 @@ public final class Sodian extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, SODIAN_SHOUT[getRandom(2)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, SODIAN_SHOUT[getRandom(2)], 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -49,7 +49,7 @@ public final class Stiller extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, STILLER_SHOUT[getRandom(2)], 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, STILLER_SHOUT[getRandom(2)], 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -43,7 +43,7 @@ public final class Theodore extends AbstractNpcAI
{
if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.AND_NOW_YOUR_JOURNEY_BEGINS, 1000);
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.AND_NOW_YOUR_JOURNEY_BEGINS, 1000);
}
return super.onAdvEvent(event, npc, player);
}