diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-01.htm b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-01.htm new file mode 100644 index 0000000000..3e19c44877 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-01.htm @@ -0,0 +1,4 @@ +Vorbos:
+YOu're here! Finally it's time to save her. I have both keys now.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-02.htm b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-02.htm new file mode 100644 index 0000000000..756fea3d44 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-02.htm @@ -0,0 +1,6 @@ +Vorbos:
+Want to go myself, but can't show ugly self in front of her or her people!
+And my kin locked the spirits. How could I go? +You help.
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-03.htm b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-03.htm new file mode 100644 index 0000000000..29ea1d7bc8 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-03.htm @@ -0,0 +1,7 @@ +Vorbos:
+Thanks you! You're first one who wanted to help. +I'm touched!
+Now go help spirits!
+I will give you keys. Go unshackle Captured Tree Spirits and Captured Wind Spirits and free them!
+And make sure no one can shackle spirits again by bringing 10 Broken Chains! + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-04.htm b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-04.htm new file mode 100644 index 0000000000..1e55f3fe27 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-04.htm @@ -0,0 +1,5 @@ +Vorbos:
+You're back. What happened?
+I trust you, but I was still worried!
+ + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-05.htm b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-05.htm new file mode 100644 index 0000000000..61e081feb5 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-05.htm @@ -0,0 +1,6 @@ +Vorbos:
+She is here! SHe came to ugly me! She came to me!
+My love has talked to me and thanked me.
+I can die happy now! I am happy! So long, hero! +You are my hero! + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-no.html b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-no.html new file mode 100644 index 0000000000..7d99f92331 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-no.html @@ -0,0 +1,3 @@ +Vorbos:
+This quest is only for Ertheia class. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-noLevel.html b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-noLevel.html new file mode 100644 index 0000000000..b26308bc58 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/33966-noLevel.html @@ -0,0 +1,3 @@ +Vorbos:
+Your level is wrong for this quest. + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/CapturedTree.html b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/CapturedTree.html new file mode 100644 index 0000000000..f270c4b3f3 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/CapturedTree.html @@ -0,0 +1,3 @@ +Captured Tree Spirit:
+I'm a tree spirit...Let me our of here. My freedom's...been...stolen from me...
+ \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/CapturedWind.html b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/CapturedWind.html new file mode 100644 index 0000000000..f8f24bbe14 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/CapturedWind.html @@ -0,0 +1,3 @@ +Captured Wind Spirit:
+I'm a wind spirit...Even as I look upon the sky, I cannot fly to it...I am no longer free...
+ \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/Q10764_FreeSpirit.java b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/Q10764_FreeSpirit.java new file mode 100644 index 0000000000..f8f73a5bd3 --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/Q10764_FreeSpirit.java @@ -0,0 +1,204 @@ +/* + * 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 . + */ +package quests.Q10764_FreeSpirit; + +import com.l2jmobius.gameserver.enums.ChatType; +import com.l2jmobius.gameserver.enums.QuestSound; +import com.l2jmobius.gameserver.enums.Race; +import com.l2jmobius.gameserver.model.actor.L2Npc; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.quest.Quest; +import com.l2jmobius.gameserver.model.quest.QuestState; +import com.l2jmobius.gameserver.network.NpcStringId; +import com.l2jmobius.gameserver.network.serverpackets.NpcSay; +import com.l2jmobius.gameserver.util.Broadcast; + +import quests.Q10763_TerrifyingChertuba.Q10763_TerrifyingChertuba; + +/** + * Free Spirit (10764) + * @author Gigi + */ +public class Q10764_FreeSpirit extends Quest +{ + // NPCs + private static final int VORBOS = 33966; + private static final int CAPTURED_TREE = 33964; + private static final int CAPTURED_WIND = 33965; + private static final int LIBERATED_WIND_SPIRIT = 33968; + private static final int LIBERATED_TREE_SPIRIT = 33969; + // Items + private static final int LOOSENED_CHAIN = 39518; + // Reward + private static final int STEEL_DOOR_GUILD = 37045; + // Other + private static final int MIN_LEVEL = 38; + + public Q10764_FreeSpirit() + { + super(10764, Q10764_FreeSpirit.class.getSimpleName(), "Free Spirit"); + addStartNpc(VORBOS); + addTalkId(VORBOS, CAPTURED_TREE, CAPTURED_WIND); + registerQuestItems(LOOSENED_CHAIN); + addCondRace(Race.ERTHEIA, "33966-no.html"); + addCondMinLevel(MIN_LEVEL, "33966-noLevel.html"); + addCondCompletedQuest(Q10763_TerrifyingChertuba.class.getSimpleName(), "restriction.html"); + } + + @Override + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) + { + final QuestState qs = getQuestState(player, false); + if (qs == null) + { + return null; + } + String htmltext = null; + switch (event) + { + case "start": + { + if (qs.isStarted() && qs.isCond(1)) + { + if (getQuestItemsCount(player, LOOSENED_CHAIN) < 10) + { + giveItems(player, LOOSENED_CHAIN, 1); + playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE); + npc.deleteMe(); + } + if (getQuestItemsCount(player, LOOSENED_CHAIN) >= 10) + { + qs.setCond(2); + } + } + break; + } + case "33966-02.htm": + { + htmltext = event; + break; + } + case "33966-03.htm": // start the quest + { + qs.startQuest(); + break; + } + case "33966-05.htm": + { + if (qs.isCond(2)) + { + takeItems(player, LOOSENED_CHAIN, -1); + giveItems(player, STEEL_DOOR_GUILD, 10); + addExpAndSp(player, 1312934, 315); + qs.exitQuest(false, true); + htmltext = event; + } + break; + } + } + return htmltext; + } + + @Override + public String onTalk(L2Npc npc, L2PcInstance player) + { + final QuestState qs = getQuestState(player, true); + String htmltext = null; + if (qs == null) + { + return htmltext; + } + if (player.getRace() != Race.ERTHEIA) + { + return "33966-no.html"; + } + + switch (npc.getId()) + { + case VORBOS: + { + if (qs.isCreated() && ((player.getLevel() >= MIN_LEVEL))) + { + htmltext = "33966-01.htm"; + } + else if (qs.isStarted()) + { + switch (qs.getCond()) + { + case 1: + { + htmltext = "33966-06.html"; + break; + } + case 2: + { + htmltext = "33966-04.htm"; + break; + } + } + } + else if (qs.isCompleted()) + { + htmltext = getAlreadyCompletedMsg(player); + } + break; + } + case CAPTURED_TREE: + { + if (qs.isStarted()) + { + htmltext = "33964-01.html"; + } + if (getQuestItemsCount(player, LOOSENED_CHAIN) < 10) + { + final L2Npc spirit = addSpawn(LIBERATED_TREE_SPIRIT, npc.getX() + 20, npc.getY() + 20, npc.getZ(), npc.getHeading(), false, 5000); + Broadcast.toKnownPlayers(spirit, new NpcSay(spirit.getObjectId(), ChatType.NPC_GENERAL, spirit.getId(), NpcStringId.THANK_YOU_THANK_YOU_FOR_HELPING)); + giveItems(player, LOOSENED_CHAIN, 1); + playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE); + npc.deleteMe(); + } + if (getQuestItemsCount(player, LOOSENED_CHAIN) >= 10) + { + qs.setCond(2); + } + break; + } + case CAPTURED_WIND: + { + if (qs.isStarted()) + { + htmltext = "33965-01.html"; + } + if (getQuestItemsCount(player, LOOSENED_CHAIN) < 10) + { + addSpawn(LIBERATED_WIND_SPIRIT, npc.getX() + 20, npc.getY() + 20, npc.getZ(), npc.getHeading(), false, 5000); + Broadcast.toKnownPlayers(npc, new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getTemplate().getDisplayId(), NpcStringId.THANK_YOU_THANK_YOU_FOR_HELPING)); + giveItems(player, LOOSENED_CHAIN, 1); + playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE); + npc.deleteMe(); + } + if (getQuestItemsCount(player, LOOSENED_CHAIN) >= 10) + { + qs.setCond(2); + } + break; + } + } + + return htmltext; + } +} \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/restriction.html b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/restriction.html new file mode 100644 index 0000000000..c806262b3f --- /dev/null +++ b/trunk/dist/game/data/scripts/quests/Q10764_FreeSpirit/restriction.html @@ -0,0 +1,3 @@ +Vorbos:
+(Quest only available to Ertheia characters Lv. 38 or above who have completed the quest "Terrifying Chertuba.") + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/quests/QuestMasterHandler.java b/trunk/dist/game/data/scripts/quests/QuestMasterHandler.java index b96a7e1e0e..b2bc877f7e 100644 --- a/trunk/dist/game/data/scripts/quests/QuestMasterHandler.java +++ b/trunk/dist/game/data/scripts/quests/QuestMasterHandler.java @@ -260,6 +260,7 @@ import quests.Q10760_LettersFromTheQueen_OrcBarracs.Q10760_LettersFromTheQueen_O import quests.Q10761_AnOrcInLove.Q10761_AnOrcInLove; import quests.Q10762_MarionetteSpirit.Q10762_MarionetteSpirit; import quests.Q10763_TerrifyingChertuba.Q10763_TerrifyingChertuba; +import quests.Q10764_FreeSpirit.Q10764_FreeSpirit; /** * @author NosBit @@ -510,7 +511,8 @@ public class QuestMasterHandler Q10760_LettersFromTheQueen_OrcBarracs.class, Q10761_AnOrcInLove.class, Q10762_MarionetteSpirit.class, - Q10763_TerrifyingChertuba.class + Q10763_TerrifyingChertuba.class, + Q10764_FreeSpirit.class }; public static void main(String[] args)