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

BETA: Fixing chances for some quests.

	Reported by: jurchiks
parent f1ba1e71
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ import java.util.Map; ...@@ -24,7 +24,7 @@ import java.util.Map;
import com.l2jserver.gameserver.enums.QuestSound; import com.l2jserver.gameserver.enums.QuestSound;
import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.QuestItemHolder; import com.l2jserver.gameserver.model.holders.ItemChanceHolder;
import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState; import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State; import com.l2jserver.gameserver.model.quest.State;
...@@ -53,29 +53,29 @@ public class Q00111_ElrokianHuntersProof extends Quest ...@@ -53,29 +53,29 @@ public class Q00111_ElrokianHuntersProof extends Quest
// Misc // Misc
private static final int MIN_LEVEL = 75; private static final int MIN_LEVEL = 75;
// Mobs // Mobs
private static final Map<Integer, QuestItemHolder> MOBS_DROP_CHANCES = new HashMap<>(); private static final Map<Integer, ItemChanceHolder> MOBS_DROP_CHANCES = new HashMap<>();
static static
{ {
MOBS_DROP_CHANCES.put(22196, new QuestItemHolder(DIARY_FRAGMENT, 510, 4)); // velociraptor_leader MOBS_DROP_CHANCES.put(22196, new ItemChanceHolder(DIARY_FRAGMENT, 0.51, 4)); // velociraptor_leader
MOBS_DROP_CHANCES.put(22197, new QuestItemHolder(DIARY_FRAGMENT, 510, 4)); // velociraptor MOBS_DROP_CHANCES.put(22197, new ItemChanceHolder(DIARY_FRAGMENT, 0.51, 4)); // velociraptor
MOBS_DROP_CHANCES.put(22198, new QuestItemHolder(DIARY_FRAGMENT, 510, 4)); // velociraptor_s MOBS_DROP_CHANCES.put(22198, new ItemChanceHolder(DIARY_FRAGMENT, 0.51, 4)); // velociraptor_s
MOBS_DROP_CHANCES.put(22218, new QuestItemHolder(DIARY_FRAGMENT, 250, 4)); // velociraptor_n MOBS_DROP_CHANCES.put(22218, new ItemChanceHolder(DIARY_FRAGMENT, 0.25, 4)); // velociraptor_n
MOBS_DROP_CHANCES.put(22223, new QuestItemHolder(DIARY_FRAGMENT, 260, 4)); // velociraptor_leader2 MOBS_DROP_CHANCES.put(22223, new ItemChanceHolder(DIARY_FRAGMENT, 0.26, 4)); // velociraptor_leader2
MOBS_DROP_CHANCES.put(22200, new QuestItemHolder(ORNITHOMINUS_CLAW, 660, 11)); // ornithomimus_leader MOBS_DROP_CHANCES.put(22200, new ItemChanceHolder(ORNITHOMINUS_CLAW, 0.66, 11)); // ornithomimus_leader
MOBS_DROP_CHANCES.put(22201, new QuestItemHolder(ORNITHOMINUS_CLAW, 330, 11)); // ornithomimus MOBS_DROP_CHANCES.put(22201, new ItemChanceHolder(ORNITHOMINUS_CLAW, 0.33, 11)); // ornithomimus
MOBS_DROP_CHANCES.put(22202, new QuestItemHolder(ORNITHOMINUS_CLAW, 660, 11)); // ornithomimus_s MOBS_DROP_CHANCES.put(22202, new ItemChanceHolder(ORNITHOMINUS_CLAW, 0.66, 11)); // ornithomimus_s
MOBS_DROP_CHANCES.put(22219, new QuestItemHolder(ORNITHOMINUS_CLAW, 330, 11)); // ornithomimus_n MOBS_DROP_CHANCES.put(22219, new ItemChanceHolder(ORNITHOMINUS_CLAW, 0.33, 11)); // ornithomimus_n
MOBS_DROP_CHANCES.put(22224, new QuestItemHolder(ORNITHOMINUS_CLAW, 330, 11)); // ornithomimus_leader2 MOBS_DROP_CHANCES.put(22224, new ItemChanceHolder(ORNITHOMINUS_CLAW, 0.33, 11)); // ornithomimus_leader2
MOBS_DROP_CHANCES.put(22203, new QuestItemHolder(DEINONYCHUS_BONE, 650, 11)); // deinonychus_leader MOBS_DROP_CHANCES.put(22203, new ItemChanceHolder(DEINONYCHUS_BONE, 0.65, 11)); // deinonychus_leader
MOBS_DROP_CHANCES.put(22204, new QuestItemHolder(DEINONYCHUS_BONE, 320, 11)); // deinonychus MOBS_DROP_CHANCES.put(22204, new ItemChanceHolder(DEINONYCHUS_BONE, 0.32, 11)); // deinonychus
MOBS_DROP_CHANCES.put(22205, new QuestItemHolder(DEINONYCHUS_BONE, 660, 11)); // deinonychus_s MOBS_DROP_CHANCES.put(22205, new ItemChanceHolder(DEINONYCHUS_BONE, 0.66, 11)); // deinonychus_s
MOBS_DROP_CHANCES.put(22220, new QuestItemHolder(DEINONYCHUS_BONE, 320, 11)); // deinonychus_n MOBS_DROP_CHANCES.put(22220, new ItemChanceHolder(DEINONYCHUS_BONE, 0.32, 11)); // deinonychus_n
MOBS_DROP_CHANCES.put(22225, new QuestItemHolder(DEINONYCHUS_BONE, 320, 11)); // deinonychus_leader2 MOBS_DROP_CHANCES.put(22225, new ItemChanceHolder(DEINONYCHUS_BONE, 0.32, 11)); // deinonychus_leader2
MOBS_DROP_CHANCES.put(22208, new QuestItemHolder(PACHYCEPHALOSAURUS_SKIN, 500, 11)); // pachycephalosaurus_ldr MOBS_DROP_CHANCES.put(22208, new ItemChanceHolder(PACHYCEPHALOSAURUS_SKIN, 0.5, 11)); // pachycephalosaurus_ldr
MOBS_DROP_CHANCES.put(22209, new QuestItemHolder(PACHYCEPHALOSAURUS_SKIN, 500, 11)); // pachycephalosaurus MOBS_DROP_CHANCES.put(22209, new ItemChanceHolder(PACHYCEPHALOSAURUS_SKIN, 0.5, 11)); // pachycephalosaurus
MOBS_DROP_CHANCES.put(22210, new QuestItemHolder(PACHYCEPHALOSAURUS_SKIN, 500, 11)); // pachycephalosaurus_s MOBS_DROP_CHANCES.put(22210, new ItemChanceHolder(PACHYCEPHALOSAURUS_SKIN, 0.5, 11)); // pachycephalosaurus_s
MOBS_DROP_CHANCES.put(22221, new QuestItemHolder(PACHYCEPHALOSAURUS_SKIN, 490, 11)); // pachycephalosaurus_n MOBS_DROP_CHANCES.put(22221, new ItemChanceHolder(PACHYCEPHALOSAURUS_SKIN, 0.49, 11)); // pachycephalosaurus_n
MOBS_DROP_CHANCES.put(22226, new QuestItemHolder(PACHYCEPHALOSAURUS_SKIN, 500, 11)); // pachycephalosaurus_ldr2 MOBS_DROP_CHANCES.put(22226, new ItemChanceHolder(PACHYCEPHALOSAURUS_SKIN, 0.5, 11)); // pachycephalosaurus_ldr2
} }
private Q00111_ElrokianHuntersProof(int questId, String name, String descr) private Q00111_ElrokianHuntersProof(int questId, String name, String descr)
...@@ -223,7 +223,7 @@ public class Q00111_ElrokianHuntersProof extends Quest ...@@ -223,7 +223,7 @@ public class Q00111_ElrokianHuntersProof extends Quest
final QuestState qs = getRandomPartyMemberState(player, -1, 3, npc); final QuestState qs = getRandomPartyMemberState(player, -1, 3, npc);
if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, player, false)) if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, player, false))
{ {
final QuestItemHolder item = MOBS_DROP_CHANCES.get(npc.getId()); final ItemChanceHolder item = MOBS_DROP_CHANCES.get(npc.getId());
if ((item.getCount() == qs.getMemoState())) if ((item.getCount() == qs.getMemoState()))
{ {
if (qs.isCond(4)) if (qs.isCond(4))
......
...@@ -24,7 +24,7 @@ import java.util.Map; ...@@ -24,7 +24,7 @@ import java.util.Map;
import com.l2jserver.gameserver.datatables.SkillTable; import com.l2jserver.gameserver.datatables.SkillTable;
import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.QuestItemHolder; import com.l2jserver.gameserver.model.holders.ItemChanceHolder;
import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState; import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State; import com.l2jserver.gameserver.model.quest.State;
...@@ -50,31 +50,31 @@ public final class Q00628_HuntGoldenRam extends Quest ...@@ -50,31 +50,31 @@ public final class Q00628_HuntGoldenRam extends Quest
private static final int REQUIRED_ITEM_COUNT = 100; private static final int REQUIRED_ITEM_COUNT = 100;
private static final int MIN_LVL = 66; private static final int MIN_LVL = 66;
// Mobs // Mobs
private static final Map<Integer, QuestItemHolder> MOBS_DROP_CHANCES = new HashMap<>(); private static final Map<Integer, ItemChanceHolder> MOBS_DROP_CHANCES = new HashMap<>();
// Buffs // Buffs
private static final Map<String, QuestItemHolder> BUFFS = new HashMap<>(); private static final Map<String, ItemChanceHolder> BUFFS = new HashMap<>();
static static
{ {
MOBS_DROP_CHANCES.put(21508, new QuestItemHolder(SPLINTER_STAKATO_CHITIN, 500, 1)); // splinter_stakato MOBS_DROP_CHANCES.put(21508, new ItemChanceHolder(SPLINTER_STAKATO_CHITIN, 0.5, 1)); // splinter_stakato
MOBS_DROP_CHANCES.put(21509, new QuestItemHolder(SPLINTER_STAKATO_CHITIN, 430, 1)); // splinter_stakato_worker MOBS_DROP_CHANCES.put(21509, new ItemChanceHolder(SPLINTER_STAKATO_CHITIN, 0.43, 1)); // splinter_stakato_worker
MOBS_DROP_CHANCES.put(21510, new QuestItemHolder(SPLINTER_STAKATO_CHITIN, 521, 1)); // splinter_stakato_soldier MOBS_DROP_CHANCES.put(21510, new ItemChanceHolder(SPLINTER_STAKATO_CHITIN, 0.521, 1)); // splinter_stakato_soldier
MOBS_DROP_CHANCES.put(21511, new QuestItemHolder(SPLINTER_STAKATO_CHITIN, 575, 1)); // splinter_stakato_drone MOBS_DROP_CHANCES.put(21511, new ItemChanceHolder(SPLINTER_STAKATO_CHITIN, 0.575, 1)); // splinter_stakato_drone
MOBS_DROP_CHANCES.put(21512, new QuestItemHolder(SPLINTER_STAKATO_CHITIN, 746, 1)); // splinter_stakato_drone_a MOBS_DROP_CHANCES.put(21512, new ItemChanceHolder(SPLINTER_STAKATO_CHITIN, 0.746, 1)); // splinter_stakato_drone_a
MOBS_DROP_CHANCES.put(21513, new QuestItemHolder(NEEDLE_STAKATO_CHITIN, 500, 2)); // needle_stakato MOBS_DROP_CHANCES.put(21513, new ItemChanceHolder(NEEDLE_STAKATO_CHITIN, 0.5, 2)); // needle_stakato
MOBS_DROP_CHANCES.put(21514, new QuestItemHolder(NEEDLE_STAKATO_CHITIN, 430, 2)); // needle_stakato_worker MOBS_DROP_CHANCES.put(21514, new ItemChanceHolder(NEEDLE_STAKATO_CHITIN, 0.43, 2)); // needle_stakato_worker
MOBS_DROP_CHANCES.put(21515, new QuestItemHolder(NEEDLE_STAKATO_CHITIN, 520, 2)); // needle_stakato_soldier MOBS_DROP_CHANCES.put(21515, new ItemChanceHolder(NEEDLE_STAKATO_CHITIN, 0.52, 2)); // needle_stakato_soldier
MOBS_DROP_CHANCES.put(21516, new QuestItemHolder(NEEDLE_STAKATO_CHITIN, 531, 2)); // needle_stakato_drone MOBS_DROP_CHANCES.put(21516, new ItemChanceHolder(NEEDLE_STAKATO_CHITIN, 0.531, 2)); // needle_stakato_drone
MOBS_DROP_CHANCES.put(21517, new QuestItemHolder(NEEDLE_STAKATO_CHITIN, 744, 2)); // needle_stakato_drone_a MOBS_DROP_CHANCES.put(21517, new ItemChanceHolder(NEEDLE_STAKATO_CHITIN, 0.744, 2)); // needle_stakato_drone_a
BUFFS.put("Focus", new QuestItemHolder(4404, 2, 2)); // (buff_id, buff_level, buff_cost) BUFFS.put("Focus", new ItemChanceHolder(4404, 2, 2)); // (buff_id, buff_level, buff_cost)
BUFFS.put("Death", new QuestItemHolder(4405, 2, 2)); BUFFS.put("Death", new ItemChanceHolder(4405, 2, 2));
BUFFS.put("Might", new QuestItemHolder(4393, 3, 3)); BUFFS.put("Might", new ItemChanceHolder(4393, 3, 3));
BUFFS.put("Acumen", new QuestItemHolder(4400, 2, 3)); BUFFS.put("Acumen", new ItemChanceHolder(4400, 2, 3));
BUFFS.put("Berserker", new QuestItemHolder(4397, 1, 3)); BUFFS.put("Berserker", new ItemChanceHolder(4397, 1, 3));
BUFFS.put("Vampiric", new QuestItemHolder(4399, 2, 3)); BUFFS.put("Vampiric", new ItemChanceHolder(4399, 2, 3));
BUFFS.put("Empower", new QuestItemHolder(4401, 1, 6)); BUFFS.put("Empower", new ItemChanceHolder(4401, 1, 6));
BUFFS.put("Haste", new QuestItemHolder(4402, 2, 6)); BUFFS.put("Haste", new ItemChanceHolder(4402, 2, 6));
} }
private Q00628_HuntGoldenRam(int questId, String name, String descr) private Q00628_HuntGoldenRam(int questId, String name, String descr)
...@@ -166,12 +166,12 @@ public final class Q00628_HuntGoldenRam extends Quest ...@@ -166,12 +166,12 @@ public final class Q00628_HuntGoldenRam extends Quest
{ {
if (st.isCond(3)) if (st.isCond(3))
{ {
final QuestItemHolder buffs = BUFFS.get(event); final ItemChanceHolder buffs = BUFFS.get(event);
if (st.getQuestItemsCount(GOLDEN_RAM_COIN) >= buffs.getCount()) if (st.getQuestItemsCount(GOLDEN_RAM_COIN) >= buffs.getCount())
{ {
st.takeItems(GOLDEN_RAM_COIN, buffs.getCount()); st.takeItems(GOLDEN_RAM_COIN, buffs.getCount());
npc.setTarget(player); npc.setTarget(player);
npc.doCast(SkillTable.getInstance().getInfo(buffs.getId(), buffs.getChance())); npc.doCast(SkillTable.getInstance().getInfo(buffs.getId(), (int) buffs.getChance()));
htmltext = "31556-03.htm"; htmltext = "31556-03.htm";
} }
else else
...@@ -266,7 +266,7 @@ public final class Q00628_HuntGoldenRam extends Quest ...@@ -266,7 +266,7 @@ public final class Q00628_HuntGoldenRam extends Quest
QuestState qs = getRandomPartyMemberState(killer, -1, 1, npc); QuestState qs = getRandomPartyMemberState(killer, -1, 1, npc);
if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, false)) if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, false))
{ {
final QuestItemHolder item = MOBS_DROP_CHANCES.get(npc.getId()); final ItemChanceHolder item = MOBS_DROP_CHANCES.get(npc.getId());
if ((item.getCount() <= qs.getCond()) && !qs.isCond(3)) if ((item.getCount() <= qs.getCond()) && !qs.isCond(3))
{ {
giveItemRandomly(killer, npc, item.getId(), 1, REQUIRED_ITEM_COUNT, item.getChance(), true); giveItemRandomly(killer, npc, item.getId(), 1, REQUIRED_ITEM_COUNT, item.getChance(), true);
......
...@@ -43,20 +43,20 @@ final class Q00629_CleanUpTheSwampOfScreams extends Quest ...@@ -43,20 +43,20 @@ final class Q00629_CleanUpTheSwampOfScreams extends Quest
private static final int REQUIRED_TALON_COUNT = 100; private static final int REQUIRED_TALON_COUNT = 100;
private static final int MIN_LVL = 66; private static final int MIN_LVL = 66;
// Mobs // Mobs
private static final Map<Integer, Integer> MOBS_DROP_CHANCES = new HashMap<>(); private static final Map<Integer, Double> MOBS_DROP_CHANCES = new HashMap<>();
static static
{ {
MOBS_DROP_CHANCES.put(21508, 599); // splinter_stakato MOBS_DROP_CHANCES.put(21508, 0.599); // splinter_stakato
MOBS_DROP_CHANCES.put(21509, 524); // splinter_stakato_worker MOBS_DROP_CHANCES.put(21509, 0.524); // splinter_stakato_worker
MOBS_DROP_CHANCES.put(21510, 640); // splinter_stakato_soldier MOBS_DROP_CHANCES.put(21510, 0.64); // splinter_stakato_soldier
MOBS_DROP_CHANCES.put(21511, 830); // splinter_stakato_drone MOBS_DROP_CHANCES.put(21511, 0.83); // splinter_stakato_drone
MOBS_DROP_CHANCES.put(21512, 970); // splinter_stakato_drone_a MOBS_DROP_CHANCES.put(21512, 0.97); // splinter_stakato_drone_a
MOBS_DROP_CHANCES.put(21513, 682); // needle_stakato MOBS_DROP_CHANCES.put(21513, 0.682); // needle_stakato
MOBS_DROP_CHANCES.put(21514, 595); // needle_stakato_worker MOBS_DROP_CHANCES.put(21514, 0.595); // needle_stakato_worker
MOBS_DROP_CHANCES.put(21515, 727); // needle_stakato_soldier MOBS_DROP_CHANCES.put(21515, 0.727); // needle_stakato_soldier
MOBS_DROP_CHANCES.put(21516, 879); // needle_stakato_drone MOBS_DROP_CHANCES.put(21516, 0.879); // needle_stakato_drone
MOBS_DROP_CHANCES.put(21517, 999); // needle_stakato_drone_a MOBS_DROP_CHANCES.put(21517, 0.999); // needle_stakato_drone_a
} }
private Q00629_CleanUpTheSwampOfScreams(int questId, String name, String descr) private Q00629_CleanUpTheSwampOfScreams(int questId, String name, String descr)
......
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