Sync with L2JServer Feb 7th 2015.

This commit is contained in:
mobius
2015-02-07 23:48:56 +00:00
parent 1e166ca657
commit ecd17fdefb
1949 changed files with 3120 additions and 33466 deletions

View File

@@ -20,6 +20,7 @@ package ai.npc;
import java.util.logging.Logger;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance;
@@ -83,7 +84,7 @@ public abstract class AbstractNpcAI extends Quest
* @param type
* @param text
*/
protected void broadcastNpcSay(L2Npc npc, int type, String text)
protected void broadcastNpcSay(L2Npc npc, ChatType type, String text)
{
Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), text));
}
@@ -94,7 +95,7 @@ public abstract class AbstractNpcAI extends Quest
* @param type
* @param stringId
*/
protected void broadcastNpcSay(L2Npc npc, int type, NpcStringId stringId)
protected void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId stringId)
{
Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), stringId));
}
@@ -106,7 +107,7 @@ public abstract class AbstractNpcAI extends Quest
* @param stringId
* @param parameters
*/
protected void broadcastNpcSay(L2Npc npc, int type, NpcStringId stringId, String... 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)
@@ -126,7 +127,7 @@ public abstract class AbstractNpcAI extends Quest
* @param text
* @param radius
*/
protected void broadcastNpcSay(L2Npc npc, int type, String text, int radius)
protected void broadcastNpcSay(L2Npc npc, ChatType type, String text, int radius)
{
Broadcast.toKnownPlayersInRadius(npc, new NpcSay(npc.getObjectId(), type, npc.getTemplate().getDisplayId(), text), radius);
}
@@ -138,7 +139,7 @@ public abstract class AbstractNpcAI extends Quest
* @param stringId
* @param radius
*/
protected void broadcastNpcSay(L2Npc npc, int type, NpcStringId stringId, int 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);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*

View File

@@ -22,12 +22,12 @@ import quests.Q00184_ArtOfPersuasion.Q00184_ArtOfPersuasion;
import quests.Q00185_NikolasCooperation.Q00185_NikolasCooperation;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.enums.QuestSound;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Alarm AI for quests Art of Persuasion (184) and Nikola's Cooperation (185).
@@ -61,19 +61,19 @@ public final class Alarm extends AbstractNpcAI
case "SELF_DESTRUCT_IN_60":
{
startQuestTimer("SELF_DESTRUCT_IN_30", 30000, npc, null);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_60_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
broadcastNpcSay(npc, 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, Say2.NPC_ALL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_30_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
broadcastNpcSay(npc, 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, Say2.NPC_ALL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.THE_ALARM_WILL_SELF_DESTRUCT_IN_10_SECONDS_ENTER_PASSCODE_TO_OVERRIDE);
break;
}
case "RECORDER_CRUSHED":
@@ -85,7 +85,7 @@ public final class Alarm extends AbstractNpcAI
npc0.getVariables().set("SPAWNED", false);
if (player0 != null)
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.RECORDER_CRUSHED);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.RECORDER_CRUSHED);
if (verifyMemoState(player0, ART_OF_PERSUASION_ID, -1))
{
setMemoState(player0, ART_OF_PERSUASION_ID, 5);
@@ -234,7 +234,7 @@ public final class Alarm extends AbstractNpcAI
public String onSpawn(L2Npc npc)
{
startQuestTimer("SELF_DESTRUCT_IN_60", 60000, npc, null);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.INTRUDER_ALERT_THE_ALARM_WILL_SELF_DESTRUCT_IN_2_MINUTES);
broadcastNpcSay(npc, 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

@@ -20,11 +20,11 @@ package ai.npc.Apprentice;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Apprentice AI.
@@ -57,12 +57,12 @@ public final class Apprentice extends AbstractNpcAI
}
else
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.YOU_CAN_T_RIDE_A_KUKURI_NOW);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.YOU_CAN_T_RIDE_A_KUKURI_NOW);
}
}
else if (event.equals("SPAM_TEXT") && (npc != null))
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.TRY_RIDING_A_KUKURI);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.TRY_RIDING_A_KUKURI, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -20,13 +20,13 @@ package ai.npc.CastleTeleporter;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.instancemanager.MapRegionManager;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.entity.Siege;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
/**
@@ -74,7 +74,7 @@ public final class CastleTeleporter extends AbstractNpcAI
else if (event.equalsIgnoreCase("teleport"))
{
final int region = MapRegionManager.getInstance().getMapRegionLocId(npc.getX(), npc.getY());
final NpcSay msg = new NpcSay(npc, Say2.NPC_SHOUT, NpcStringId.THE_DEFENDERS_OF_S1_CASTLE_WILL_BE_TELEPORTED_TO_THE_INNER_CASTLE);
final NpcSay msg = new NpcSay(npc, ChatType.NPC_SHOUT, NpcStringId.THE_DEFENDERS_OF_S1_CASTLE_WILL_BE_TELEPORTED_TO_THE_INNER_CASTLE);
msg.addStringParameter(npc.getCastle().getName());
npc.getCastle().oustAllPlayers();
npc.setScriptValue(0);

View File

@@ -1,71 +0,0 @@
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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.npc.Dorian;
import quests.Q00024_InhabitantsOfTheForestOfTheDead.Q00024_InhabitantsOfTheForestOfTheDead;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Dorian (Raid Fighter) - Quest AI
* @author malyelfik
*/
public final class Dorian extends AbstractNpcAI
{
// NPC
private static final int DORIAN = 25332;
// Items
private static final int SILVER_CROSS = 7153;
private static final int BROKEN_SILVER_CROSS = 7154;
private Dorian()
{
super(Dorian.class.getSimpleName(), "ai/npc");
addSeeCreatureId(DORIAN);
}
@Override
public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon)
{
if (creature.isPlayer())
{
final L2PcInstance pl = creature.getActingPlayer();
final QuestState qs = pl.getQuestState(Q00024_InhabitantsOfTheForestOfTheDead.class.getSimpleName());
if ((qs != null) && qs.isCond(3))
{
takeItems(pl, SILVER_CROSS, -1);
giveItems(pl, BROKEN_SILVER_CROSS, 1);
qs.setCond(4, true);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.THAT_SIGN);
}
}
return super.onSeeCreature(npc, creature, isSummon);
}
public static void main(String[] args)
{
new Dorian();
}
}

View File

@@ -20,12 +20,12 @@ package ai.npc.ForgeOfTheGods;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Rooney AI
@@ -95,16 +95,16 @@ public final class Rooney extends AbstractNpcAI
switch (aiVal)
{
case 1:
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.HURRY_HURRY);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.HURRY_HURRY);
break;
case 2:
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.I_AM_NOT_THAT_TYPE_OF_PERSON_WHO_STAYS_IN_ONE_PLACE_FOR_A_LONG_TIME);
broadcastNpcSay(npc, 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, Say2.NPC_ALL, NpcStringId.IT_S_HARD_FOR_ME_TO_KEEP_STANDING_LIKE_THIS);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IT_S_HARD_FOR_ME_TO_KEEP_STANDING_LIKE_THIS);
break;
case 4:
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.WHY_DON_T_I_GO_THAT_WAY_THIS_TIME);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WHY_DON_T_I_GO_THAT_WAY_THIS_TIME);
break;
default:
npc.teleToLocation(LOCATIONS[getRandom(LOCATIONS.length)], false);
@@ -122,7 +122,7 @@ public final class Rooney extends AbstractNpcAI
{
if (creature.isPlayer() && npc.isScriptValue(0))
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.WELCOME);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.WELCOME);
startQuestTimer("teleport", 60000, npc, null);
npc.setScriptValue(1);
}

View File

@@ -1,5 +1,6 @@
<html><body>Steward:<br>
Welcome to the castle of the great Queen Freya. This place is open to the public per the Ice Queen's instruction, though the queen doesn't like noise. Please try to be quiet.<br><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FreyasSteward">They work together with the Jinea Guild.</Button>
Welcome to Ice Queen Freya's Castle. While this place used to be inhabited by Sirra, our great queen is now taking up residence here. And she has decided to open this place to all. Have a look around, if you like.<br1>
If you are looking for Jinia and her guild, proceed down the road. I've heard that Jinia can get you into the Ice Queen's castle. You must let me know when you return. If you'd rather, I can teleport you there.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest FreyasSteward">"Please teleport me to Jinia."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>
</body></html>

View File

@@ -1,4 +1,6 @@
<html><body>Jinia:<br>
Sorry. I don't have time, I'm dealing with something important.<br>
We must be prepared before confronting Freya. As the winter cold swells around the castle, she becomes even stronger. We can use blitz tactics and strike her before her power matures fully. Then again, if we wait until she is at full strength, I'm sure the reward will be greater. I leave the choice to you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Jinia 32781-06.html">Challenge Freya.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Jinia 32781-07.html">Challenge Freya in the extreme cold.</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Jinia:<br>
Be careful. Should anything happen, we'll try to help you.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleNormalBattle enter">"Thanks, Jinia."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleBattle enterEasy">"Thanks, Jinia."</Button>
</body></html>

View File

@@ -1,5 +1,5 @@
<html><body>Jinia:<br>
Her power is without equal. She truly is a frozen goddess. Are you sure you're ready?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleHardBattle enter">"It's now or never."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleBattle enterHardcore">"It's now or never."</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Jinia 32781-08.html">"Perhaps I'll think again."</Button>
</body></html>

View File

@@ -1,6 +1,5 @@
<html><body>Jinia:<br>
Alright, we'll depart now. Keep those nerves of steel!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest IceQueensCastleNormalBattle enter">Enter the Ice Queen's Castle.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest IceQueensCastleHardBattle enter">Enter the Ice Queen's Castle (Hard).</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Quest IceQueensCastleBattle enterEasy">Enter the Ice Queen's Castle.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Jinia 32781-11.html">"Wait a moment, I'm not ready."</Button>
</body></html>

View File

@@ -1,3 +1,3 @@
<html><body>Jinia:<br>
Alright, understood. Preparations must be thorough. Just let me know when you're ready to go.
</body></html>
</body></html>

View File

@@ -90,16 +90,16 @@ public final class Jinia extends AbstractNpcAI
final QuestState st = player.getQuestState(Q10286_ReunionWithSirra.class.getSimpleName());
if ((st != null) && (player.getLevel() >= MIN_LEVEL))
{
if (st.isCompleted())
{
return "32781-02.html";
}
else if (st.isCond(5) || st.isCond(6))
if (st.isCond(5) || st.isCond(6))
{
return "32781-09.html";
}
else if (st.isCond(7))
{
return "32781-01.html";
}
}
return "32781-01.html";
return "32781-02.html";
}
public static void main(String[] args)

View File

@@ -20,8 +20,10 @@ package ai.npc.LaVieEnRose;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.serverpackets.ExResponseBeautyList;
import com.l2jserver.gameserver.network.serverpackets.ExResponseResetList;
import com.l2jserver.gameserver.network.serverpackets.ExShowBeautyMenu;
@@ -34,6 +36,7 @@ public final class LaVieEnRose extends AbstractNpcAI
{
// NPCs
private static final int LA_VIE_EN_ROSE = 33825;
private static final int BEAUTY_SHOP_HELPER = 33854;
private LaVieEnRose()
{
@@ -41,6 +44,7 @@ public final class LaVieEnRose extends AbstractNpcAI
addStartNpc(LA_VIE_EN_ROSE);
addTalkId(LA_VIE_EN_ROSE);
addFirstTalkId(LA_VIE_EN_ROSE);
addSpawnId(BEAUTY_SHOP_HELPER);
}
@Override
@@ -81,16 +85,39 @@ public final class LaVieEnRose extends AbstractNpcAI
player.sendPacket(new ExResponseResetList(player));
break;
}
case "SPAM_TEXT":
{
broadcastNpcSay(npc, 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);
startQuestTimer("SPAM_TEXT3", 2500, npc, null);
break;
}
case "SPAM_TEXT3":
{
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.EVERYONE_COME_ON_LET_S_GO_GANGNAM_STYLE);
break;
}
case "cancel":
default:
{
break;
}
}
return htmltext;
}
@Override
public String onSpawn(L2Npc npc)
{
startQuestTimer("SPAM_TEXT", (5 * 60 * 1000), npc, null, true);
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new LaVieEnRose();

View File

@@ -26,11 +26,11 @@ import java.util.Objects;
import ai.npc.AbstractNpcAI;
import com.l2jserver.Config;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.util.Broadcast;
/**
@@ -120,7 +120,7 @@ public final class Mammons extends AbstractNpcAI
if (blacksmith != null)
{
broadcastNpcSay(blacksmith, Say2.NPC_ALL, NpcStringId.I_HAVE_SOME_EXCELLENT_WEAPONS_TO_SHOW_YOU);
broadcastNpcSay(blacksmith, ChatType.NPC_GENERAL, NpcStringId.I_HAVE_SOME_EXCELLENT_WEAPONS_TO_SHOW_YOU);
}
if (Config.ANNOUNCE_MAMMON_SPAWN)

View File

@@ -20,11 +20,11 @@ package ai.npc.Milia;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Milia AI.
@@ -39,7 +39,7 @@ public final class Milia extends AbstractNpcAI
private Milia()
{
super(Milia.class.getSimpleName(), "ai/npc/Teleports");
super(Milia.class.getSimpleName(), "ai/npc");
addSpawnId(MILIA);
addStartNpc(MILIA);
addTalkId(MILIA);
@@ -54,7 +54,7 @@ public final class Milia extends AbstractNpcAI
}
else if (event.equals("TEXT_SPAM") && (npc != null))
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.SPEAK_WITH_ME_ABOUT_TRAVELING_AROUND_ADEN);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.SPEAK_WITH_ME_ABOUT_TRAVELING_AROUND_ADEN, 1000);
}
return super.onAdvEvent(event, npc, player);
}

View File

@@ -24,6 +24,7 @@ import java.util.List;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.datatables.SpawnTable;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.L2Object;
import com.l2jserver.gameserver.model.L2Spawn;
import com.l2jserver.gameserver.model.Location;
@@ -34,7 +35,6 @@ import com.l2jserver.gameserver.model.events.impl.character.OnCreatureSkillUse;
import com.l2jserver.gameserver.model.events.listeners.ConsumerEventListener;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.util.Util;
/**
@@ -90,7 +90,7 @@ public final class Minigame extends AbstractNpcAI
takeItems(player, UNLIT_TORCHLIGHT, 1);
giveItems(player, TORCHLIGHT, 1);
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.I_LL_START_THE_FURNACE_MECHANISM_WATCH_FOR_THE_PATTERN);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.I_LL_START_THE_FURNACE_MECHANISM_WATCH_FOR_THE_PATTERN);
room.getManager().setTarget(player);
room.setParticipant(player);
@@ -155,7 +155,7 @@ public final class Minigame extends AbstractNpcAI
}
else
{
broadcastNpcSay(room.getManager(), Say2.NPC_ALL, NpcStringId.NOW_LIGHT_THE_FURNACES_IN_THE_CORRECT_ORDER);
broadcastNpcSay(room.getManager(), 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);
@@ -166,19 +166,19 @@ public final class Minigame extends AbstractNpcAI
}
case "hurry_up":
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.ONLY_1_MINUTE_LEFT);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.ONLY_1_MINUTE_LEFT);
startQuestTimer("hurry_up2", 60000, npc, null);
break;
}
case "hurry_up2":
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.JUST_10_SECONDS_LEFT);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.JUST_10_SECONDS_LEFT);
startQuestTimer("expire", 10000, npc, null);
break;
}
case "expire":
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.TOO_LATE_THE_TORCH_HAS_RUN_OUT_MAYBE_NEXT_TIME);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.TOO_LATE_THE_TORCH_HAS_RUN_OUT_MAYBE_NEXT_TIME);
}
case "end":
{
@@ -287,7 +287,7 @@ public final class Minigame extends AbstractNpcAI
else
{
addSpawn(TREASURE_BOX, room.getParticipant().getLocation(), true, 0);
broadcastNpcSay(room.getManager(), Say2.NPC_ALL, NpcStringId.THAT_S_IT_YOU_VE_DONE_IT);
broadcastNpcSay(room.getManager(), ChatType.NPC_GENERAL, NpcStringId.THAT_S_IT_YOU_VE_DONE_IT);
room.setCurrentPot(0);
room.burnThemAll();
startQuestTimer("off", 2000, room.getManager(), null);
@@ -298,7 +298,7 @@ public final class Minigame extends AbstractNpcAI
{
if (room.getAttemptNumber() == MAX_ATTEMPTS)
{
broadcastNpcSay(room.getManager(), Say2.NPC_ALL, NpcStringId.I_VE_FAILED_ANY_FURTHER_ATTEMPTS_WOULD_BE_WASTEFUL);
broadcastNpcSay(room.getManager(), 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);
@@ -306,7 +306,7 @@ public final class Minigame extends AbstractNpcAI
}
else if (room.getAttemptNumber() < MAX_ATTEMPTS)
{
broadcastNpcSay(room.getManager(), Say2.NPC_ALL, NpcStringId.TOO_BAD_I_WILL_NOT_GIVE_UP_ON_THIS_THOUGH);
broadcastNpcSay(room.getManager(), 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

@@ -1,70 +0,0 @@
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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.npc.Oris;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* Oris AI.
* @author St3eT
*/
public final class Oris extends AbstractNpcAI
{
// NPC
private static final int ORIS = 33116;
private Oris()
{
super(Oris.class.getSimpleName(), "ai/npc");
addSpawnId(ORIS);
addStartNpc(ORIS);
addTalkId(ORIS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("SOCIAL_ACTION_1"))
{
npc.broadcastSocialAction(6);
startQuestTimer("SOCIAL_ACTION_2", 2500, npc, null);
}
else if (event.equals("SOCIAL_ACTION_2"))
{
npc.broadcastSocialAction(7);
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSpawn(L2Npc npc)
{
npc.setRandomAnimationEnabled(false);
startQuestTimer("SOCIAL_ACTION_1", 6500, npc, null, true);
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new Oris();
}
}

View File

@@ -21,12 +21,12 @@ package ai.npc.Pantheon;
import quests.Q10320_LetsGoToTheCentralSquare.Q10320_LetsGoToTheCentralSquare;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
/**
@@ -76,7 +76,7 @@ public final class Pantheon extends AbstractNpcAI
{
if (npc != null)
{
broadcastNpcSay(npc, Say2.NPC_ALL, NpcStringId.IS_IT_BETTER_TO_END_DESTINY_OR_START_DESTINY);
broadcastNpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.IS_IT_BETTER_TO_END_DESTINY_OR_START_DESTINY);
}
break;
}

View File

@@ -20,12 +20,12 @@ package ai.npc.Proclaimer;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.L2Clan;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
@@ -65,7 +65,7 @@ public final class Proclaimer extends AbstractNpcAI
String htmltext = null;
if (!player.isOnDarkSide())
{
player.sendPacket(new NpcSay(npc.getObjectId(), Say2.NPC_TELL, npc.getId(), NpcStringId.WHEN_THE_WORLD_PLUNGES_INTO_CHAOS_WE_WILL_NEED_YOUR_HELP_WE_HOPE_YOU_JOIN_US_WHEN_THE_TIME_COMES));
player.sendPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_TELL, npc.getId(), NpcStringId.WHEN_THE_WORLD_PLUNGES_INTO_CHAOS_WE_WILL_NEED_YOUR_HELP_WE_HOPE_YOU_JOIN_US_WHEN_THE_TIME_COMES));
final L2Clan ownerClan = npc.getCastle().getOwner();
if (ownerClan != null)

View File

@@ -39,6 +39,7 @@ import com.l2jserver.gameserver.data.xml.impl.ClassListData;
import com.l2jserver.gameserver.data.xml.impl.SkillTreesData;
import com.l2jserver.gameserver.enums.CategoryType;
import com.l2jserver.gameserver.enums.Race;
import com.l2jserver.gameserver.enums.SubclassInfoType;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.base.ClassId;
@@ -54,6 +55,7 @@ import com.l2jserver.gameserver.model.events.impl.character.npc.OnNpcMenuSelect;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.SystemMessageId;
import com.l2jserver.gameserver.network.serverpackets.AcquireSkillList;
import com.l2jserver.gameserver.network.serverpackets.ExSubjobInfo;
import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
/**
@@ -152,6 +154,7 @@ public final class Raina extends AbstractNpcAI
case "33491-02.html":
case "33491-03.html":
case "33491-04.html":
case "33491-05.html":
case "reawakenCancel.html":
{
htmltext = event;
@@ -456,10 +459,10 @@ public final class Raina extends AbstractNpcAI
return;
}
final NpcHtmlMessage html = getNpcHtmlMessage(player, npc, "addSuccess.html");
player.setActiveClass(player.getTotalSubClasses());
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.NEW_SLOT_USED));
player.sendPacket(SystemMessageId.THE_NEW_SUBCLASS_HAS_BEEN_ADDED);
player.sendPacket(html);
player.sendPacket(getNpcHtmlMessage(player, npc, "addSuccess.html"));
break;
}
case 2: // Remove (change) subclass list
@@ -521,10 +524,8 @@ public final class Raina extends AbstractNpcAI
player.stopAllEffectsNotStayOnSubclassChange();
player.stopCubics();
player.setActiveClass(classIndex);
final NpcHtmlMessage html = getNpcHtmlMessage(player, npc, "addSuccess.html");
player.sendPacket(html);
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
player.sendPacket(getNpcHtmlMessage(player, npc, "addSuccess.html"));
player.sendPacket(SystemMessageId.THE_NEW_SUBCLASS_HAS_BEEN_ADDED);
}
break;
@@ -563,9 +564,8 @@ public final class Raina extends AbstractNpcAI
player.stopAllEffectsNotStayOnSubclassChange();
player.stopCubics();
player.setActiveClass(classIndex);
final NpcHtmlMessage html = getNpcHtmlMessage(player, npc, "reawakenSuccess.html");
player.sendPacket(html);
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
player.sendPacket(getNpcHtmlMessage(player, npc, "reawakenSuccess.html"));
SkillTreesData.getInstance().cleanSkillUponAwakening(player);
player.sendPacket(new AcquireSkillList(player));
player.sendSkillList();
@@ -589,10 +589,10 @@ public final class Raina extends AbstractNpcAI
if (player.addSubClass(classId, player.getTotalSubClasses() + 1, true))
{
final NpcHtmlMessage html = getNpcHtmlMessage(player, npc, "addSuccess.html");
player.setActiveClass(player.getTotalSubClasses());
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.NEW_SLOT_USED));
player.sendPacket(SystemMessageId.THE_NEW_SUBCLASS_HAS_BEEN_ADDED);
player.sendPacket(html);
player.sendPacket(getNpcHtmlMessage(player, npc, "addSuccess.html"));
SkillTreesData.getInstance().cleanSkillUponAwakening(player);
player.sendPacket(new AcquireSkillList(player));
player.sendSkillList();

View File

@@ -1,4 +1,4 @@
<html><body>Sirra:<br>
This is the way to the Ice Queen's Throne room, where she awaits. As I've told you, Freya is powerful beyond all comprehension and can destroy you with a mere thought. I keep telling other would-be heroes this, but they keep going anyway. It's actually getting rather fun. But I'm SURE you're different than they were! You shall succeed where they failed. Hahahaha...<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleNormalBattle openDoor">Open door</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleBattle openDoor">Open door</Button>
</body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Sirra:<br>
Beyond this door the Ice Queen Freya is making ice sculptures from foolish adventurers. You're not trying to join them, are you? Tsk tsk. The smart ones run screaming about now.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleNormalBattle portInside">I will go in.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleBattle portInside">I will go in.</Button>
</body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Sirra:<br>
This is the way to the Ice Queen's Throne room, where she awaits. As I've told you, Freya is powerful beyond all comprehension and can destroy you with a mere thought. I keep telling other would-be heroes this, but they keep going anyway. It's actually getting rather fun. But I'm SURE you're different than they were! You shall succeed where they failed. Hahahaha...<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleHardBattle openDoor">Open door</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleBattle openDoor">Open door</Button>
</body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Sirra:<br>
Beyond this door the Ice Queen Freya is making ice sculptures from foolish adventurers. You're not trying to join them, are you? Tsk tsk. The smart ones run screaming about now.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleHardBattle portInside">I will go in.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest IceQueensCastleBattle portInside">I will go in.</Button>
</body></html>

View File

@@ -23,11 +23,11 @@ import java.util.Map;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Fantasy Island teleport AI.
@@ -103,7 +103,7 @@ public final class TeleportToFantasy extends AbstractNpcAI
}
else
{
broadcastNpcSay(npc, Say2.ALL, 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);
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);
player.teleToLocation(RUNE_TOWNSHIP);
}
}

View File

@@ -23,11 +23,11 @@ import java.util.Map;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
/**
* Monster Derby Track teleport AI.
@@ -97,7 +97,7 @@ public final class TeleportToRaceTrack extends AbstractNpcAI
}
else
{
broadcastNpcSay(npc, Say2.ALL, 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);
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);
player.teleToLocation(DION_CASTLE_TOWN);
}
}

View File

@@ -1,87 +0,0 @@
/*
* Copyright (C) 2004-2015 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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.npc.TownPets;
import ai.npc.AbstractNpcAI;
import com.l2jserver.Config;
import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
/**
* Town Pets AI
* @author malyelfik
*/
public final class TownPets extends AbstractNpcAI
{
// Pet IDs
private static final int[] PETS =
{
31202, // Maximus
31203, // Moon Dancer
31204, // Georgio
31205, // Katz
31206, // Ten Ten
31207, // Sardinia
31208, // La Grange
31209, // Misty Rain
31266, // Kaiser
31593, // Dorothy
31758, // Rafi
31955, // Ruby
};
private TownPets()
{
super(TownPets.class.getSimpleName(), "ai/npc");
if (Config.ALLOW_PET_WALKERS)
{
addSpawnId(PETS);
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equalsIgnoreCase("move"))
{
final int locX = (npc.getSpawn().getX() - 50) + getRandom(100);
final int locY = (npc.getSpawn().getY() - 50) + getRandom(100);
npc.setRunning();
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(locX, locY, npc.getZ(), 0));
startQuestTimer("move", 5000, npc, null);
}
return null;
}
@Override
public String onSpawn(L2Npc npc)
{
startQuestTimer("move", 3000, npc, null);
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new TownPets();
}
}

View File

@@ -224,12 +224,6 @@ public final class Trandon extends AbstractNpcAI
{
htmltext = "33490-25.html";
}
else if ((player.getLevel() < DUAL_SKILL_LEVELS[0]) || (player.getStat().getBaseLevel() < DUAL_SKILL_LEVELS[0])) // Dual or main class level is lower than 85
{
// TODO: What happens here?
player.sendMessage("Your level is too low.");
htmltext = null;
}
break;
}
case "dualCertify":
@@ -335,7 +329,6 @@ public final class Trandon extends AbstractNpcAI
giveSkills(player, "DualSkillList");
}
giveSkills(player, "SubSkillList");
player.sendSkillList();
}
@RegisterEvent(EventType.ON_PLAYER_LOGIN)

View File

@@ -20,11 +20,11 @@ package ai.npc.WeaverOlf;
import ai.npc.AbstractNpcAI;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
/**
@@ -217,7 +217,7 @@ public final class WeaverOlf extends AbstractNpcAI
}
else
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), Say2.NPC_ALL, npc.getId(), NpcStringId.WHAT_A_PREDICAMENT_MY_ATTEMPTS_WERE_UNSUCCESSFUL));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.WHAT_A_PREDICAMENT_MY_ATTEMPTS_WERE_UNSUCCESSFUL));
}
}
else