Always use static modifier when adding values to static lists and maps.

This commit is contained in:
MobiusDevelopment
2019-04-08 10:30:59 +00:00
parent d4993f701e
commit bc61b48a56
262 changed files with 27272 additions and 26968 deletions

View File

@@ -1,237 +1,238 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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 ai.bosses.Core;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.Attackable;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.GrandBossInstance;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI;
/**
* Core AI.
* @author DrLecter, Emperorc, Mobius
*/
public final class Core extends AbstractNpcAI
{
// NPCs
private static final int CORE = 29006;
private static final int DEATH_KNIGHT = 29007;
private static final int DOOM_WRAITH = 29008;
private static final int SUSCEPTOR = 29011;
// Spawns
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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 ai.bosses.Core;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.CopyOnWriteArrayList;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.Attackable;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.GrandBossInstance;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI;
/**
* Core AI.
* @author DrLecter, Emperorc, Mobius
*/
public final class Core extends AbstractNpcAI
{
// NPCs
private static final int CORE = 29006;
private static final int DEATH_KNIGHT = 29007;
private static final int DOOM_WRAITH = 29008;
private static final int SUSCEPTOR = 29011;
// Spawns
private static final Map<Integer, Location> MINNION_SPAWNS = new HashMap<>();
{
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17191, 109298, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17564, 109548, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17855, 109552, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18280, 109202, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18784, 109253, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18059, 108314, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17300, 108444, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17148, 110071, -6648));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18318, 110077, -6648));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17726, 110391, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17113, 110970, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17496, 110880, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(18061, 110990, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(18384, 110698, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17993, 111458, -6584));
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17297, 111470, -6584));
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17893, 110198, -6648));
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17706, 109423, -6488));
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17849, 109388, -6480));
}
// Misc
private static final byte ALIVE = 0;
private static final byte DEAD = 1;
private static boolean _firstAttacked;
private static final List<Attackable> _minions = new CopyOnWriteArrayList<>();
private Core()
{
registerMobs(CORE, DEATH_KNIGHT, DOOM_WRAITH, SUSCEPTOR);
_firstAttacked = false;
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
startQuestTimer("core_unlock", temp, null, null);
}
else
{
// The time has already expired while the server was offline. Immediately spawn Core.
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
spawnBoss(core);
}
}
else
{
final boolean test = GlobalVariablesManager.getInstance().getBoolean("Core_Attacked", false);
if (test)
{
_firstAttacked = true;
}
final int loc_x = info.getInt("loc_x");
final int loc_y = info.getInt("loc_y");
final int loc_z = info.getInt("loc_z");
final int heading = info.getInt("heading");
final double hp = info.getDouble("currentHP");
final double mp = info.getDouble("currentMP");
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, loc_x, loc_y, loc_z, heading, false, 0);
core.setCurrentHpMp(hp, mp);
spawnBoss(core);
}
}
@Override
public void onSave()
{
GlobalVariablesManager.getInstance().set("Core_Attacked", _firstAttacked);
}
public void spawnBoss(GrandBossInstance npc)
{
GrandBossManager.getInstance().addBoss(npc);
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
// Spawn minions
Attackable mob;
Location spawnLocation;
for (Entry<Integer, Location> spawn : MINNION_SPAWNS.entrySet())
{
spawnLocation = spawn.getValue();
mob = (Attackable) addSpawn(spawn.getKey(), spawnLocation.getX(), spawnLocation.getY(), spawnLocation.getZ(), getRandom(61794), false, 0);
mob.setIsRaidMinion(true);
_minions.add(mob);
}
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
if (event.equalsIgnoreCase("core_unlock"))
{
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
spawnBoss(core);
}
else if (event.equalsIgnoreCase("spawn_minion"))
{
final Attackable mob = (Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
mob.setIsRaidMinion(true);
_minions.add(mob);
}
else if (event.equalsIgnoreCase("despawn_minions"))
{
_minions.forEach(m -> m.decayMe());
_minions.clear();
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
{
if (npc.getId() == CORE)
{
if (_firstAttacked)
{
if (getRandom(100) == 0)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.REMOVING_INTRUDERS));
}
}
else
{
_firstAttacked = true;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_NON_PERMITTED_TARGET_HAS_BEEN_DISCOVERED));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.INTRUDER_REMOVAL_SYSTEM_INITIATED));
}
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
if (npc.getId() == CORE)
{
final int objId = npc.getObjectId();
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_FATAL_ERROR_HAS_OCCURRED));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.EMPTY));
_firstAttacked = false;
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
// Calculate Min and Max respawn times randomly.
final long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatsSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
}
else if ((GrandBossManager.getInstance().getBossStatus(CORE) == ALIVE) && _minions.contains(npc))
{
_minions.remove(npc);
startQuestTimer("spawn_minion", 60000, npc, null);
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onSpawn(Npc npc)
{
if (npc.getId() == CORE)
{
npc.setIsImmobilized(true);
}
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new Core();
}
}
static
{
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17191, 109298, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17564, 109548, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17855, 109552, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18280, 109202, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18784, 109253, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18059, 108314, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17300, 108444, -6488));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17148, 110071, -6648));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(18318, 110077, -6648));
MINNION_SPAWNS.put(DEATH_KNIGHT, new Location(17726, 110391, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17113, 110970, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17496, 110880, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(18061, 110990, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(18384, 110698, -6648));
MINNION_SPAWNS.put(DOOM_WRAITH, new Location(17993, 111458, -6584));
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17297, 111470, -6584));
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17893, 110198, -6648));
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17706, 109423, -6488));
MINNION_SPAWNS.put(SUSCEPTOR, new Location(17849, 109388, -6480));
}
// Misc
private static final byte ALIVE = 0;
private static final byte DEAD = 1;
private static boolean _firstAttacked;
private static final List<Attackable> _minions = new CopyOnWriteArrayList<>();
private Core()
{
registerMobs(CORE, DEATH_KNIGHT, DOOM_WRAITH, SUSCEPTOR);
_firstAttacked = false;
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
if (GrandBossManager.getInstance().getBossStatus(CORE) == DEAD)
{
// Load the unlock date and time for Core from DB.
final long temp = info.getLong("respawn_time") - System.currentTimeMillis();
// If Core is locked until a certain time, mark it so and start the unlock timer the unlock time has not yet expired.
if (temp > 0)
{
startQuestTimer("core_unlock", temp, null, null);
}
else
{
// The time has already expired while the server was offline. Immediately spawn Core.
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
spawnBoss(core);
}
}
else
{
final boolean test = GlobalVariablesManager.getInstance().getBoolean("Core_Attacked", false);
if (test)
{
_firstAttacked = true;
}
final int loc_x = info.getInt("loc_x");
final int loc_y = info.getInt("loc_y");
final int loc_z = info.getInt("loc_z");
final int heading = info.getInt("heading");
final double hp = info.getDouble("currentHP");
final double mp = info.getDouble("currentMP");
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, loc_x, loc_y, loc_z, heading, false, 0);
core.setCurrentHpMp(hp, mp);
spawnBoss(core);
}
}
@Override
public void onSave()
{
GlobalVariablesManager.getInstance().set("Core_Attacked", _firstAttacked);
}
public void spawnBoss(GrandBossInstance npc)
{
GrandBossManager.getInstance().addBoss(npc);
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
// Spawn minions
Attackable mob;
Location spawnLocation;
for (Entry<Integer, Location> spawn : MINNION_SPAWNS.entrySet())
{
spawnLocation = spawn.getValue();
mob = (Attackable) addSpawn(spawn.getKey(), spawnLocation.getX(), spawnLocation.getY(), spawnLocation.getZ(), getRandom(61794), false, 0);
mob.setIsRaidMinion(true);
_minions.add(mob);
}
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
if (event.equalsIgnoreCase("core_unlock"))
{
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
spawnBoss(core);
}
else if (event.equalsIgnoreCase("spawn_minion"))
{
final Attackable mob = (Attackable) addSpawn(npc.getId(), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0);
mob.setIsRaidMinion(true);
_minions.add(mob);
}
else if (event.equalsIgnoreCase("despawn_minions"))
{
_minions.forEach(m -> m.decayMe());
_minions.clear();
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onAttack(Npc npc, PlayerInstance attacker, int damage, boolean isSummon)
{
if (npc.getId() == CORE)
{
if (_firstAttacked)
{
if (getRandom(100) == 0)
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.REMOVING_INTRUDERS));
}
}
else
{
_firstAttacked = true;
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_NON_PERMITTED_TARGET_HAS_BEEN_DISCOVERED));
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.INTRUDER_REMOVAL_SYSTEM_INITIATED));
}
}
return super.onAttack(npc, attacker, damage, isSummon);
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
if (npc.getId() == CORE)
{
final int objId = npc.getObjectId();
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.A_FATAL_ERROR_HAS_OCCURRED));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.SYSTEM_IS_BEING_SHUT_DOWN));
npc.broadcastPacket(new NpcSay(objId, ChatType.NPC_GENERAL, npc.getId(), NpcStringId.EMPTY));
_firstAttacked = false;
GrandBossManager.getInstance().setBossStatus(CORE, DEAD);
// Calculate Min and Max respawn times randomly.
final long respawnTime = (Config.CORE_SPAWN_INTERVAL + getRandom(-Config.CORE_SPAWN_RANDOM, Config.CORE_SPAWN_RANDOM)) * 3600000;
startQuestTimer("core_unlock", respawnTime, null, null);
// Also save the respawn time so that the info is maintained past reboots.
final StatsSet info = GrandBossManager.getInstance().getStatsSet(CORE);
info.set("respawn_time", System.currentTimeMillis() + respawnTime);
GrandBossManager.getInstance().setStatsSet(CORE, info);
startQuestTimer("despawn_minions", 20000, null, null);
cancelQuestTimers("spawn_minion");
}
else if ((GrandBossManager.getInstance().getBossStatus(CORE) == ALIVE) && _minions.contains(npc))
{
_minions.remove(npc);
startQuestTimer("spawn_minion", 60000, npc, null);
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onSpawn(Npc npc)
{
if (npc.getId() == CORE)
{
npc.setIsImmobilized(true);
}
return super.onSpawn(npc);
}
public static void main(String[] args)
{
new Core();
}
}

View File

@@ -54,7 +54,6 @@ public final class DelusionTeleport extends AbstractNpcAI
private static final String DELUSION_RETURN = "DELUSION_RETURN";
private static final Map<Integer, Location> RETURN_LOCATIONS = new HashMap<>();
static
{
RETURN_LOCATIONS.put(0, new Location(43835, -47749, -792)); // Undefined origin, return to Rune

View File

@@ -40,7 +40,6 @@ public final class Selina extends AbstractNpcAI
private static final int GOLDEN_RAM_COIN = 7251;
// Skills
private static final Map<String, BuffHolder> BUFFS = new HashMap<>();
static
{
BUFFS.put("4359", new BuffHolder(4359, 2, 2)); // Focus

View File

@@ -1,257 +1,258 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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 events.L2Day;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.QuestItemHolder;
import com.l2jmobius.gameserver.model.quest.LongTimeEvent;
/**
* L2 Day event AI.
* @author Pandragon
*/
public final class L2Day extends LongTimeEvent
{
// NPCs
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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 events.L2Day;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.QuestItemHolder;
import com.l2jmobius.gameserver.model.quest.LongTimeEvent;
/**
* L2 Day event AI.
* @author Pandragon
*/
public final class L2Day extends LongTimeEvent
{
// NPCs
private static final Map<Integer, Integer> MANAGERS = new HashMap<>();
{
MANAGERS.put(31854, 7117); // Talking Island Village
MANAGERS.put(31855, 7118); // Elven Village
MANAGERS.put(31856, 7119); // Dark Elven Village
MANAGERS.put(31857, 7121); // Dwarven Village
MANAGERS.put(31858, 7120); // Orc Village
}
// Items
private static final int A = 3875;
private static final int C = 3876;
private static final int E = 3877;
private static final int F = 3878;
private static final int G = 3879;
private static final int H = 3880;
private static final int I = 3881;
private static final int L = 3882;
private static final int N = 3883;
private static final int O = 3884;
private static final int R = 3885;
private static final int S = 3886;
private static final int T = 3887;
private static final int II = 3888;
// Rewards
private static final QuestItemHolder[] L2_REWARDS =
{
new QuestItemHolder(10260, 90, 3), // Alacrity Juice
new QuestItemHolder(10261, 85, 3), // Accuracy Juice
new QuestItemHolder(10262, 80, 3), // Critical Hit Juice
new QuestItemHolder(10263, 75, 3), // Critical Rate Juice
new QuestItemHolder(10264, 70, 3), // Casting Spd. Juice
new QuestItemHolder(10265, 65, 3), // Evasion Juice
new QuestItemHolder(10266, 60, 3), // M. Atk. Juice
new QuestItemHolder(10267, 55, 3), // Power Juice
new QuestItemHolder(10268, 50, 3), // Speed Juice
new QuestItemHolder(10269, 45, 3), // Defense Juice
new QuestItemHolder(10270, 40, 3), // MP Consumption Juice
new QuestItemHolder(9546, 37, 2), // Fire Stone
new QuestItemHolder(9547, 34, 2), // Water Stone
new QuestItemHolder(9548, 31, 2), // Earth Stone
new QuestItemHolder(9549, 28, 2), // Wind Stone
new QuestItemHolder(9550, 25, 2), // Dark Stone
new QuestItemHolder(9551, 22, 2), // Holy Stone
new QuestItemHolder(8947, 19, 1), // L2day - Rabbit Ears
new QuestItemHolder(8948, 16, 1), // L2day - Little Angel Wings
new QuestItemHolder(8949, 13, 1), // L2day - Fairy Antennae
new QuestItemHolder(3959, 10, 2), // Blessed Scroll of Resurrection (Event)
new QuestItemHolder(3958, 7, 2), // Blessed Scroll of Escape (Event)
new QuestItemHolder(8752, 4, 2), // High-Grade Life Stone - Level 76
new QuestItemHolder(8762, 1, 1), // Top-Grade Life Stone - Level 76
new QuestItemHolder(6660, 0, 1), // Ring of Queen Ant
};
private static final QuestItemHolder[] NC_REWARDS =
{
new QuestItemHolder(10260, 90, 2), // Alacrity Juice
new QuestItemHolder(10261, 85, 2), // Accuracy Juice
new QuestItemHolder(10262, 80, 2), // Critical Hit Juice
new QuestItemHolder(10263, 75, 2), // Critical Rate Juice
new QuestItemHolder(10264, 70, 2), // Casting Spd. Juice
new QuestItemHolder(10265, 65, 2), // Evasion Juice
new QuestItemHolder(10266, 60, 2), // M. Atk. Juice
new QuestItemHolder(10267, 55, 2), // Power Juice
new QuestItemHolder(10268, 50, 2), // Speed Juice
new QuestItemHolder(10269, 45, 2), // Defense Juice
new QuestItemHolder(10270, 40, 2), // MP Consumption Juice
new QuestItemHolder(9546, 37, 1), // Fire Stone
new QuestItemHolder(9547, 34, 1), // Water Stone
new QuestItemHolder(9548, 31, 1), // Earth Stone
new QuestItemHolder(9549, 28, 1), // Wind Stone
new QuestItemHolder(9550, 25, 1), // Dark Stone
new QuestItemHolder(9551, 22, 1), // Holy Stone
new QuestItemHolder(8948, 19, 1), // L2day - Little Angel Wings
new QuestItemHolder(8949, 16, 1), // L2day - Fairy Antennae
new QuestItemHolder(8950, 13, 1), // L2day - Feathered Hat
new QuestItemHolder(3959, 10, 1), // Blessed Scroll of Resurrection (Event)
new QuestItemHolder(3958, 7, 1), // Blessed Scroll of Escape (Event)
new QuestItemHolder(8742, 4, 2), // Mid-Grade Life Stone - Level 76
new QuestItemHolder(8752, 1, 1), // High-Grade Life Stone - Level 76
new QuestItemHolder(6661, 0, 1), // Earring of Orfen
};
private static final QuestItemHolder[] CH_REWARDS =
{
new QuestItemHolder(10260, 90, 1), // Alacrity Juice
new QuestItemHolder(10261, 85, 1), // Accuracy Juice
new QuestItemHolder(10262, 80, 1), // Critical Hit Juice
new QuestItemHolder(10263, 75, 1), // Critical Rate Juice
new QuestItemHolder(10264, 70, 1), // Casting Spd. Juice
new QuestItemHolder(10265, 65, 1), // Evasion Juice
new QuestItemHolder(10266, 60, 1), // M. Atk. Juice
new QuestItemHolder(10267, 55, 1), // Power Juice
new QuestItemHolder(10268, 50, 1), // Speed Juice
new QuestItemHolder(10269, 45, 1), // Defense Juice
new QuestItemHolder(10270, 40, 1), // MP Consumption Juice
new QuestItemHolder(9546, 37, 1), // Fire Stone
new QuestItemHolder(9547, 34, 1), // Water Stone
new QuestItemHolder(9548, 31, 1), // Earth Stone
new QuestItemHolder(9549, 28, 1), // Wind Stone
new QuestItemHolder(9550, 25, 1), // Dark Stone
new QuestItemHolder(9551, 22, 1), // Holy Stone
new QuestItemHolder(8949, 19, 1), // L2day - Fairy Antennae
new QuestItemHolder(8950, 16, 1), // L2day - Feathered Hat
new QuestItemHolder(8951, 13, 1), // L2day - Artisan's Goggles
new QuestItemHolder(3959, 10, 1), // Blessed Scroll of Resurrection (Event)
new QuestItemHolder(3958, 7, 1), // Blessed Scroll of Escape (Event)
new QuestItemHolder(8742, 4, 1), // Mid-Grade Life Stone - Level 76
new QuestItemHolder(8752, 1, 1), // High-Grade Life Stone - Level 76
new QuestItemHolder(6662, 0, 1), // Ring of Core
};
private L2Day()
{
addStartNpc(MANAGERS.keySet());
addFirstTalkId(MANAGERS.keySet());
addTalkId(MANAGERS.keySet());
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = event;
switch (event)
{
case "collect_l2":
{
if (hasQuestItems(player, L, I, N, E, A, G, II) && (getQuestItemsCount(player, E) > 1))
{
takeItems(player, 1, L, I, N, E, A, G, E, II);
final int random = getRandom(100);
if (random >= 95)
{
rewardItems(player, MANAGERS.get(npc.getId()), 2);
}
else
{
for (QuestItemHolder holder : L2_REWARDS)
{
if (random >= holder.getChance())
{
rewardItems(player, holder);
break;
}
}
}
htmltext = "manager-1.htm";
}
else
{
htmltext = "manager-no.htm";
}
break;
}
case "collect_nc":
{
if (hasQuestItems(player, N, C, S, O, F, T))
{
takeItems(player, 1, N, C, S, O, F, T);
final int random = getRandom(100);
if (random >= 95)
{
rewardItems(player, MANAGERS.get(npc.getId()), 1);
}
else
{
for (QuestItemHolder holder : NC_REWARDS)
{
if (random >= holder.getChance())
{
rewardItems(player, holder);
break;
}
}
}
htmltext = "manager-1.htm";
}
else
{
htmltext = "manager-no.htm";
}
break;
}
case "collect_ch":
{
if (hasQuestItems(player, C, H, R, O, N, I, L, E) && (getQuestItemsCount(player, C) > 1))
{
takeItems(player, 1, C, H, R, O, N, I, C, L, E);
final int random = getRandom(100);
if (random >= 95)
{
rewardItems(player, MANAGERS.get(npc.getId()), 1);
}
else
{
for (QuestItemHolder holder : CH_REWARDS)
{
if (random >= holder.getChance())
{
rewardItems(player, holder);
break;
}
}
}
htmltext = "manager-1.htm";
}
else
{
htmltext = "manager-no.htm";
}
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
return "manager-1.htm";
}
public static void main(String[] args)
{
new L2Day();
}
}
static
{
MANAGERS.put(31854, 7117); // Talking Island Village
MANAGERS.put(31855, 7118); // Elven Village
MANAGERS.put(31856, 7119); // Dark Elven Village
MANAGERS.put(31857, 7121); // Dwarven Village
MANAGERS.put(31858, 7120); // Orc Village
}
// Items
private static final int A = 3875;
private static final int C = 3876;
private static final int E = 3877;
private static final int F = 3878;
private static final int G = 3879;
private static final int H = 3880;
private static final int I = 3881;
private static final int L = 3882;
private static final int N = 3883;
private static final int O = 3884;
private static final int R = 3885;
private static final int S = 3886;
private static final int T = 3887;
private static final int II = 3888;
// Rewards
private static final QuestItemHolder[] L2_REWARDS =
{
new QuestItemHolder(10260, 90, 3), // Alacrity Juice
new QuestItemHolder(10261, 85, 3), // Accuracy Juice
new QuestItemHolder(10262, 80, 3), // Critical Hit Juice
new QuestItemHolder(10263, 75, 3), // Critical Rate Juice
new QuestItemHolder(10264, 70, 3), // Casting Spd. Juice
new QuestItemHolder(10265, 65, 3), // Evasion Juice
new QuestItemHolder(10266, 60, 3), // M. Atk. Juice
new QuestItemHolder(10267, 55, 3), // Power Juice
new QuestItemHolder(10268, 50, 3), // Speed Juice
new QuestItemHolder(10269, 45, 3), // Defense Juice
new QuestItemHolder(10270, 40, 3), // MP Consumption Juice
new QuestItemHolder(9546, 37, 2), // Fire Stone
new QuestItemHolder(9547, 34, 2), // Water Stone
new QuestItemHolder(9548, 31, 2), // Earth Stone
new QuestItemHolder(9549, 28, 2), // Wind Stone
new QuestItemHolder(9550, 25, 2), // Dark Stone
new QuestItemHolder(9551, 22, 2), // Holy Stone
new QuestItemHolder(8947, 19, 1), // L2day - Rabbit Ears
new QuestItemHolder(8948, 16, 1), // L2day - Little Angel Wings
new QuestItemHolder(8949, 13, 1), // L2day - Fairy Antennae
new QuestItemHolder(3959, 10, 2), // Blessed Scroll of Resurrection (Event)
new QuestItemHolder(3958, 7, 2), // Blessed Scroll of Escape (Event)
new QuestItemHolder(8752, 4, 2), // High-Grade Life Stone - Level 76
new QuestItemHolder(8762, 1, 1), // Top-Grade Life Stone - Level 76
new QuestItemHolder(6660, 0, 1), // Ring of Queen Ant
};
private static final QuestItemHolder[] NC_REWARDS =
{
new QuestItemHolder(10260, 90, 2), // Alacrity Juice
new QuestItemHolder(10261, 85, 2), // Accuracy Juice
new QuestItemHolder(10262, 80, 2), // Critical Hit Juice
new QuestItemHolder(10263, 75, 2), // Critical Rate Juice
new QuestItemHolder(10264, 70, 2), // Casting Spd. Juice
new QuestItemHolder(10265, 65, 2), // Evasion Juice
new QuestItemHolder(10266, 60, 2), // M. Atk. Juice
new QuestItemHolder(10267, 55, 2), // Power Juice
new QuestItemHolder(10268, 50, 2), // Speed Juice
new QuestItemHolder(10269, 45, 2), // Defense Juice
new QuestItemHolder(10270, 40, 2), // MP Consumption Juice
new QuestItemHolder(9546, 37, 1), // Fire Stone
new QuestItemHolder(9547, 34, 1), // Water Stone
new QuestItemHolder(9548, 31, 1), // Earth Stone
new QuestItemHolder(9549, 28, 1), // Wind Stone
new QuestItemHolder(9550, 25, 1), // Dark Stone
new QuestItemHolder(9551, 22, 1), // Holy Stone
new QuestItemHolder(8948, 19, 1), // L2day - Little Angel Wings
new QuestItemHolder(8949, 16, 1), // L2day - Fairy Antennae
new QuestItemHolder(8950, 13, 1), // L2day - Feathered Hat
new QuestItemHolder(3959, 10, 1), // Blessed Scroll of Resurrection (Event)
new QuestItemHolder(3958, 7, 1), // Blessed Scroll of Escape (Event)
new QuestItemHolder(8742, 4, 2), // Mid-Grade Life Stone - Level 76
new QuestItemHolder(8752, 1, 1), // High-Grade Life Stone - Level 76
new QuestItemHolder(6661, 0, 1), // Earring of Orfen
};
private static final QuestItemHolder[] CH_REWARDS =
{
new QuestItemHolder(10260, 90, 1), // Alacrity Juice
new QuestItemHolder(10261, 85, 1), // Accuracy Juice
new QuestItemHolder(10262, 80, 1), // Critical Hit Juice
new QuestItemHolder(10263, 75, 1), // Critical Rate Juice
new QuestItemHolder(10264, 70, 1), // Casting Spd. Juice
new QuestItemHolder(10265, 65, 1), // Evasion Juice
new QuestItemHolder(10266, 60, 1), // M. Atk. Juice
new QuestItemHolder(10267, 55, 1), // Power Juice
new QuestItemHolder(10268, 50, 1), // Speed Juice
new QuestItemHolder(10269, 45, 1), // Defense Juice
new QuestItemHolder(10270, 40, 1), // MP Consumption Juice
new QuestItemHolder(9546, 37, 1), // Fire Stone
new QuestItemHolder(9547, 34, 1), // Water Stone
new QuestItemHolder(9548, 31, 1), // Earth Stone
new QuestItemHolder(9549, 28, 1), // Wind Stone
new QuestItemHolder(9550, 25, 1), // Dark Stone
new QuestItemHolder(9551, 22, 1), // Holy Stone
new QuestItemHolder(8949, 19, 1), // L2day - Fairy Antennae
new QuestItemHolder(8950, 16, 1), // L2day - Feathered Hat
new QuestItemHolder(8951, 13, 1), // L2day - Artisan's Goggles
new QuestItemHolder(3959, 10, 1), // Blessed Scroll of Resurrection (Event)
new QuestItemHolder(3958, 7, 1), // Blessed Scroll of Escape (Event)
new QuestItemHolder(8742, 4, 1), // Mid-Grade Life Stone - Level 76
new QuestItemHolder(8752, 1, 1), // High-Grade Life Stone - Level 76
new QuestItemHolder(6662, 0, 1), // Ring of Core
};
private L2Day()
{
addStartNpc(MANAGERS.keySet());
addFirstTalkId(MANAGERS.keySet());
addTalkId(MANAGERS.keySet());
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
String htmltext = event;
switch (event)
{
case "collect_l2":
{
if (hasQuestItems(player, L, I, N, E, A, G, II) && (getQuestItemsCount(player, E) > 1))
{
takeItems(player, 1, L, I, N, E, A, G, E, II);
final int random = getRandom(100);
if (random >= 95)
{
rewardItems(player, MANAGERS.get(npc.getId()), 2);
}
else
{
for (QuestItemHolder holder : L2_REWARDS)
{
if (random >= holder.getChance())
{
rewardItems(player, holder);
break;
}
}
}
htmltext = "manager-1.htm";
}
else
{
htmltext = "manager-no.htm";
}
break;
}
case "collect_nc":
{
if (hasQuestItems(player, N, C, S, O, F, T))
{
takeItems(player, 1, N, C, S, O, F, T);
final int random = getRandom(100);
if (random >= 95)
{
rewardItems(player, MANAGERS.get(npc.getId()), 1);
}
else
{
for (QuestItemHolder holder : NC_REWARDS)
{
if (random >= holder.getChance())
{
rewardItems(player, holder);
break;
}
}
}
htmltext = "manager-1.htm";
}
else
{
htmltext = "manager-no.htm";
}
break;
}
case "collect_ch":
{
if (hasQuestItems(player, C, H, R, O, N, I, L, E) && (getQuestItemsCount(player, C) > 1))
{
takeItems(player, 1, C, H, R, O, N, I, C, L, E);
final int random = getRandom(100);
if (random >= 95)
{
rewardItems(player, MANAGERS.get(npc.getId()), 1);
}
else
{
for (QuestItemHolder holder : CH_REWARDS)
{
if (random >= holder.getChance())
{
rewardItems(player, holder);
break;
}
}
}
htmltext = "manager-1.htm";
}
else
{
htmltext = "manager-no.htm";
}
break;
}
}
return htmltext;
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
return "manager-1.htm";
}
public static void main(String[] args)
{
new L2Day();
}
}

View File

@@ -1,291 +1,292 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.Q00032_AnObviousLie;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.ItemHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
/**
* An Obvious Lie (32).
* @author janiko
*/
public final class Q00032_AnObviousLie extends Quest
{
// NPCs
private static final int MAXIMILIAN = 30120;
private static final int GENTLER = 30094;
private static final int MIKI_THE_CAT = 31706;
// Monster
private static final int ALLIGATOR = 20135;
// Items
private static final int MAP_OF_GENTLER = 7165;
private static final ItemHolder MEDICINAL_HERB = new ItemHolder(7166, 20);
private static final ItemHolder SPIRIT_ORE = new ItemHolder(3031, 500);
private static final ItemHolder THREAD = new ItemHolder(1868, 1000);
private static final ItemHolder SUEDE = new ItemHolder(1866, 500);
// Misc
private static final int MIN_LVL = 45;
// Reward
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.Q00032_AnObviousLie;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.ItemHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
/**
* An Obvious Lie (32).
* @author janiko
*/
public final class Q00032_AnObviousLie extends Quest
{
// NPCs
private static final int MAXIMILIAN = 30120;
private static final int GENTLER = 30094;
private static final int MIKI_THE_CAT = 31706;
// Monster
private static final int ALLIGATOR = 20135;
// Items
private static final int MAP_OF_GENTLER = 7165;
private static final ItemHolder MEDICINAL_HERB = new ItemHolder(7166, 20);
private static final ItemHolder SPIRIT_ORE = new ItemHolder(3031, 500);
private static final ItemHolder THREAD = new ItemHolder(1868, 1000);
private static final ItemHolder SUEDE = new ItemHolder(1866, 500);
// Misc
private static final int MIN_LVL = 45;
// Reward
private static final Map<String, Integer> EARS = new HashMap<>();
{
EARS.put("cat", 6843); // Cat Ears
EARS.put("raccoon", 7680); // Raccoon ears
EARS.put("rabbit", 7683); // Rabbit ears
}
public Q00032_AnObviousLie()
{
super(32);
addStartNpc(MAXIMILIAN);
addTalkId(MAXIMILIAN, GENTLER, MIKI_THE_CAT);
addKillId(ALLIGATOR);
registerQuestItems(MAP_OF_GENTLER, MEDICINAL_HERB.getId());
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs == null)
{
return htmltext;
}
switch (event)
{
case "30120-02.html":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "30094-02.html":
{
if (qs.isCond(1))
{
giveItems(player, MAP_OF_GENTLER, 1);
qs.setCond(2, true);
htmltext = event;
}
break;
}
case "31706-02.html":
{
if (qs.isCond(2) && hasQuestItems(player, MAP_OF_GENTLER))
{
takeItems(player, MAP_OF_GENTLER, -1);
qs.setCond(3, true);
htmltext = event;
}
break;
}
case "30094-06.html":
{
if (qs.isCond(4) && hasItem(player, MEDICINAL_HERB))
{
takeItem(player, MEDICINAL_HERB);
qs.setCond(5, true);
htmltext = event;
}
break;
}
case "30094-09.html":
{
if (qs.isCond(5) && hasItem(player, SPIRIT_ORE))
{
takeItem(player, SPIRIT_ORE);
qs.setCond(6, true);
htmltext = event;
}
break;
}
case "30094-12.html":
{
if (qs.isCond(7))
{
qs.setCond(8, true);
htmltext = event;
}
break;
}
case "30094-15.html":
{
htmltext = event;
break;
}
case "31706-05.html":
{
if (qs.isCond(6))
{
qs.setCond(7, true);
htmltext = event;
}
break;
}
case "cat":
case "raccoon":
case "rabbit":
{
if (qs.isCond(8) && takeAllItems(player, THREAD, SUEDE))
{
giveItems(player, EARS.get(event), 1);
qs.exitQuest(false, true);
htmltext = "30094-16.html";
}
else
{
htmltext = "30094-17.html";
}
break;
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, 3, 3, npc);
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, MEDICINAL_HERB.getId(), 1, MEDICINAL_HERB.getCount(), 1.0, true))
{
qs.setCond(4);
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
switch (npc.getId())
{
case MAXIMILIAN:
{
if (qs.isCreated())
{
htmltext = (player.getLevel() >= MIN_LVL) ? "30120-01.htm" : "30120-03.htm";
}
else if (qs.isStarted())
{
if (qs.isCond(1))
{
htmltext = "30120-04.html";
}
}
else
{
htmltext = getAlreadyCompletedMsg(player);
}
break;
}
case GENTLER:
{
switch (qs.getCond())
{
case 1:
{
htmltext = "30094-01.html";
break;
}
case 2:
{
htmltext = "30094-03.html";
break;
}
case 4:
{
htmltext = hasItem(player, MEDICINAL_HERB) ? "30094-04.html" : "30094-05.html";
break;
}
case 5:
{
htmltext = hasItem(player, SPIRIT_ORE) ? "30094-07.html" : "30094-08.html";
break;
}
case 6:
{
htmltext = "30094-10.html";
break;
}
case 7:
{
htmltext = "30094-11.html";
break;
}
case 8:
{
if (hasAllItems(player, true, THREAD, SUEDE))
{
htmltext = "30094-13.html";
}
else
{
htmltext = "30094-14.html";
}
break;
}
}
break;
}
case MIKI_THE_CAT:
{
switch (qs.getCond())
{
case 2:
{
if (hasQuestItems(player, MAP_OF_GENTLER))
{
htmltext = "31706-01.html";
}
break;
}
case 3:
case 4:
case 5:
{
htmltext = "31706-03.html";
break;
}
case 6:
{
htmltext = "31706-04.html";
break;
}
case 7:
{
htmltext = "31706-06.html";
break;
}
}
break;
}
}
return htmltext;
}
}
static
{
EARS.put("cat", 6843); // Cat Ears
EARS.put("raccoon", 7680); // Raccoon ears
EARS.put("rabbit", 7683); // Rabbit ears
}
public Q00032_AnObviousLie()
{
super(32);
addStartNpc(MAXIMILIAN);
addTalkId(MAXIMILIAN, GENTLER, MIKI_THE_CAT);
addKillId(ALLIGATOR);
registerQuestItems(MAP_OF_GENTLER, MEDICINAL_HERB.getId());
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs == null)
{
return htmltext;
}
switch (event)
{
case "30120-02.html":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "30094-02.html":
{
if (qs.isCond(1))
{
giveItems(player, MAP_OF_GENTLER, 1);
qs.setCond(2, true);
htmltext = event;
}
break;
}
case "31706-02.html":
{
if (qs.isCond(2) && hasQuestItems(player, MAP_OF_GENTLER))
{
takeItems(player, MAP_OF_GENTLER, -1);
qs.setCond(3, true);
htmltext = event;
}
break;
}
case "30094-06.html":
{
if (qs.isCond(4) && hasItem(player, MEDICINAL_HERB))
{
takeItem(player, MEDICINAL_HERB);
qs.setCond(5, true);
htmltext = event;
}
break;
}
case "30094-09.html":
{
if (qs.isCond(5) && hasItem(player, SPIRIT_ORE))
{
takeItem(player, SPIRIT_ORE);
qs.setCond(6, true);
htmltext = event;
}
break;
}
case "30094-12.html":
{
if (qs.isCond(7))
{
qs.setCond(8, true);
htmltext = event;
}
break;
}
case "30094-15.html":
{
htmltext = event;
break;
}
case "31706-05.html":
{
if (qs.isCond(6))
{
qs.setCond(7, true);
htmltext = event;
}
break;
}
case "cat":
case "raccoon":
case "rabbit":
{
if (qs.isCond(8) && takeAllItems(player, THREAD, SUEDE))
{
giveItems(player, EARS.get(event), 1);
qs.exitQuest(false, true);
htmltext = "30094-16.html";
}
else
{
htmltext = "30094-17.html";
}
break;
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, 3, 3, npc);
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, MEDICINAL_HERB.getId(), 1, MEDICINAL_HERB.getCount(), 1.0, true))
{
qs.setCond(4);
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
switch (npc.getId())
{
case MAXIMILIAN:
{
if (qs.isCreated())
{
htmltext = (player.getLevel() >= MIN_LVL) ? "30120-01.htm" : "30120-03.htm";
}
else if (qs.isStarted())
{
if (qs.isCond(1))
{
htmltext = "30120-04.html";
}
}
else
{
htmltext = getAlreadyCompletedMsg(player);
}
break;
}
case GENTLER:
{
switch (qs.getCond())
{
case 1:
{
htmltext = "30094-01.html";
break;
}
case 2:
{
htmltext = "30094-03.html";
break;
}
case 4:
{
htmltext = hasItem(player, MEDICINAL_HERB) ? "30094-04.html" : "30094-05.html";
break;
}
case 5:
{
htmltext = hasItem(player, SPIRIT_ORE) ? "30094-07.html" : "30094-08.html";
break;
}
case 6:
{
htmltext = "30094-10.html";
break;
}
case 7:
{
htmltext = "30094-11.html";
break;
}
case 8:
{
if (hasAllItems(player, true, THREAD, SUEDE))
{
htmltext = "30094-13.html";
}
else
{
htmltext = "30094-14.html";
}
break;
}
}
break;
}
case MIKI_THE_CAT:
{
switch (qs.getCond())
{
case 2:
{
if (hasQuestItems(player, MAP_OF_GENTLER))
{
htmltext = "31706-01.html";
}
break;
}
case 3:
case 4:
case 5:
{
htmltext = "31706-03.html";
break;
}
case 6:
{
htmltext = "31706-04.html";
break;
}
case 7:
{
htmltext = "31706-06.html";
break;
}
}
break;
}
}
return htmltext;
}
}

View File

@@ -66,7 +66,6 @@ public final class Q00257_TheGuardIsBusy extends Quest
private static final int ORC_AMULET = 752;
private static final int ORC_NECKLACE = 1085;
private static final int WEREWOLF_FANG = 1086;
static
{
MONSTERS.put(20006, Arrays.asList(new MobDrop(10, 2, ORC_AMULET, 2), new MobDrop(10, 10, ORC_AMULET, 1))); // Orc Archer

View File

@@ -42,7 +42,6 @@ public final class Q00262_TradeWithTheIvoryTower extends Quest
private static final int REQUIRED_ITEM_COUNT = 10;
// Monsters
private static final Map<Integer, Integer> MOBS_SAC = new HashMap<>();
static
{
MOBS_SAC.put(20007, 3); // Green Fungus

View File

@@ -54,7 +54,6 @@ public final class Q00276_TotemOfTheHestui extends Quest
// Misc
private static final List<ItemHolder> SPAWN_CHANCES = new ArrayList<>();
private static final int MIN_LVL = 15;
static
{
SPAWN_CHANCES.add(new ItemHolder(79, 100));

View File

@@ -62,7 +62,6 @@ public final class Q00281_HeadForTheHills extends Quest
};
private static final ItemHolder SOULSHOTS_NO_GRADE_FOR_ROOKIES = new ItemHolder(5789, 6000);
private static final ItemHolder SPIRITSHOTS_NO_GRADE_FOR_ROOKIES = new ItemHolder(5790, 3000);
static
{
MONSTERS.put(22234, 390); // Green Goblin

View File

@@ -38,7 +38,6 @@ public class Q00287_FiguringItOut extends Quest
// NPCs
private static final int LAKI = 32742;
private static final Map<Integer, Integer> MONSTERS = new HashMap<>();
static
{
MONSTERS.put(22768, 509); // Tanta Lizardman Scout

View File

@@ -46,7 +46,6 @@ public class Q00290_ThreatRemoval extends Quest
private static final int MIN_LEVEL = 82;
private static final Map<Integer, Integer> MOBS_TAG = new HashMap<>();
static
{
MOBS_TAG.put(22775, 932); // Sel Mahum Drill Sergeant

View File

@@ -46,7 +46,6 @@ public final class Q00300_HuntingLetoLizardman extends Quest
private static final int REQUIRED_BRACELET_COUNT = 60;
// Monsters
private static final Map<Integer, Integer> MOBS_SAC = new HashMap<>();
static
{
MOBS_SAC.put(20577, 360); // Leto Lizardman

View File

@@ -78,7 +78,6 @@ public final class Q00327_RecoverTheFarmland extends Quest
new ItemHolder(ANCIENT_BRONZE_MIRROR, 3227),
new ItemHolder(ANCIENT_JADE_NECKLACE, 3919)
};
static
{
FRAGMENTS_REWARD_DATA.put("30034-03.html", new ItemHolder(CLAY_URN_FRAGMENT, 307));

View File

@@ -1,378 +1,379 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.Q00344_1000YearsTheEndOfLamentation;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.ItemHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
/**
* 1000 years, the End of Lamentation (344)
* @author Pandragon
*/
public final class Q00344_1000YearsTheEndOfLamentation extends Quest
{
// NPCs
private static final int KAIEN = 30623;
private static final int GARVARENTZ = 30704;
private static final int GILMORE = 30754;
private static final int RODEMAI = 30756;
private static final int ORVEN = 30857;
// Items
private static final int ARTICLES = 4269;
private static final ItemHolder OLD_KEY = new ItemHolder(4270, 1);
private static final ItemHolder OLD_HILT = new ItemHolder(4271, 1);
private static final ItemHolder TOTEM_NECKLACE = new ItemHolder(4272, 1);
private static final ItemHolder CRUCIFIX = new ItemHolder(4273, 1);
// Monsters
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.Q00344_1000YearsTheEndOfLamentation;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.ItemHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
/**
* 1000 years, the End of Lamentation (344)
* @author Pandragon
*/
public final class Q00344_1000YearsTheEndOfLamentation extends Quest
{
// NPCs
private static final int KAIEN = 30623;
private static final int GARVARENTZ = 30704;
private static final int GILMORE = 30754;
private static final int RODEMAI = 30756;
private static final int ORVEN = 30857;
// Items
private static final int ARTICLES = 4269;
private static final ItemHolder OLD_KEY = new ItemHolder(4270, 1);
private static final ItemHolder OLD_HILT = new ItemHolder(4271, 1);
private static final ItemHolder TOTEM_NECKLACE = new ItemHolder(4272, 1);
private static final ItemHolder CRUCIFIX = new ItemHolder(4273, 1);
// Monsters
private static final Map<Integer, Double> MONSTER_CHANCES = new HashMap<>();
{
MONSTER_CHANCES.put(20236, 0.58); // Cave Servant
MONSTER_CHANCES.put(20238, 0.75); // Cave Servant Warrior
MONSTER_CHANCES.put(20237, 0.78); // Cave Servant Archer
MONSTER_CHANCES.put(20239, 0.79); // Cave Servant Captain
MONSTER_CHANCES.put(20240, 0.85); // Royal Cave Servant
MONSTER_CHANCES.put(20272, 0.58); // Cave Servant
MONSTER_CHANCES.put(20273, 0.78); // Cave Servant Archer
MONSTER_CHANCES.put(20274, 0.75); // Cave Servant Warrior
MONSTER_CHANCES.put(20275, 0.79); // Cave Servant Captain
MONSTER_CHANCES.put(20276, 0.85); // Royal Cave Servant
}
// Rewards
private static final ItemHolder ORIHARUKON_ORE = new ItemHolder(1874, 25);
private static final ItemHolder VARNISH_OF_PURITY = new ItemHolder(1887, 10);
private static final ItemHolder SCROLL_EWC = new ItemHolder(951, 1);
private static final ItemHolder RAID_SWORD = new ItemHolder(133, 1);
private static final ItemHolder COKES = new ItemHolder(1879, 55);
private static final ItemHolder RING_OF_AGES = new ItemHolder(885, 1);
private static final ItemHolder LEATHER = new ItemHolder(1882, 70);
private static final ItemHolder COARSE_BONE_POWDER = new ItemHolder(1881, 50);
private static final ItemHolder HEAVY_DOOM_HAMMER = new ItemHolder(191, 1);
private static final ItemHolder STONE_OF_PURITY = new ItemHolder(1875, 19);
private static final ItemHolder SCROLL_EAC = new ItemHolder(952, 5);
private static final ItemHolder DRAKE_LEATHER_BOOTS = new ItemHolder(2437, 1);
// Misc
private static final int MIN_LVL = 48;
public Q00344_1000YearsTheEndOfLamentation()
{
super(344);
addStartNpc(GILMORE);
addTalkId(KAIEN, GARVARENTZ, GILMORE, RODEMAI, ORVEN);
addKillId(MONSTER_CHANCES.keySet());
registerQuestItems(ARTICLES, OLD_KEY.getId(), OLD_HILT.getId(), TOTEM_NECKLACE.getId(), CRUCIFIX.getId());
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs == null)
{
return htmltext;
}
switch (event)
{
case "30754-03.htm":
case "30754-16.html":
{
htmltext = event;
break;
}
case "30754-04.htm":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "30754-08.html":
{
if (qs.isCond(1))
{
final long count = getQuestItemsCount(player, ARTICLES);
if (count < 1)
{
htmltext = "30754-07.html";
}
else
{
takeItems(player, ARTICLES, -1);
if (getRandom(1000) >= count)
{
giveAdena(player, count * 60, true);
htmltext = event;
}
else
{
qs.setCond(2, true);
switch (getRandom(4))
{
case 0:
{
qs.setMemoState(1);
giveItems(player, OLD_HILT);
break;
}
case 1:
{
qs.setMemoState(2);
giveItems(player, OLD_KEY);
break;
}
case 2:
{
qs.setMemoState(3);
giveItems(player, TOTEM_NECKLACE);
break;
}
case 3:
{
qs.setMemoState(4);
giveItems(player, CRUCIFIX);
break;
}
}
htmltext = "30754-09.html";
}
}
}
break;
}
case "30754-17.html":
{
if (qs.isCond(1))
{
htmltext = event;
qs.exitQuest(true, true);
}
break;
}
case "relic_info":
{
switch (qs.getMemoState())
{
case 1:
{
htmltext = "30754-10.html";
break;
}
case 2:
{
htmltext = "30754-11.html";
break;
}
case 3:
{
htmltext = "30754-12.html";
break;
}
case 4:
{
htmltext = "30754-13.html";
break;
}
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, PlayerInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (npc.getId())
{
case GILMORE:
{
if (qs.isCreated())
{
htmltext = (talker.getLevel() >= MIN_LVL) ? "30754-02.htm" : "30754-01.htm";
}
else if (qs.isStarted())
{
if (qs.isCond(1))
{
htmltext = (hasQuestItems(talker, ARTICLES)) ? "30754-06.html" : "30754-05.html";
}
else if (hasItem(talker, OLD_KEY) || hasItem(talker, OLD_HILT) || hasItem(talker, TOTEM_NECKLACE) || hasItem(talker, CRUCIFIX))
{
htmltext = "30754-14.html";
}
else
{
qs.setCond(1);
htmltext = "30754-15.html";
}
}
else
{
htmltext = getAlreadyCompletedMsg(talker);
}
break;
}
case KAIEN:
{
if (qs.getMemoState() == 1)
{
if (hasItem(talker, OLD_HILT))
{
takeItems(talker, OLD_HILT.getId(), -1);
final int rand = getRandom(100);
if (rand <= 52)
{
rewardItems(talker, ORIHARUKON_ORE);
}
else if (rand <= 76)
{
rewardItems(talker, VARNISH_OF_PURITY);
}
else if (rand <= 98)
{
rewardItems(talker, SCROLL_EWC);
}
else
{
rewardItems(talker, RAID_SWORD);
}
qs.setCond(1);
htmltext = "30623-01.html";
}
else
{
htmltext = "30623-02.html";
}
}
break;
}
case RODEMAI:
{
if (qs.getMemoState() == 2)
{
if (hasItem(talker, OLD_KEY))
{
takeItems(talker, OLD_KEY.getId(), -1);
final int rand = getRandom(100);
if (rand <= 39)
{
rewardItems(talker, COKES);
}
else if (rand <= 89)
{
rewardItems(talker, SCROLL_EWC);
}
else
{
rewardItems(talker, RING_OF_AGES);
}
qs.setCond(1);
htmltext = "30756-01.html";
}
else
{
htmltext = "30756-02.html";
}
}
break;
}
case GARVARENTZ:
{
if (qs.getMemoState() == 3)
{
if (hasItem(talker, TOTEM_NECKLACE))
{
takeItems(talker, TOTEM_NECKLACE.getId(), -1);
final int rand = getRandom(100);
if (rand <= 47)
{
rewardItems(talker, LEATHER);
}
else if (rand <= 97)
{
rewardItems(talker, COARSE_BONE_POWDER);
}
else
{
rewardItems(talker, HEAVY_DOOM_HAMMER);
}
qs.setCond(1);
htmltext = "30704-01.html";
}
else
{
htmltext = "30704-02.html";
}
}
break;
}
case ORVEN:
{
if (qs.getMemoState() == 4)
{
if (hasItem(talker, CRUCIFIX))
{
takeItems(talker, CRUCIFIX.getId(), -1);
final int rand = getRandom(100);
if (rand <= 49)
{
rewardItems(talker, STONE_OF_PURITY);
}
else if (rand <= 69)
{
rewardItems(talker, SCROLL_EAC);
}
else
{
rewardItems(talker, DRAKE_LEATHER_BOOTS);
}
qs.setCond(1);
htmltext = "30857-01.html";
}
else
{
htmltext = "30857-02.html";
}
}
break;
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, 1, 3, npc);
if (qs != null)
{
giveItemRandomly(qs.getPlayer(), npc, ARTICLES, 1, 0, MONSTER_CHANCES.get(npc.getId()), true);
}
return super.onKill(npc, killer, isSummon);
}
}
static
{
MONSTER_CHANCES.put(20236, 0.58); // Cave Servant
MONSTER_CHANCES.put(20238, 0.75); // Cave Servant Warrior
MONSTER_CHANCES.put(20237, 0.78); // Cave Servant Archer
MONSTER_CHANCES.put(20239, 0.79); // Cave Servant Captain
MONSTER_CHANCES.put(20240, 0.85); // Royal Cave Servant
MONSTER_CHANCES.put(20272, 0.58); // Cave Servant
MONSTER_CHANCES.put(20273, 0.78); // Cave Servant Archer
MONSTER_CHANCES.put(20274, 0.75); // Cave Servant Warrior
MONSTER_CHANCES.put(20275, 0.79); // Cave Servant Captain
MONSTER_CHANCES.put(20276, 0.85); // Royal Cave Servant
}
// Rewards
private static final ItemHolder ORIHARUKON_ORE = new ItemHolder(1874, 25);
private static final ItemHolder VARNISH_OF_PURITY = new ItemHolder(1887, 10);
private static final ItemHolder SCROLL_EWC = new ItemHolder(951, 1);
private static final ItemHolder RAID_SWORD = new ItemHolder(133, 1);
private static final ItemHolder COKES = new ItemHolder(1879, 55);
private static final ItemHolder RING_OF_AGES = new ItemHolder(885, 1);
private static final ItemHolder LEATHER = new ItemHolder(1882, 70);
private static final ItemHolder COARSE_BONE_POWDER = new ItemHolder(1881, 50);
private static final ItemHolder HEAVY_DOOM_HAMMER = new ItemHolder(191, 1);
private static final ItemHolder STONE_OF_PURITY = new ItemHolder(1875, 19);
private static final ItemHolder SCROLL_EAC = new ItemHolder(952, 5);
private static final ItemHolder DRAKE_LEATHER_BOOTS = new ItemHolder(2437, 1);
// Misc
private static final int MIN_LVL = 48;
public Q00344_1000YearsTheEndOfLamentation()
{
super(344);
addStartNpc(GILMORE);
addTalkId(KAIEN, GARVARENTZ, GILMORE, RODEMAI, ORVEN);
addKillId(MONSTER_CHANCES.keySet());
registerQuestItems(ARTICLES, OLD_KEY.getId(), OLD_HILT.getId(), TOTEM_NECKLACE.getId(), CRUCIFIX.getId());
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs == null)
{
return htmltext;
}
switch (event)
{
case "30754-03.htm":
case "30754-16.html":
{
htmltext = event;
break;
}
case "30754-04.htm":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "30754-08.html":
{
if (qs.isCond(1))
{
final long count = getQuestItemsCount(player, ARTICLES);
if (count < 1)
{
htmltext = "30754-07.html";
}
else
{
takeItems(player, ARTICLES, -1);
if (getRandom(1000) >= count)
{
giveAdena(player, count * 60, true);
htmltext = event;
}
else
{
qs.setCond(2, true);
switch (getRandom(4))
{
case 0:
{
qs.setMemoState(1);
giveItems(player, OLD_HILT);
break;
}
case 1:
{
qs.setMemoState(2);
giveItems(player, OLD_KEY);
break;
}
case 2:
{
qs.setMemoState(3);
giveItems(player, TOTEM_NECKLACE);
break;
}
case 3:
{
qs.setMemoState(4);
giveItems(player, CRUCIFIX);
break;
}
}
htmltext = "30754-09.html";
}
}
}
break;
}
case "30754-17.html":
{
if (qs.isCond(1))
{
htmltext = event;
qs.exitQuest(true, true);
}
break;
}
case "relic_info":
{
switch (qs.getMemoState())
{
case 1:
{
htmltext = "30754-10.html";
break;
}
case 2:
{
htmltext = "30754-11.html";
break;
}
case 3:
{
htmltext = "30754-12.html";
break;
}
case 4:
{
htmltext = "30754-13.html";
break;
}
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, PlayerInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (npc.getId())
{
case GILMORE:
{
if (qs.isCreated())
{
htmltext = (talker.getLevel() >= MIN_LVL) ? "30754-02.htm" : "30754-01.htm";
}
else if (qs.isStarted())
{
if (qs.isCond(1))
{
htmltext = (hasQuestItems(talker, ARTICLES)) ? "30754-06.html" : "30754-05.html";
}
else if (hasItem(talker, OLD_KEY) || hasItem(talker, OLD_HILT) || hasItem(talker, TOTEM_NECKLACE) || hasItem(talker, CRUCIFIX))
{
htmltext = "30754-14.html";
}
else
{
qs.setCond(1);
htmltext = "30754-15.html";
}
}
else
{
htmltext = getAlreadyCompletedMsg(talker);
}
break;
}
case KAIEN:
{
if (qs.getMemoState() == 1)
{
if (hasItem(talker, OLD_HILT))
{
takeItems(talker, OLD_HILT.getId(), -1);
final int rand = getRandom(100);
if (rand <= 52)
{
rewardItems(talker, ORIHARUKON_ORE);
}
else if (rand <= 76)
{
rewardItems(talker, VARNISH_OF_PURITY);
}
else if (rand <= 98)
{
rewardItems(talker, SCROLL_EWC);
}
else
{
rewardItems(talker, RAID_SWORD);
}
qs.setCond(1);
htmltext = "30623-01.html";
}
else
{
htmltext = "30623-02.html";
}
}
break;
}
case RODEMAI:
{
if (qs.getMemoState() == 2)
{
if (hasItem(talker, OLD_KEY))
{
takeItems(talker, OLD_KEY.getId(), -1);
final int rand = getRandom(100);
if (rand <= 39)
{
rewardItems(talker, COKES);
}
else if (rand <= 89)
{
rewardItems(talker, SCROLL_EWC);
}
else
{
rewardItems(talker, RING_OF_AGES);
}
qs.setCond(1);
htmltext = "30756-01.html";
}
else
{
htmltext = "30756-02.html";
}
}
break;
}
case GARVARENTZ:
{
if (qs.getMemoState() == 3)
{
if (hasItem(talker, TOTEM_NECKLACE))
{
takeItems(talker, TOTEM_NECKLACE.getId(), -1);
final int rand = getRandom(100);
if (rand <= 47)
{
rewardItems(talker, LEATHER);
}
else if (rand <= 97)
{
rewardItems(talker, COARSE_BONE_POWDER);
}
else
{
rewardItems(talker, HEAVY_DOOM_HAMMER);
}
qs.setCond(1);
htmltext = "30704-01.html";
}
else
{
htmltext = "30704-02.html";
}
}
break;
}
case ORVEN:
{
if (qs.getMemoState() == 4)
{
if (hasItem(talker, CRUCIFIX))
{
takeItems(talker, CRUCIFIX.getId(), -1);
final int rand = getRandom(100);
if (rand <= 49)
{
rewardItems(talker, STONE_OF_PURITY);
}
else if (rand <= 69)
{
rewardItems(talker, SCROLL_EAC);
}
else
{
rewardItems(talker, DRAKE_LEATHER_BOOTS);
}
qs.setCond(1);
htmltext = "30857-01.html";
}
else
{
htmltext = "30857-02.html";
}
}
break;
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, 1, 3, npc);
if (qs != null)
{
giveItemRandomly(qs.getPlayer(), npc, ARTICLES, 1, 0, MONSTER_CHANCES.get(npc.getId()), true);
}
return super.onKill(npc, killer, isSummon);
}
}

View File

@@ -44,7 +44,6 @@ public final class Q00360_PlunderTheirSupplies extends Quest
private static final int RECIPE_OF_SUPPLY = 5870;
private static final int SUPPLY_ITEMS = 5872;
private static final int SUSPICIOUS_DOCUMENT_PIECE = 5871;
static
{
MONSTER_DROP_CHANCES.put(20666, 50); // Taik Orc Seeker

View File

@@ -103,7 +103,6 @@ public final class Q00372_LegacyOfInsolence extends Quest
// Monsters
private static final int HALLATES_INSPECTOR = 20825;
private static final Map<Integer, QuestItemHolder> MONSTER_REWARDS = new HashMap<>();
static
{
MONSTER_REWARDS.put(20817, new QuestItemHolder(ANCIENT_RED_PAPYRUS, 302, 1));

View File

@@ -81,7 +81,6 @@ public final class Q00373_SupplierOfReagents extends Quest
private static final HashMap<String, Integer> HTML_TO_MEMO_STATE = new HashMap<>(20);
private static final HashMap<Integer, ItemHolder> MEMO_STATE_TO_ITEM = new HashMap<>(20);
private static final HashMap<Integer, Entry> MEMO_STATE_TO_REWARD = new HashMap<>(15);
static
{
// List of ingredients to mix

View File

@@ -1,202 +1,203 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.Q00380_BringOutTheFlavorOfIngredients;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
/**
* Bring Out the Flavor of Ingredients! (380)
* @author Pandragon
*/
public final class Q00380_BringOutTheFlavorOfIngredients extends Quest
{
// NPC
private static final int ROLLAND = 30069;
// Items
private static final int ANTIDOTE = 1831;
private static final int RITRON_FRUIT = 5895;
private static final int MOON_FLOWER = 5896;
private static final int LEECH_FLUIDS = 5897;
// Monsters
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.Q00380_BringOutTheFlavorOfIngredients;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.ItemChanceHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
/**
* Bring Out the Flavor of Ingredients! (380)
* @author Pandragon
*/
public final class Q00380_BringOutTheFlavorOfIngredients extends Quest
{
// NPC
private static final int ROLLAND = 30069;
// Items
private static final int ANTIDOTE = 1831;
private static final int RITRON_FRUIT = 5895;
private static final int MOON_FLOWER = 5896;
private static final int LEECH_FLUIDS = 5897;
// Monsters
private static final Map<Integer, ItemChanceHolder> MONSTER_CHANCES = new HashMap<>();
{
MONSTER_CHANCES.put(20205, new ItemChanceHolder(RITRON_FRUIT, 0.1, 4)); // Dire Wolf
MONSTER_CHANCES.put(20206, new ItemChanceHolder(MOON_FLOWER, 0.5, 20)); // Kadif Werewolf
MONSTER_CHANCES.put(20225, new ItemChanceHolder(LEECH_FLUIDS, 0.5, 10)); // Giant Mist Leech
}
// Rewards
private static final int RITRON_RECIPE = 5959;
private static final int RITRON_DESSERT = 5960;
// Misc
private static final int MIN_LVL = 24;
public Q00380_BringOutTheFlavorOfIngredients()
{
super(380);
addStartNpc(ROLLAND);
addTalkId(ROLLAND);
addKillId(MONSTER_CHANCES.keySet());
registerQuestItems(RITRON_FRUIT, MOON_FLOWER, LEECH_FLUIDS);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs != null)
{
switch (event)
{
case "30069-03.htm":
case "30069-04.htm":
case "30069-06.html":
{
htmltext = event;
break;
}
case "30069-05.htm":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "30069-13.html":
{
if (qs.isCond(9))
{
rewardItems(player, RITRON_RECIPE, 1);
qs.exitQuest(true, true);
htmltext = event;
}
break;
}
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, PlayerInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (qs.getState())
{
case State.CREATED:
{
htmltext = (talker.getLevel() >= MIN_LVL) ? "30069-02.htm" : "30069-01.htm";
break;
}
case State.STARTED:
{
switch (qs.getCond())
{
case 1:
case 2:
case 3:
case 4:
{
if ((getQuestItemsCount(talker, ANTIDOTE) >= 2) && (getQuestItemsCount(talker, RITRON_FRUIT) >= 4) && (getQuestItemsCount(talker, MOON_FLOWER) >= 20) && (getQuestItemsCount(talker, LEECH_FLUIDS) >= 10))
{
takeItems(talker, ANTIDOTE, 2);
takeItems(talker, -1, RITRON_FRUIT, MOON_FLOWER, LEECH_FLUIDS);
qs.setCond(5, true);
htmltext = "30069-08.html";
}
else
{
htmltext = "30069-07.html";
}
break;
}
case 5:
{
qs.setCond(6, true);
htmltext = "30069-09.html";
break;
}
case 6:
{
qs.setCond(7, true);
htmltext = "30069-10.html";
break;
}
case 7:
{
qs.setCond(8, true);
htmltext = "30069-11.html";
break;
}
case 8:
{
rewardItems(talker, RITRON_DESSERT, 1);
if (getRandom(100) < 56)
{
htmltext = "30069-15.html";
qs.exitQuest(true, true);
}
else
{
qs.setCond(9, true);
htmltext = "30069-12.html";
}
break;
}
case 9:
{
htmltext = "30069-12.html";
break;
}
}
break;
}
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(talker);
break;
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
if ((qs != null) && (qs.getCond() < 4))
{
final ItemChanceHolder item = MONSTER_CHANCES.get(npc.getId());
if (giveItemRandomly(qs.getPlayer(), npc, item.getId(), 1, item.getCount(), item.getChance(), true))
{
qs.setCond(qs.getCond() + 1, true);
}
}
return super.onKill(npc, killer, isSummon);
}
}
static
{
MONSTER_CHANCES.put(20205, new ItemChanceHolder(RITRON_FRUIT, 0.1, 4)); // Dire Wolf
MONSTER_CHANCES.put(20206, new ItemChanceHolder(MOON_FLOWER, 0.5, 20)); // Kadif Werewolf
MONSTER_CHANCES.put(20225, new ItemChanceHolder(LEECH_FLUIDS, 0.5, 10)); // Giant Mist Leech
}
// Rewards
private static final int RITRON_RECIPE = 5959;
private static final int RITRON_DESSERT = 5960;
// Misc
private static final int MIN_LVL = 24;
public Q00380_BringOutTheFlavorOfIngredients()
{
super(380);
addStartNpc(ROLLAND);
addTalkId(ROLLAND);
addKillId(MONSTER_CHANCES.keySet());
registerQuestItems(RITRON_FRUIT, MOON_FLOWER, LEECH_FLUIDS);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs != null)
{
switch (event)
{
case "30069-03.htm":
case "30069-04.htm":
case "30069-06.html":
{
htmltext = event;
break;
}
case "30069-05.htm":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "30069-13.html":
{
if (qs.isCond(9))
{
rewardItems(player, RITRON_RECIPE, 1);
qs.exitQuest(true, true);
htmltext = event;
}
break;
}
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, PlayerInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (qs.getState())
{
case State.CREATED:
{
htmltext = (talker.getLevel() >= MIN_LVL) ? "30069-02.htm" : "30069-01.htm";
break;
}
case State.STARTED:
{
switch (qs.getCond())
{
case 1:
case 2:
case 3:
case 4:
{
if ((getQuestItemsCount(talker, ANTIDOTE) >= 2) && (getQuestItemsCount(talker, RITRON_FRUIT) >= 4) && (getQuestItemsCount(talker, MOON_FLOWER) >= 20) && (getQuestItemsCount(talker, LEECH_FLUIDS) >= 10))
{
takeItems(talker, ANTIDOTE, 2);
takeItems(talker, -1, RITRON_FRUIT, MOON_FLOWER, LEECH_FLUIDS);
qs.setCond(5, true);
htmltext = "30069-08.html";
}
else
{
htmltext = "30069-07.html";
}
break;
}
case 5:
{
qs.setCond(6, true);
htmltext = "30069-09.html";
break;
}
case 6:
{
qs.setCond(7, true);
htmltext = "30069-10.html";
break;
}
case 7:
{
qs.setCond(8, true);
htmltext = "30069-11.html";
break;
}
case 8:
{
rewardItems(talker, RITRON_DESSERT, 1);
if (getRandom(100) < 56)
{
htmltext = "30069-15.html";
qs.exitQuest(true, true);
}
else
{
qs.setCond(9, true);
htmltext = "30069-12.html";
}
break;
}
case 9:
{
htmltext = "30069-12.html";
break;
}
}
break;
}
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(talker);
break;
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
if ((qs != null) && (qs.getCond() < 4))
{
final ItemChanceHolder item = MONSTER_CHANCES.get(npc.getId());
if (giveItemRandomly(qs.getPlayer(), npc, item.getId(), 1, item.getCount(), item.getChance(), true))
{
qs.setCond(qs.getCond() + 1, true);
}
}
return super.onKill(npc, killer, isSummon);
}
}

View File

@@ -1,184 +1,185 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.Q00385_YokeOfThePast;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
/**
* Yoke of the Past (385)
* @author Pandragon
*/
public final class Q00385_YokeOfThePast extends Quest
{
// NPCs
// @formatter:off
private static final int[] ZIGGURATS =
{
31095, 31096, 31097, 31098, 31099, 31100, 31101,
31102, 31103, 31104, 31105, 31106, 31107, 31108,
31109, 31110, 31114, 31115, 31116, 31117, 31118,
31119, 31120, 31121, 31122, 31123, 31124, 31125
};
// @formatter:on
// Item
private static final int SCROLL_OF_ANCIENT_MAGIC = 5902;
// Reward
private static final int BLANK_SCROLL = 5965;
// Monsters
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.Q00385_YokeOfThePast;
import java.util.HashMap;
import java.util.Map;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
/**
* Yoke of the Past (385)
* @author Pandragon
*/
public final class Q00385_YokeOfThePast extends Quest
{
// NPCs
// @formatter:off
private static final int[] ZIGGURATS =
{
31095, 31096, 31097, 31098, 31099, 31100, 31101,
31102, 31103, 31104, 31105, 31106, 31107, 31108,
31109, 31110, 31114, 31115, 31116, 31117, 31118,
31119, 31120, 31121, 31122, 31123, 31124, 31125
};
// @formatter:on
// Item
private static final int SCROLL_OF_ANCIENT_MAGIC = 5902;
// Reward
private static final int BLANK_SCROLL = 5965;
// Monsters
private static final Map<Integer, Double> MONSTER_CHANCES = new HashMap<>();
{
MONSTER_CHANCES.put(21144, 0.306); // Catacomb Shadow
MONSTER_CHANCES.put(21156, 0.994); // Purgatory Shadow
MONSTER_CHANCES.put(21208, 0.146); // Hallowed Watchman
MONSTER_CHANCES.put(21209, 0.166); // Hallowed Seer
MONSTER_CHANCES.put(21210, 0.202); // Vault Guardian
MONSTER_CHANCES.put(21211, 0.212); // Vault Seer
MONSTER_CHANCES.put(21213, 0.274); // Hallowed Monk
MONSTER_CHANCES.put(21214, 0.342); // Vault Sentinel
MONSTER_CHANCES.put(21215, 0.360); // Vault Monk
MONSTER_CHANCES.put(21217, 0.460); // Hallowed Priest
MONSTER_CHANCES.put(21218, 0.558); // Vault Overlord
MONSTER_CHANCES.put(21219, 0.578); // Vault Priest
MONSTER_CHANCES.put(21221, 0.710); // Sepulcher Inquisitor
MONSTER_CHANCES.put(21222, 0.842); // Sepulcher Archon
MONSTER_CHANCES.put(21223, 0.862); // Sepulcher Inquisitor
MONSTER_CHANCES.put(21224, 0.940); // Sepulcher Guardian
MONSTER_CHANCES.put(21225, 0.970); // Sepulcher Sage
MONSTER_CHANCES.put(21226, 0.202); // Sepulcher Guardian
MONSTER_CHANCES.put(21227, 0.290); // Sepulcher Sage
MONSTER_CHANCES.put(21228, 0.316); // Sepulcher Guard
MONSTER_CHANCES.put(21229, 0.426); // Sepulcher Preacher
MONSTER_CHANCES.put(21230, 0.646); // Sepulcher Guard
MONSTER_CHANCES.put(21231, 0.654); // Sepulcher Preacher
MONSTER_CHANCES.put(21236, 0.238); // Barrow Sentinel
MONSTER_CHANCES.put(21237, 0.274); // Barrow Monk
MONSTER_CHANCES.put(21238, 0.342); // Grave Sentinel
MONSTER_CHANCES.put(21239, 0.360); // Grave Monk
MONSTER_CHANCES.put(21240, 0.410); // Barrow Overlord
MONSTER_CHANCES.put(21241, 0.460); // Barrow Priest
MONSTER_CHANCES.put(21242, 0.558); // Grave Overlord
MONSTER_CHANCES.put(21243, 0.578); // Grave Priest
MONSTER_CHANCES.put(21244, 0.642); // Crypt Archon
MONSTER_CHANCES.put(21245, 0.700); // Crypt Inquisitor
MONSTER_CHANCES.put(21246, 0.842); // Tomb Archon
MONSTER_CHANCES.put(21247, 0.862); // Tomb Inquisitor
MONSTER_CHANCES.put(21248, 0.940); // Crypt Guardian
MONSTER_CHANCES.put(21249, 0.970); // Crypt Sage
MONSTER_CHANCES.put(21250, 0.798); // Tomb Guardian
MONSTER_CHANCES.put(21251, 0.710); // Tomb Sage
MONSTER_CHANCES.put(21252, 0.684); // Crypt Guard
MONSTER_CHANCES.put(21253, 0.574); // Crypt Preacher
MONSTER_CHANCES.put(21254, 0.354); // Tomb Guard
MONSTER_CHANCES.put(21255, 0.250); // Tomb Preacher
}
// Misc
private static final int MIN_LVL = 20;
public Q00385_YokeOfThePast()
{
super(385);
addStartNpc(ZIGGURATS);
addTalkId(ZIGGURATS);
addKillId(MONSTER_CHANCES.keySet());
registerQuestItems(SCROLL_OF_ANCIENT_MAGIC);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs != null)
{
switch (event)
{
case "ziggurat-03.htm":
case "ziggurat-04.htm":
case "ziggurat-06.htm":
case "ziggurat-07.htm":
{
htmltext = event;
break;
}
case "ziggurat-05.htm":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "ziggurat-10.html":
{
qs.exitQuest(true, true);
htmltext = event;
break;
}
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, PlayerInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (qs.getState())
{
case State.CREATED:
{
htmltext = (talker.getLevel() >= MIN_LVL) ? "ziggurat-01.htm" : "ziggurat-02.htm";
break;
}
case State.STARTED:
{
if (hasQuestItems(talker, SCROLL_OF_ANCIENT_MAGIC))
{
rewardItems(talker, BLANK_SCROLL, getQuestItemsCount(talker, SCROLL_OF_ANCIENT_MAGIC));
takeItems(talker, SCROLL_OF_ANCIENT_MAGIC, -1);
htmltext = "ziggurat-09.html";
}
else
{
htmltext = "ziggurat-08.html";
}
break;
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
if (qs != null)
{
giveItemRandomly(qs.getPlayer(), npc, SCROLL_OF_ANCIENT_MAGIC, 1, 0, MONSTER_CHANCES.get(npc.getId()), true);
}
return super.onKill(npc, killer, isSummon);
}
}
static
{
MONSTER_CHANCES.put(21144, 0.306); // Catacomb Shadow
MONSTER_CHANCES.put(21156, 0.994); // Purgatory Shadow
MONSTER_CHANCES.put(21208, 0.146); // Hallowed Watchman
MONSTER_CHANCES.put(21209, 0.166); // Hallowed Seer
MONSTER_CHANCES.put(21210, 0.202); // Vault Guardian
MONSTER_CHANCES.put(21211, 0.212); // Vault Seer
MONSTER_CHANCES.put(21213, 0.274); // Hallowed Monk
MONSTER_CHANCES.put(21214, 0.342); // Vault Sentinel
MONSTER_CHANCES.put(21215, 0.360); // Vault Monk
MONSTER_CHANCES.put(21217, 0.460); // Hallowed Priest
MONSTER_CHANCES.put(21218, 0.558); // Vault Overlord
MONSTER_CHANCES.put(21219, 0.578); // Vault Priest
MONSTER_CHANCES.put(21221, 0.710); // Sepulcher Inquisitor
MONSTER_CHANCES.put(21222, 0.842); // Sepulcher Archon
MONSTER_CHANCES.put(21223, 0.862); // Sepulcher Inquisitor
MONSTER_CHANCES.put(21224, 0.940); // Sepulcher Guardian
MONSTER_CHANCES.put(21225, 0.970); // Sepulcher Sage
MONSTER_CHANCES.put(21226, 0.202); // Sepulcher Guardian
MONSTER_CHANCES.put(21227, 0.290); // Sepulcher Sage
MONSTER_CHANCES.put(21228, 0.316); // Sepulcher Guard
MONSTER_CHANCES.put(21229, 0.426); // Sepulcher Preacher
MONSTER_CHANCES.put(21230, 0.646); // Sepulcher Guard
MONSTER_CHANCES.put(21231, 0.654); // Sepulcher Preacher
MONSTER_CHANCES.put(21236, 0.238); // Barrow Sentinel
MONSTER_CHANCES.put(21237, 0.274); // Barrow Monk
MONSTER_CHANCES.put(21238, 0.342); // Grave Sentinel
MONSTER_CHANCES.put(21239, 0.360); // Grave Monk
MONSTER_CHANCES.put(21240, 0.410); // Barrow Overlord
MONSTER_CHANCES.put(21241, 0.460); // Barrow Priest
MONSTER_CHANCES.put(21242, 0.558); // Grave Overlord
MONSTER_CHANCES.put(21243, 0.578); // Grave Priest
MONSTER_CHANCES.put(21244, 0.642); // Crypt Archon
MONSTER_CHANCES.put(21245, 0.700); // Crypt Inquisitor
MONSTER_CHANCES.put(21246, 0.842); // Tomb Archon
MONSTER_CHANCES.put(21247, 0.862); // Tomb Inquisitor
MONSTER_CHANCES.put(21248, 0.940); // Crypt Guardian
MONSTER_CHANCES.put(21249, 0.970); // Crypt Sage
MONSTER_CHANCES.put(21250, 0.798); // Tomb Guardian
MONSTER_CHANCES.put(21251, 0.710); // Tomb Sage
MONSTER_CHANCES.put(21252, 0.684); // Crypt Guard
MONSTER_CHANCES.put(21253, 0.574); // Crypt Preacher
MONSTER_CHANCES.put(21254, 0.354); // Tomb Guard
MONSTER_CHANCES.put(21255, 0.250); // Tomb Preacher
}
// Misc
private static final int MIN_LVL = 20;
public Q00385_YokeOfThePast()
{
super(385);
addStartNpc(ZIGGURATS);
addTalkId(ZIGGURATS);
addKillId(MONSTER_CHANCES.keySet());
registerQuestItems(SCROLL_OF_ANCIENT_MAGIC);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs != null)
{
switch (event)
{
case "ziggurat-03.htm":
case "ziggurat-04.htm":
case "ziggurat-06.htm":
case "ziggurat-07.htm":
{
htmltext = event;
break;
}
case "ziggurat-05.htm":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "ziggurat-10.html":
{
qs.exitQuest(true, true);
htmltext = event;
break;
}
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, PlayerInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (qs.getState())
{
case State.CREATED:
{
htmltext = (talker.getLevel() >= MIN_LVL) ? "ziggurat-01.htm" : "ziggurat-02.htm";
break;
}
case State.STARTED:
{
if (hasQuestItems(talker, SCROLL_OF_ANCIENT_MAGIC))
{
rewardItems(talker, BLANK_SCROLL, getQuestItemsCount(talker, SCROLL_OF_ANCIENT_MAGIC));
takeItems(talker, SCROLL_OF_ANCIENT_MAGIC, -1);
htmltext = "ziggurat-09.html";
}
else
{
htmltext = "ziggurat-08.html";
}
break;
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
if (qs != null)
{
giveItemRandomly(qs.getPlayer(), npc, SCROLL_OF_ANCIENT_MAGIC, 1, 0, MONSTER_CHANCES.get(npc.getId()), true);
}
return super.onKill(npc, killer, isSummon);
}
}

View File

@@ -75,7 +75,6 @@ public final class Q00419_GetAPet extends Quest
private static final int MIN_LEVEL = 15;
// Links
private static final Map<Integer, String> LINKS = new HashMap<>();
static
{
LINKS.put(1110001, "<a action=\"bypass -h Quest Q00419_GetAPet 30731-14.html\">Can be used for item transportation.</a><br>");

View File

@@ -42,7 +42,6 @@ public class Q00461_RumbleInTheBase extends Quest
private static final int SHOES_STRING_OF_SEL_MAHUM = 16382;
// Mobs
private static final Map<Integer, Integer> MONSTERS = new HashMap<>();
static
{
MONSTERS.put(22780, 581);

View File

@@ -67,7 +67,6 @@ public class Q00463_IMustBeaGenius extends Quest
// Mobs
private static final Map<Integer, DropInfo> MOBS = new HashMap<>();
static
{
MOBS.put(22801, new DropInfo(5, 0));

View File

@@ -39,7 +39,6 @@ public class Q00601_WatchingEyes extends Quest
private static final int PROOF_OF_AVENGER = 7188;
// Monsters
private static final Map<Integer, Integer> MOBS = new HashMap<>();
static
{
MOBS.put(21308, 790);

View File

@@ -44,7 +44,6 @@ public final class Q00628_HuntGoldenRam extends Quest
private static final int MIN_LVL = 66;
// Mobs
private static final Map<Integer, ItemChanceHolder> MOBS_DROP_CHANCES = new HashMap<>();
static
{
MOBS_DROP_CHANCES.put(21508, new ItemChanceHolder(SPLINTER_STAKATO_CHITIN, 0.500, 1)); // splinter_stakato

View File

@@ -40,7 +40,6 @@ public final class Q00629_CleanUpTheSwampOfScreams extends Quest
private static final int MIN_LVL = 66;
// Mobs
private static final Map<Integer, Double> MOBS_DROP_CHANCES = new HashMap<>();
static
{
MOBS_DROP_CHANCES.put(21508, 0.599); // splinter_stakato

View File

@@ -43,7 +43,6 @@ public final class Q00644_GraveRobberAnnihilation extends Quest
private static final Map<Integer, Double> MONSTER_DROP_CHANCES = new HashMap<>();
// Rewards
private static final Map<String, ItemHolder> REWARDS = new HashMap<>();
static
{
MONSTER_DROP_CHANCES.put(22003, 0.714); // Grave Robber Scout

View File

@@ -42,7 +42,6 @@ public final class Q00649_ALooterAndARailroadMan extends Quest
private static final int MIN_LVL = 30;
// Monsters
private static final Map<Integer, Integer> MONSTERS = new HashMap<>();
static
{
MONSTERS.put(22017, 529); // Bandit Sweeper

View File

@@ -43,7 +43,6 @@ public class Q00716_PathToBecomingALordRune extends Quest
private static final int RuneCastle = 8;
private static List<Integer> Pagans = new ArrayList<>();
static
{
for (int i = 22138; i <= 22176; i++)