Skip to content
Snippets Groups Projects
Commit 4588b3ed authored by Adry_85's avatar Adry_85
Browse files

BETA: Retail like quest '''Devil's Legacy''' (365).

	Reviewed by: jurchiks
	Thanks to: jurchiks, !UnAfraid
parent cc01825d
No related branches found
No related tags found
No related merge requests found
Showing
with 315 additions and 100 deletions
......@@ -489,7 +489,7 @@ quests/Q00360_PlunderTheirSupplies/Q00360_PlunderTheirSupplies.java
quests/362_BardsMandolin/__init__.py
quests/363_SorrowfulSoundofFlute/__init__.py
quests/364_JovialAccordion/__init__.py
quests/365_DevilsLegacy/__init__.py
quests/Q00365_DevilsLegacy/Q00365_DevilsLegacy.java
quests/366_SilverHairedShaman/__init__.py
quests/367_ElectrifyingRecharge/__init__.py
quests/368_TrespassingIntoTheSacredArea/__init__.py
......
<html><body>Warehouse Keeper Randolf:<br>
Have you heard of the notorius pirate Zaken? His dogged pursuit of<font color="LEVEL"> treasure</font> led him to a rockly island now called "Devil's Isle". His increasingly eccentric behavior caused him to lose the confidence of his crew, and they marooned him there.<br>
In despair, Zaken turned to the forces of darkness, who gave him power to kill and imprison the souls of all of those who betrayed him. Even now, the souls of thise damned warriors roam that barren place.<br>
I suppose you knew this already. But here is something you probably don't know... It is said that<font color="LEVEL"> Zaken's treasure was stolen by his betrayers</font>, and they still have it! So what do you think? Will you help me find the treasure?<br>
<font color="LEVEL">(Quest for characters level 39 and above)</font>
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Randolf:<br>
Go to<font color="LEVEL"> Devil's Isle</font>, slay the<font color="LEVEL"> pirate zombies and their captains</font>, collect their<font color="LEVEL"> Treasure Chests</font> and bring them to me. You will be well rewarded.<br>
<a action="bypass -h Quest 365_DevilsLegacy 30095-6.htm">I quit.</a><br>
<a action="bypass -h Quest 365_DevilsLegacy 30095-3.htm">I will do it.</a>
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Randolf:<br>
Do you have some Treasure Chests for me?<br>
<a action="bypass -h Quest 365_DevilsLegacy 30095-5.htm">Here they are.</a>
</body></html>
\ No newline at end of file
# Made by disKret
import sys
from com.l2jserver.gameserver.model.quest import State
from com.l2jserver.gameserver.model.quest import QuestState
from com.l2jserver.gameserver.model.quest import Quest as JQuest
qn = "365_DevilsLegacy"
#NPC
RANDOLF = 30095
#MOBS
MOBS=[20836,29027,20845,21629,21630,29026]
#CHANCE OF DROP
CHANCE_OF_DROP = 20
#ITEMS
TREASURE_CHEST = 5873
class Quest (JQuest) :
def __init__(self,id,name,descr):
JQuest.__init__(self,id,name,descr)
self.questItemIds = [TREASURE_CHEST]
def onEvent (self,event,st) :
htmltext = event
if event == "30095-1.htm" :
st.set("cond","1")
st.setState(State.STARTED)
st.playSound("ItemSound.quest_accept")
elif event == "30095-5.htm" :
count = st.getQuestItemsCount(TREASURE_CHEST)
if count :
reward = (count*1600)
st.takeItems(TREASURE_CHEST,-1)
st.giveItems(57,reward)
else:
htmltext="You don't have required items"
elif event == "30095-6.htm" :
st.playSound("ItemSound.quest_finish")
st.exitQuest(1)
return htmltext
def onTalk (self,npc,player):
htmltext = Quest.getNoQuestMsg(player)
st = player.getQuestState(qn)
if not st : return htmltext
npcId = npc.getId()
id = st.getState()
cond=st.getInt("cond")
if cond == 0 :
if player.getLevel() >= 39 :
htmltext = "30095-0.htm"
else :
htmltext = "30095-0a.htm"
st.exitQuest(1)
elif cond == 1 :
if not st.getQuestItemsCount(TREASURE_CHEST) :
htmltext = "30095-2.htm"
else :
htmltext = "30095-4.htm"
return htmltext
def onKill(self,npc,player,isPet):
partyMember = self.getRandomPartyMemberState(player,State.STARTED)
if not partyMember : return
st = partyMember.getQuestState(qn)
chance = self.getRandom(100)
if chance < CHANCE_OF_DROP :
st.giveItems(TREASURE_CHEST,1)
st.playSound("ItemSound.quest_itemget")
return
QUEST = Quest(365,qn,"Devil's Legacy")
QUEST.addStartNpc(RANDOLF)
QUEST.addTalkId(RANDOLF)
for mob in MOBS:
QUEST.addKillId(mob)
\ No newline at end of file
<html><body>Warehouse Keeper Collob:<br>
Are you collecting <font color="LEVEL">Pirate's Treasure Chests</font>? Bring me one and I'll open it for you. All I ask is that you pay for making the key. <font color="LEVEL">It costs 600 adena.</font><br>
However, you should know that this chest carries a curse. <font color="LEVEL">You must be willing to risk receiving the curse. </font><br>
<a action="bypass -h Quest Q00365_DevilsLegacy REWARD">"Open the chest."</a>
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Collob:<br>
Hmm, you no longer have a chest. Please, go get one and come back.
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Collob:<br>
You don't have the adena needed to pay for the key.<br>
The key that will open the chest costs 600 adena.
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Collob:<br>
I'm afraid the curse is having an effect on me. Perhaps if I rest I'll feel better. I'm going to bed. Please come back later.<br>
Why don't you go to Devil's Isle and collect a few more Treasure Chests?
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Collob:<br>
The chest is open. Are you pleased with its contents?
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Collob:<br>
The chest is open.<br>
Oh no!! The curse of the pirates! I can't move...!
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Collob:<br>
I'm afraid the curse is having an effect on me. Perhaps if I rest I'll feel better. I'm going to bed. Please come back later.<br>
Why don't you go to Devil's Isle and collect a few more Treasure Chests?
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Randolf:<br>
Have you heard of the notorius pirate Zaken? His dogged pursuit of<font color="LEVEL"> treasure</font> led him to a rockly island now called "Devil's Isle". His increasingly eccentric behavior caused him to lose the confidence of his crew, and they marooned him there.<br>
In despair, Zaken turned to the forces of darkness, who gave him power to kill and imprison the souls of all of those who betrayed him. Even now, the souls of thise damned warriors roam that barren place.<br>
I suppose you knew this already. But here is something you probably don't know... It is said that<font color="LEVEL"> Zaken's treasure was stolen by his betrayers</font>, and they still have it! So what do you think? Will you help me find the treasure?<br>
<a action="bypass -h Quest 365_DevilsLegacy 30095-1.htm">I will help.</a>
Have you heard of the notorious Pirate Captain Zaken? His dogged pursuit of <font color="LEVEL">treasure</font> led him to a rocky island now called "Devil's Isle." His increasingly eccentric behavior caused him to lose the confidence of his crew, and they marooned him there.<br>
In despair, Zaken turned to the forces of darkness, who gave him the power to kill and imprison the souls of all of those who betrayed him. Even now, the souls of those damned warriors roam that barren place.<br>
I suppose you knew this already. But here is something you probably don't know... It is said that <font color="LEVEL">Zaken's treasure was stolen by his betrayers</font>, and they still have it! So what do you think? Will you help me find the treasure?<br>
<a action="bypass -h Quest Q00365_DevilsLegacy 30095-02.html">"I will help."</a>
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Randolf:<br>
Good choice! We will both benefit from our arrangement...<br>
Go to<font color="LEVEL"> Devil's Isle</font>, slay the<font color="LEVEL"> pirate zombies and their captains</font>, collect their<font color="LEVEL"> Treasure Chests</font> and bring them to me. You shall be well rewarded.
Go to <font color="LEVEL">Devil's Isle</font>, slay the <font color="LEVEL">pirate zombies and their captains</font>, collect their <font color="LEVEL">Treasure Chests</font> and bring them to me. You shall be well rewarded.
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Randolf:<br>
Have you heard of the notorious Pirate Captain Zaken? His dogged pursuit of <font color="LEVEL">treasure</font> led him to a rocky island now called "Devil's Isle." His increasingly eccentric behavior caused him to lose the confidence of his crew, and they marooned him there.<br>
In despair, Zaken turned to the forces of darkness, who gave him the power to kill and imprison the souls of all of those who betrayed him. Even now, the souls of those damned warriors roam that barren place.<br>
There is more you should know, but you are not yet ready.<br>
(This quest may only be undertaken by a character of level 39 or above.)
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Randolf:<br>
Good job! You shall have your reward.<br>
I hope you don't feel that you've been cheated. Not all the chests hold treasure, but the key required to open them is very expensive. Not to mention the magical scroll I must buy to protect against the horrible pirate curse that these chests sometimes impart. Truly, I take a terrible risk each time I open one. This is not a highly profitable business.<br>
You should be happy to get your reward regardless of whether or not the chests hold treasure. I hope we can continue to do business together. Don't be fooled by<font color="LEVEL"> Collob</font>. He will probably offer to open the chests for you. His lack of experience could lead to terrible consequences...<br>
<a action="bypass -h Quest 365_DevilsLegacy 30095-6.htm">I quit</a><br>
<a action="bypass -h Quest 365_DevilsLegacy 30095-3.htm">I will continue to work with you.</a>
You should be happy to get your reward regardless of whether or not the chests hold treasure. I hope we can continue to do business together. Don't be fooled by <font color="LEVEL">Collob</font>. He will probably offer to open the chests for you. His lack of experience could lead to terrible consequences...<br>
<a action="bypass -h Quest Q00365_DevilsLegacy 30095-05.html">"I quit."</a><br>
<a action="bypass -h Quest Q00365_DevilsLegacy 30095-06.html">"I will continue to work with you."</a>
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Randolf:<br>
Go to Devil's Isle, slay the pirate zombies and their captains, collect their Treasure Chests and bring them to me.
Go to Devil's Isle, slay the pirate zombies and their captains, and bring back their Treasure Chests.
</body></html>
\ No newline at end of file
<html><body>Warehouse Keeper Randolf:<br>
Go to <font color="LEVEL">Devil's Isle</font>, slay the <font color="LEVEL">pirate zombies and their captains</font>, collect their <font color="LEVEL">Treasure Chests </font> and bring them to me. You will be well rewarded.<br>
<a action="bypass -h Quest Q00365_DevilsLegacy 30095-05.html">"I quit."</a><br>
<a action="bypass -h Quest Q00365_DevilsLegacy 30095-06.html">"I will do it."</a>
</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.Q00365_DevilsLegacy;
import java.util.HashMap;
import java.util.Map;
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.model.itemcontainer.PcInventory;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
/**
* Devil's Legacy (365)
* @author Adry_85
*/
public final class Q00365_DevilsLegacy extends Quest
{
// NPCs
private static final int COLLOB = 30092;
private static final int RANDOLF = 30095;
// Item
private static final int PIRATES_TREASURE_CHEST = 5873;
// Rewards
private static final int ENCHANT_WEAPON_C = 951;
private static final int ENCHANT_ARMOR_C = 952;
private static final int ENCHANT_WEAPON_D = 955;
private static final int ENCHANT_ARMOR_D = 956;
private static final int THREAD = 1868;
private static final int ANIMAL_BONE = 1872;
private static final int COKES = 1879;
private static final int STEEL = 1880;
private static final int COARSE_BONE_POWDER = 1881;
private static final int LEATHER = 1882;
private static final int CORD = 1884;
// Misc
private static final int MIN_LEVEL = 39;
// Skill
private static SkillHolder POISON = new SkillHolder(4035, 2);
// Mobs
private static final Map<Integer, Double> MOBS = new HashMap<>();
static
{
MOBS.put(20836, 0.47); // pirates_zombie
MOBS.put(20845, 0.40); // pirates_zombie_captain
MOBS.put(21629, 0.40); // pirates_zombie_captain_1
MOBS.put(21630, 0.40); // pirates_zombie_captain_2
}
private Q00365_DevilsLegacy()
{
super(365, Q00365_DevilsLegacy.class.getSimpleName(), "Devil's Legacy");
addStartNpc(RANDOLF);
addTalkId(RANDOLF, COLLOB);
addKillId(MOBS.keySet());
registerQuestItems(PIRATES_TREASURE_CHEST);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState st = player.getQuestState(getName());
if (st == null)
{
return null;
}
String htmltext = null;
switch (event)
{
case "30095-02.html":
{
st.startQuest();
st.setMemoState(1);
htmltext = event;
break;
}
case "30095-05.html":
{
st.exitQuest(true, true);
htmltext = event;
break;
}
case "30095-06.html":
{
htmltext = event;
break;
}
case "REWARD":
{
if (!st.isMemoState(1))
{
htmltext = "30092-04.html";
}
else if (!st.hasQuestItems(PIRATES_TREASURE_CHEST))
{
htmltext = "30092-02.html";
}
else if (player.getAdena() < 600)
{
htmltext = "30092-03.html";
}
else
{
final int itemId;
final int chance;
if (getRandom(100) < 80)
{
chance = getRandom(100);
if (chance < 1)
{
itemId = ENCHANT_WEAPON_D;
}
else if (chance < 4)
{
itemId = ENCHANT_ARMOR_D;
}
else if (chance < 36)
{
itemId = THREAD;
}
else if (chance < 68)
{
itemId = CORD;
}
else
{
itemId = ANIMAL_BONE;
}
htmltext = "30092-05.html";
}
else
{
chance = getRandom(1000);
if (chance < 10)
{
itemId = ENCHANT_WEAPON_C;
}
else if (chance < 40)
{
itemId = ENCHANT_ARMOR_C;
}
else if (chance < 60)
{
itemId = ENCHANT_WEAPON_D;
}
else if (chance < 260)
{
itemId = ENCHANT_ARMOR_D;
}
else if (chance < 445)
{
itemId = COKES;
}
else if (chance < 630)
{
itemId = STEEL;
}
else if (chance < 815)
{
itemId = LEATHER;
}
else
{
itemId = COARSE_BONE_POWDER;
}
npc.setTarget(player);
npc.doCast(POISON.getSkill());
npc.setCurrentMp(npc.getMaxMp());
st.setMemoState(2);
htmltext = "30092-06.html";
}
takeItems(player, PIRATES_TREASURE_CHEST, 1);
takeItems(player, PcInventory.ADENA_ID, 600);
rewardItems(player, itemId, 1);
}
break;
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
final QuestState st = getRandomPartyMemberState(player, -1, 3, npc);
if (st != null)
{
giveItemRandomly(player, npc, PIRATES_TREASURE_CHEST, 1, 0, MOBS.get(npc.getId()), true);
}
return super.onKill(npc, player, isSummon);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
QuestState st = player.getQuestState(getName());
String htmltext = getNoQuestMsg(player);
if (st == null)
{
return htmltext;
}
switch (npc.getId())
{
case RANDOLF:
{
if (st.isCreated())
{
htmltext = ((player.getLevel() >= MIN_LEVEL) ? "30095-01.htm" : "30095-03.html");
}
else if (st.isStarted())
{
if (hasQuestItems(player, PIRATES_TREASURE_CHEST))
{
final long chestCount = getQuestItemsCount(player, PIRATES_TREASURE_CHEST);
giveAdena(player, (chestCount * 400) + 19800, true);
takeItems(player, PIRATES_TREASURE_CHEST, -1);
htmltext = "30095-04.html";
}
else
{
htmltext = "30095-07.html";
}
}
break;
}
case COLLOB:
{
if (st.isStarted())
{
htmltext = (st.isMemoState(1) ? "30092-01.html" : "30092-07.html");
}
break;
}
}
return htmltext;
}
public static void main(String args[])
{
new Q00365_DevilsLegacy();
}
}
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