Skip to content
Snippets Groups Projects
Commit b466511f authored by malyelfik's avatar malyelfik
Browse files

BETA: '''Sword of Solidarity''' (101) in Java

Patch by: xban1x
Reviewed by: jurchiks, malyelfik
parent d9db56db
No related branches found
No related tags found
No related merge requests found
Showing
with 331 additions and 2 deletions
<html><body>Blacksmith Altran:<br>
Oh! This is Roien's letter! Thank you!<br>It was a dwarf like me that forged the Sword of Solidarity that's found in the history books, wasn't it? I wonder how a sword that my ancestor made one thousand years ago looked. If I could find the broken sword blade, I'm sure I could remake the Sword of Solidarity in its original form... I'd appreciate it if you could find that broken sword blade for me. Am I asking for too much?<br>
<a action="bypass -h Quest Q00101_SwordOfSolidarity 30283-02.html">Say that you will look for the broken sword blade.</a>
</body></html>
\ No newline at end of file
<html><body>Blacksmith Altran:<br>
According to Roien's research, the blade was broken in half. I think they're somewhere in the Elven Ruins. Or maybe <font color="LEVEL">those dirty orcs who live in the ruins have gotten their paws on them...</font> Those orcs don't know how to handle metal, so they won't be able to reforge the broken pieces into one blade. They're probably using them to peel rabbit skins or something like that.<br>
Go to the <font color="LEVEL">Elven Ruins</font> and find <font color="LEVEL">the two broken sword blade pieces.</font> In case you don't know how to get into the ruins, I'll write it down for you in this note. Be careful! Orcs aren't the worst of the dangers in those ruins.
</body></html>
\ No newline at end of file
<html><body>Blacksmith Altran:<br>
If you still have trouble finding the Elven Ruins after looking at my note, go and ask Guard Kenyos. Once you find the two broken sword blade pieces, bring them to me.
</body></html>
\ No newline at end of file
<html><body>Blacksmith Altran:<br>
You found them! Hmm. Now I have to make these two sword blade pieces into one. It might take some time. While I take care of this, go meet with <font color="LEVEL">Roien.</font> I'll give you a note for him, asking for the sword handle. Go, bring it to him.</font>
</body></html>
\ No newline at end of file
<html><body>Blacksmith Altran:<br>
So this is the sword handle. While you were visiting the training hall, I managed to attach the broken blade fragments together. All I have to do now is attach the handle ... Would you wait a moment?<br>
<a action="bypass -h Quest 101_SwordOfSolidarity 30283-07.htm">Wait until Altran finishes his task</a>
<a action="bypass -h Quest Q00101_SwordOfSolidarity 30283-07.html">Wait until Altran finishes his task</a>
</body></html>
\ No newline at end of file
<html><body>Blacksmith Altran:<br>
Ta da, it's finished! This is the legendary<font color="LEVEL"> Sword of Solidarity</font>. Isn't it beautiful? The blade has been crafted of mithril and hasn't lost its sharpness yet!<br>
Ta da, it's finished! This is the legendary <font color="LEVEL">Sword of Solidarity</font>. Isn't it beautiful? The blade has been crafted of Mithril and hasn't lost its sharpness yet!<br>
As my ancestors created this Sword of Solidarity for the Humans of this island a thousand years ago, I will now present you with this sword. Please do not refuse, and accept it as a gift. For your information, Dwarves are happiest when the weapons they create have been placed in the hands of a skilled user. The way I see it, you are qualified to receive this sword.<br>
I hope that you will perform a mighty deed appropriate for a sword with such a great history. And if anyone should ask, tell them that Blacksmith Altran reconstructed this sword! May the grace of Maphr be with you!
</body></html>
\ No newline at end of file
/*
* Copyright (C) 2004-2013 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 quests.Q00101_SwordOfSolidarity;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.base.ClassId;
import com.l2jserver.gameserver.model.base.Race;
import com.l2jserver.gameserver.model.holders.ItemHolder;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;
import com.l2jserver.gameserver.network.NpcStringId;
/**
* Sword of Solidarity (101)
* @author xban1x
*/
public class Q00101_SwordOfSolidarity extends Quest
{
// NPCs
private static final int ROIEN = 30008;
private static final int ALTRAN = 30283;
// Items
private static final int BROKEN_SWORD_HANDLE = 739;
private static final int BROKEN_BLADE_BOTTOM = 740;
private static final int BROKEN_BLADE_TOP = 741;
private static final int ALTRANS_NOTE = 742;
private static final int ROIENS_LETTER = 796;
private static final int DIRECTIONS_TO_RUINS = 937;
// Monsters
private static final int[] MONSTERS =
{
20361, // Tunath Orc Marksman
20362, // Tunath Orc Warrior
};
// Rewards
private static final int SOULSHOT_NO_GRADE = 5789;
private static final ItemHolder[] REWARDS =
{
new ItemHolder(738, 1), // Sword of Solidarity
new ItemHolder(1060, 100), // Lesser Healing Potion
new ItemHolder(4412, 10), // Echo Crystal - Theme of Battle
new ItemHolder(4413, 10), // Echo Crystal - Theme of Love
new ItemHolder(4414, 10), // Echo Crystal - Theme of Solitude
new ItemHolder(4415, 10), // Echo Crystal - Theme of Feast
new ItemHolder(4416, 10), // Echo Crystal - Theme of Celebration
};
// Misc
private static final int MIN_LVL = 9;
private Q00101_SwordOfSolidarity(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(ROIEN);
addKillId(MONSTERS);
addTalkId(ROIEN, ALTRAN);
registerQuestItems(BROKEN_SWORD_HANDLE, BROKEN_BLADE_BOTTOM, BROKEN_BLADE_TOP, ALTRANS_NOTE, ROIENS_LETTER, DIRECTIONS_TO_RUINS);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState st = player.getQuestState(getName());
String htmltext = null;
if (st != null)
{
switch (event)
{
case "30008-03.html":
case "30008-09.html":
{
htmltext = event;
break;
}
case "30008-04.htm":
{
st.startQuest();
st.giveItems(ROIENS_LETTER, 1);
htmltext = event;
break;
}
case "30283-02.html":
{
if (st.isCond(1) && st.hasQuestItems(ROIENS_LETTER))
{
st.takeItems(ROIENS_LETTER, -1);
st.giveItems(DIRECTIONS_TO_RUINS, 1);
st.setCond(2, true);
htmltext = event;
}
break;
}
case "30283-07.html":
{
if (st.isCond(5) && st.hasQuestItems(BROKEN_SWORD_HANDLE))
{
if ((player.getLevel() < 25) && (player.getClassId() == ClassId.fighter))
{
st.rewardItems(SOULSHOT_NO_GRADE, 7000);
st.playTutorialVoice("tutorial_voice_026");
}
for (ItemHolder reward : REWARDS)
{
st.giveItems(reward);
}
st.addExpAndSp(25747, 2171);
st.giveAdena(10981, true);
st.exitQuest(false, true);
// TODO: Newbie Guide
showOnScreenMsg(player, NpcStringId.ACQUISITION_OF_RACE_SPECIFIC_WEAPON_COMPLETE_N_GO_FIND_THE_NEWBIE_GUIDE, 2, 5000);
htmltext = event;
}
break;
}
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState st = killer.getQuestState(getName());
if ((st != null) && st.isCond(2) && (getRandom(5) == 0))
{
if (!st.hasQuestItems(BROKEN_BLADE_TOP))
{
st.giveItems(BROKEN_BLADE_TOP, 1);
if (st.hasQuestItems(BROKEN_BLADE_BOTTOM))
{
st.setCond(3, true);
}
else
{
st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
else if (!st.hasQuestItems(BROKEN_BLADE_BOTTOM))
{
st.giveItems(BROKEN_BLADE_BOTTOM, 1);
if (st.hasQuestItems(BROKEN_BLADE_TOP))
{
st.setCond(3, true);
}
else
{
st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState st = player.getQuestState(getName());
String htmltext = getNoQuestMsg(player);
if (st != null)
{
switch (npc.getNpcId())
{
case ROIEN:
{
switch (st.getState())
{
case State.CREATED:
{
htmltext = (player.getRace() == Race.Human) ? (player.getLevel() >= MIN_LVL) ? "30008-02.htm" : "30008-08.htm" : "30008-01.htm";
break;
}
case State.STARTED:
{
switch (st.getCond())
{
case 1:
{
if (st.hasQuestItems(ROIENS_LETTER))
{
htmltext = "30008-05.html";
}
break;
}
case 2:
{
if (hasAtLeastOneQuestItem(player, BROKEN_BLADE_BOTTOM, BROKEN_BLADE_TOP))
{
htmltext = "30008-11.html";
}
else if (st.hasQuestItems(DIRECTIONS_TO_RUINS))
{
htmltext = "30008-10.html";
}
break;
}
case 3:
{
if (st.hasQuestItems(BROKEN_BLADE_BOTTOM, BROKEN_BLADE_TOP))
{
htmltext = "30008-12.html";
}
break;
}
case 4:
{
if (st.hasQuestItems(ALTRANS_NOTE))
{
st.takeItems(ALTRANS_NOTE, -1);
st.giveItems(BROKEN_SWORD_HANDLE, 1);
st.setCond(5, true);
htmltext = "30008-06.html";
}
break;
}
case 5:
{
if (st.hasQuestItems(BROKEN_SWORD_HANDLE))
{
htmltext = "30008-07.html";
}
break;
}
}
break;
}
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(player);
break;
}
}
break;
}
case ALTRAN:
{
switch (st.getCond())
{
case 1:
{
if (st.hasQuestItems(ROIENS_LETTER))
{
htmltext = "30283-01.html";
}
break;
}
case 2:
{
if (hasAtLeastOneQuestItem(player, BROKEN_BLADE_BOTTOM, BROKEN_BLADE_TOP))
{
htmltext = "30008-08.html";
}
else if (st.hasQuestItems(DIRECTIONS_TO_RUINS))
{
htmltext = "30283-03.html";
}
break;
}
case 3:
{
if (st.hasQuestItems(BROKEN_BLADE_BOTTOM, BROKEN_BLADE_TOP))
{
takeItems(player, -1, DIRECTIONS_TO_RUINS, BROKEN_BLADE_TOP, BROKEN_BLADE_BOTTOM);
st.giveItems(ALTRANS_NOTE, 1);
st.setCond(4, true);
htmltext = "30283-04.html";
}
break;
}
case 4:
{
if (st.hasQuestItems(ALTRANS_NOTE))
{
htmltext = "30283-05.html";
}
break;
}
case 5:
{
if (st.hasQuestItems(BROKEN_SWORD_HANDLE))
{
htmltext = "30283-06.html";
}
break;
}
}
break;
}
}
}
return htmltext;
}
public static void main(String[] args)
{
new Q00101_SwordOfSolidarity(101, Q00101_SwordOfSolidarity.class.getSimpleName(), "Sword of Solidarity");
}
}
\ No newline at end of file
UPDATE character_quests SET name='Q00101_SwordOfSolidarity' WHERE name='101_SwordOfSolidarity';
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment