|
@@ -28,7 +28,6 @@ import com.l2jserver.gameserver.model.quest.State;
|
|
*/
|
|
*/
|
|
public class Q00052_WilliesSpecialBait extends Quest
|
|
public class Q00052_WilliesSpecialBait extends Quest
|
|
{
|
|
{
|
|
-
|
|
|
|
// NPCs
|
|
// NPCs
|
|
private static final int WILLIE = 31574;
|
|
private static final int WILLIE = 31574;
|
|
private static final int TARLK_BASILISK = 20573;
|
|
private static final int TARLK_BASILISK = 20573;
|
|
@@ -40,28 +39,25 @@ public class Q00052_WilliesSpecialBait extends Quest
|
|
@Override
|
|
@Override
|
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
|
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
|
|
{
|
|
{
|
|
- String htmltext = event;
|
|
|
|
- final QuestState st = player.getQuestState(getName());
|
|
|
|
|
|
+ QuestState st = player.getQuestState(getName());
|
|
if (st == null)
|
|
if (st == null)
|
|
{
|
|
{
|
|
- return htmltext;
|
|
|
|
|
|
+ return getNoQuestMsg(player);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String htmltext = event;
|
|
|
|
+
|
|
switch (event)
|
|
switch (event)
|
|
{
|
|
{
|
|
case "31574-03.htm":
|
|
case "31574-03.htm":
|
|
- st.set("cond", "1");
|
|
|
|
- st.setState(State.STARTED);
|
|
|
|
- st.playSound("ItemSound.quest_accept");
|
|
|
|
|
|
+ st.startQuest();
|
|
break;
|
|
break;
|
|
case "31574-07.html":
|
|
case "31574-07.html":
|
|
- if ((st.getInt("cond") == 2) && (st.getQuestItemsCount(TARLK_EYE) >= 100))
|
|
|
|
|
|
+ if (st.isCond(2) && (st.getQuestItemsCount(TARLK_EYE) >= 100))
|
|
{
|
|
{
|
|
htmltext = "31574-06.htm";
|
|
htmltext = "31574-06.htm";
|
|
st.giveItems(EARTH_FISHING_LURE, 4);
|
|
st.giveItems(EARTH_FISHING_LURE, 4);
|
|
- st.takeItems(TARLK_EYE, -1);
|
|
|
|
- st.playSound("ItemSound.quest_finish");
|
|
|
|
- st.exitQuest(false);
|
|
|
|
|
|
+ st.exitQuest(false, true);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -87,7 +83,7 @@ public class Q00052_WilliesSpecialBait extends Quest
|
|
htmltext = (player.getLevel() >= 48) ? "31574-01.htm" : "31574-02.html";
|
|
htmltext = (player.getLevel() >= 48) ? "31574-01.htm" : "31574-02.html";
|
|
break;
|
|
break;
|
|
case State.STARTED:
|
|
case State.STARTED:
|
|
- htmltext = (st.getInt("cond") == 1) ? "31574-04.html" : "31574-05.html";
|
|
|
|
|
|
+ htmltext = (st.isCond(1)) ? "31574-05.html" : "31574-04.html";
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
return htmltext;
|
|
return htmltext;
|
|
@@ -103,36 +99,21 @@ public class Q00052_WilliesSpecialBait extends Quest
|
|
}
|
|
}
|
|
|
|
|
|
final QuestState st = partyMember.getQuestState(getName());
|
|
final QuestState st = partyMember.getQuestState(getName());
|
|
- if (st == null)
|
|
|
|
- {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
|
|
|
|
- final long count = st.getQuestItemsCount(TARLK_EYE);
|
|
|
|
- if ((st.getInt("cond") == 1) && (count < 100))
|
|
|
|
|
|
+ if (st.getQuestItemsCount(TARLK_EYE) < 100)
|
|
{
|
|
{
|
|
- float chance = 33 * Config.RATE_QUEST_DROP;
|
|
|
|
- float numItems = chance / 100;
|
|
|
|
- chance = chance % 100;
|
|
|
|
-
|
|
|
|
|
|
+ float chance = (33 * Config.RATE_QUEST_DROP) % 100;
|
|
if (getRandom(100) < chance)
|
|
if (getRandom(100) < chance)
|
|
{
|
|
{
|
|
- numItems += 1;
|
|
|
|
- }
|
|
|
|
- if (numItems > 0)
|
|
|
|
- {
|
|
|
|
- if ((count + numItems) >= 100)
|
|
|
|
- {
|
|
|
|
- numItems = 100 - count;
|
|
|
|
- }
|
|
|
|
- st.set("cond", "2");
|
|
|
|
- st.playSound("ItemSound.quest_middle");
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
|
|
+ st.rewardItems(TARLK_EYE, 1);
|
|
st.playSound("ItemSound.quest_itemget");
|
|
st.playSound("ItemSound.quest_itemget");
|
|
}
|
|
}
|
|
- st.giveItems(TARLK_EYE, (int) numItems);
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (st.getQuestItemsCount(TARLK_EYE) >= 100)
|
|
|
|
+ {
|
|
|
|
+ st.setCond(2, true);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
return super.onKill(npc, player, isPet);
|
|
return super.onKill(npc, player, isPet);
|
|
@@ -145,6 +126,10 @@ public class Q00052_WilliesSpecialBait extends Quest
|
|
addStartNpc(WILLIE);
|
|
addStartNpc(WILLIE);
|
|
addTalkId(WILLIE);
|
|
addTalkId(WILLIE);
|
|
addKillId(TARLK_BASILISK);
|
|
addKillId(TARLK_BASILISK);
|
|
|
|
+ questItemIds = new int[]
|
|
|
|
+ {
|
|
|
|
+ TARLK_EYE
|
|
|
|
+ };
|
|
}
|
|
}
|
|
|
|
|
|
public static void main(String[] args)
|
|
public static void main(String[] args)
|