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