From 413c65f63a9207b3fd22e5ec8aee391dd21ee2a1 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 7 May 2015 20:12:38 +0000 Subject: [PATCH] Fixed Tutorial quest Ant build problem. --- .../Q00255_Tutorial/Q00255_Tutorial.java | 27 +++++++++++++++++-- .../quests/Q00255_Tutorial/tutorial_01.html | 4 +++ .../Q00255_Tutorial/tutorial_01_ertheia.html | 4 +++ .../quests/Q00255_Tutorial/tutorial_02.html | 5 ++++ .../network/clientpackets/EnterWorld.java | 13 +++------ .../RequestTutorialClientEvent.java | 6 ++--- 6 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_01.html create mode 100644 trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_01_ertheia.html create mode 100644 trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_02.html diff --git a/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/Q00255_Tutorial.java b/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/Q00255_Tutorial.java index ed6a40e2c7..83ee91962b 100644 --- a/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/Q00255_Tutorial.java +++ b/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/Q00255_Tutorial.java @@ -18,13 +18,14 @@ */ package quests.Q00255_Tutorial; +import com.l2jserver.gameserver.enums.Race; import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.QuestState; /** - * Tutorial Quest (Placeholder) + * Tutorial Quest * @author Mobius */ public class Q00255_Tutorial extends Quest @@ -47,9 +48,31 @@ public class Q00255_Tutorial extends Quest String htmltext = null; switch (event) { + case "tutorial_02.html": + { + htmltext = event; + break; + } case "user_connected": { - // Do stuff on player login. + // Start Newbie Tutorial + if ((player.getLevel() < 6) && !qs.isCompleted()) + { + startQuestTimer("start_newbie_tutorial", 5000, null, player); + } + break; + } + case "start_newbie_tutorial": + { + if (player.getRace() == Race.ERTHEIA) + { + htmltext = "tutorial_01_ertheia.html"; + } + else + { + htmltext = "tutorial_01.html"; + } + qs.exitQuest(false, false); // TODO: Continue with the tutorial. break; } } diff --git a/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_01.html b/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_01.html new file mode 100644 index 0000000000..fb675a549c --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_01.html @@ -0,0 +1,4 @@ +Tutorial +We are inside the museum in Talking Island Village. It seems that curator Pantheon would like to speak with you. I will tell you how to use the mouse to move to Pantheon and speak with him.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_01_ertheia.html b/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_01_ertheia.html new file mode 100644 index 0000000000..d2f53a2667 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_01_ertheia.html @@ -0,0 +1,4 @@ +Tutorial +This is Faeron Village. Queen Navari has something to say. Please pay attention to the instructions on using the mouse in order to move.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_02.html b/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_02.html new file mode 100644 index 0000000000..ef4b9269f2 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q00255_Tutorial/tutorial_02.html @@ -0,0 +1,5 @@ +Tutorial +
[Movement]

+Move your mouse cursor to the spot to which you want to move and left-click. Then, you will be moved to that location.
+ + \ No newline at end of file diff --git a/trunk/java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java b/trunk/java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java index 1a9e44b058..6659b5d2b9 100644 --- a/trunk/java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java +++ b/trunk/java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java @@ -18,8 +18,6 @@ */ package com.l2jserver.gameserver.network.clientpackets; -import quests.Q00255_Tutorial.Q00255_Tutorial; - import com.l2jserver.Config; import com.l2jserver.gameserver.LoginServerThread; import com.l2jserver.gameserver.cache.HtmCache; @@ -431,7 +429,7 @@ public class EnterWorld extends L2GameClientPacket } } - if (Config.SERVER_CLASSIC_SUPPORT) + if (!Config.DISABLE_TUTORIAL) { loadTutorial(activeChar); } @@ -753,15 +751,10 @@ public class EnterWorld extends L2GameClientPacket private void loadTutorial(L2PcInstance player) { - if (Config.DISABLE_TUTORIAL) - { - return; - } - - QuestState qs = player.getQuestState(Q00255_Tutorial.class.getSimpleName()); + QuestState qs = player.getQuestState("Q00255_Tutorial"); if (qs == null) { - qs = QuestManager.getInstance().getQuest(Q00255_Tutorial.class.getSimpleName()).newQuestState(player); + qs = QuestManager.getInstance().getQuest("Q00255_Tutorial").newQuestState(player); qs.setState(State.STARTED); } qs.getQuest().notifyEvent("user_connected", null, player); diff --git a/trunk/java/com/l2jserver/gameserver/network/clientpackets/RequestTutorialClientEvent.java b/trunk/java/com/l2jserver/gameserver/network/clientpackets/RequestTutorialClientEvent.java index 9247487795..4e6c645fbd 100644 --- a/trunk/java/com/l2jserver/gameserver/network/clientpackets/RequestTutorialClientEvent.java +++ b/trunk/java/com/l2jserver/gameserver/network/clientpackets/RequestTutorialClientEvent.java @@ -18,8 +18,6 @@ */ package com.l2jserver.gameserver.network.clientpackets; -import quests.Q00255_Tutorial.Q00255_Tutorial; - import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.quest.QuestState; @@ -45,10 +43,10 @@ public class RequestTutorialClientEvent extends L2GameClientPacket return; } - QuestState qs = player.getQuestState(Q00255_Tutorial.class.getSimpleName()); + QuestState qs = player.getQuestState("Q00255_Tutorial"); if (qs != null) { - qs.getQuest().notifyEvent("CE" + eventId + "", null, player); + qs.getQuest().notifyEvent("CE" + eventId, null, player); } }